Receiving too many requests in my Bot user from sl

2019-01-20 17:33发布

问题:

I am trying to implement a bot user in slack, but right now when i send a message to slack as a user, my bot gets more messages requests than it should.

The event that I have added to my bot user is message.groups. I don't know if the events can interferer with the normal flow of the conversation.

In this log USER REQUEST is what the user sent to the bot and BOT AWSER is what bot sends. As you can see slack is receiving the same message (event_time is the same) two times in a row, when i send just one message to the channel.

Can someone tell me if this is my problem and not slack problem? What can I do to revert this situation and begin to receive only the messages I post to slack instead of getting repeated messages?

回答1:

No, that is normal behavior. Your bot will receive all message send to the channels your bot is in, including the messages the bot is sending himself. The only way to deal with this in my experience is to to filter out unwanted messages in your bot to avoid loops and double-processing of messages.