期望可以支持和机器人进行私信聊天 || Hopefully support private message chatting with robots
Closed this issue · 14 comments
bot can send message using sendMessage api,but how does the bot get the message ?
you can checkout this document
https://tailchat.msgbyte.com/blog/tailchat-laf-robot
you can checkout this document https://tailchat.msgbyte.com/blog/tailchat-laf-robot
i have developed some bots, but private message chatting with bots is not supported
show your code
this code is useless.
this just looks like a api which call by others.
you need provide more context than i can help you
or just create a webhook and receive all message post by tailchat.
bot receive message -> tailchat service will check bot config, if has set callback url, its will post a request to target service -> use your service to receive message
now you can get payload from http request which send from tailchat service. then you can study it if you wanna create a service which not provide sdk yet.
bot receive message -> tailchat service will check bot config, if has set callback url, its will post a request to target service -> use your service to receive message
now you can get payload from http request which send from tailchat service. then you can study it if you wanna create a service which not provide sdk yet.
The above process should be the process of message execution after a bot is @ in the group. Now this process can work.
I now find,
bot receives private messages -> even if the callback URL is configured, it will not send a request to the target service -> messages will not be received using your service.
Is it a configuration problem or is this the case now?
Oh i get it. because of bot callback service is based on inbox feature not message feature.(because message is a high frequency operation, add check will reduce performance of whole service.)
Bot should have own logic to make sure message payload should easy be detect. let me see.
Reference:
tailchat/server/services/openapi/bot.service.ts
Lines 17 to 74 in d88b307
Oh i get it. because of bot callback service is based on inbox feature not message feature.(because message is a high frequency operation, add check will reduce performance of whole service.)
Bot should have own logic to make sure message payload should easy be detect. let me see.
Reference:
tailchat/server/services/openapi/bot.service.ts
Lines 17 to 74 in d88b307
callback
Yes, that's right.
The bot callback service can be based on the message feature. Whether this feature will be supported in the future.
Here is 2 way:
- you can use websocket client in bot. than you can receive all event which happen in this bot. but this way not support serverless service. for detail usage you can reference nodejs sdk https://github.com/msgbyte/tailchat/blob/master/client/packages/tailchat-client-sdk/src/openapi/client/ws.ts
- I added mention feature in latest code. then you can mention bot in DM
This is a great feature, looking forward to it