Closed robertyates closed 7 years ago
I've tested this with bot Slack and Facebook Messenger, and it looks like this problem is unique to Slack. The change you proposed above does fix the problem, and it seems like the best solution to me. I'll submit a pull request and have others review it as well.
I got up and running with botkit and the watson middleware.
When I looked at the logs in the "improve" tab, I noticed that Watson Conversation was also getting called with the response payload.
In my example I would issue a "hello", Watson would respond with a "Hello Again" but then the code was sending this response back to the server as a user request so I would also see in the improve logs an utterance coming from the user of "Hello Again".
I debugged the code and it looks like receive also gets called when a message is sent back to the client (this was slack). I hacked the code below to look for bot_id and this seems to have fixed it, but it may well only work for slack.