Forum Discussion
MS Teams Bot Event Not Fired when message is sent from outside the Teams Bot
Nikitha-MSFT I am trying to implement the following solution for managing a long running process in MS Teams Bot. However I am getting error while Event Activity Type message back to Bot from Azure Function.
When I send an Message Activity Type message back to Bot from Azure function no event get raised on the Bot side. I expected OnMessageActivityAsync or OnEventActivityAsync event handlers in DialogBot.cs to be raised when an Activity message gets sent from Azure Function.
I tried to send an Activity message to Bot from a sample windows application but still no events were triggered on the Bot side. On both occasions, the message send by Azure Function and sample Windows application appeared in the bot chat window.
Let me know if you need more information.
Thanks !
gagsbhatnagar - when you use the message back functionality teams directly send the displaytext mentioned in the card. Are you not receiving the message?
- gagsbhatnagarDec 31, 2020Copper ContributorNikitha-MSFT I am receiving the message in teams. However, I need to capture the message received in my bot code so that I can process it. Please see the documentation - https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-long-operations-guidance?view=azure-bot-service-4.0
In the above documentation, protected override OnEventActivityAsync is supposed to be invoked when the message is received by the bot.- Nikitha-MSFTJan 06, 2021Microsoft
gagsbhatnagar - When you are sending message from the azure did you @mention the bot in the message? Are you sending message to team/Group/personal chat between user &bot? Could you please share the repro steps?
- gagsbhatnagarJan 15, 2021Copper Contributor
Nikitha-MSFT I did not use @mention in the Activity message that I am sending as a personal chat between Bot and user. I tried using @mention in my code but it still did not result in bot event being triggered even though the message that I sent from outside the bot code appeared in the chat bot window.