microsoft / BotFramework-Hubot

Hubot adapter for botframework
MIT License
111 stars 40 forks source link

Hubot says it's replying but the message doesn't arrive #59

Closed adamjmont closed 2 years ago

adamjmont commented 2 years ago

Is this being maintained at all? My org has moved from Slack, where we used hubot daily for automations, to Teams, where we're trying to get hubot set up to do the same thing. We could use some help.

I just set up hubot with this adapter, went through the bot registration, created an app and added it to Teams, and most everything appears to be working--but Teams will not receive replies from hubot. With some debugging I can see the json payload that hubot is trying to send out, and I can see the ChatConnector trying to send a message, but it doesn't arrive.

ChatConnector: message received.
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-botframework-adapter: onBotEvents
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-botframework-adapter: Handling activity Channel: msteams; type: message
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-botframework-middleware: creating middleware...
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-msteams: toReceivable
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] DEBUG Message 'yoda hi' matched regex //(\w+)\s(\w+)/i/; listener.options = { id: null }
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] DEBUG Executing listener callback for Message 'yoda hi'
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] DEBUG Message 'yoda hi' matched regex //^\s*[@]?yoda[:,]?\s*(?:hi|hey|sup|howdy|aloha|greetings|hello)/i/; listener.options = { id: null }
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] DEBUG Executing listener callback for Message 'yoda hi'
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-botframework-adapter: reply
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-botframework-middleware: creating middleware...
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-msteams: toSendable
ChatConnector: sending message.

Capture

What can we do?

adamjmont commented 2 years ago

I don't get a response from web chat either when testing here: https://dev.botframework.com/bots/channels?id=

haodeon commented 2 years ago

In march I deployed a working hubot running on Azure App service connected to Microsoft Teams.

In my testing I discovered a bug in this adapter when combined with a persistent brain.

After initialisation, hubot works until it is restarted, then it will not send messages until the brain is cleared.

At least I can confirm this adapter is still working, for now.

adamjmont commented 2 years ago

Thanks @haodeon , I should have updated this issue. I don't have that problem with a persistent brain--but we are using redis with hubot. I was able to find a solution to my problem, which was to change the api URL that the bot sends its requests to. I used the URL that's attached to my bot that was created in the Azure portal and it's been working fine since.