Home

Bot doesn't reply in private chat

%3CLINGO-SUB%20id%3D%22lingo-sub-650958%22%20slang%3D%22en-US%22%3EBot%20doesn't%20reply%20in%20private%20chat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-650958%22%20slang%3D%22en-US%22%3E%3CP%3ENote%3A%3C%2FP%3E%3CP%3E1)%20External%20apps%20is%20enabled%20in%20Office%20Admin%20Portal%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20install%20a%20bot%20in%20Teams%2C%20I'm%20able%20to%20talk%20to%20my%20bot%20via%20a%20private%20chat%20without%20issue.%20If%20I%20navigate%20to%20Office%20Admin%20Portal%20and%20toggle%20the%20%22allow%20sideloading%20of%20external%20apps%22%20from%20on%20to%20off%2C%20save%20it%2C%20and%20then%20toggle%20back%20to%20on%2C%20the%20bot%20fails%20to%20respond.%20I%20can%20however%20communicate%20to%20my%20bot%20via%20a%20Teams%20channel%20chat%2C%20by%20%22%40%22%20the%20bot.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThings%20I%20did%20to%20try%20troubleshoot%3A%3C%2FP%3E%3CP%3E1)%20Uninstalled%20and%20installed%20bot%20again%20-%20didn't%20work%3C%2FP%3E%3CP%3E2)%20Logout%20and%20log%20back%20in%20-%20didn't%20work%3C%2FP%3E%3CP%3E3)%20Restart%20bot%20app%20service%20in%20Azure%20-%20didn't%20work%3C%2FP%3E%3CP%3E4)%20Local%20debug%20using%20ngrok%20-%20unable%20to%20solve%20issue%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20debuged%20the%20bot%20using%20ngrok%20I%20got%20the%20following%20error%20when%20sending%20a%20message%20to%20the%20bot%20via%20a%20private%20chat%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%20Name%20Value%20Type%3C%2FP%3E%3CTABLE%3E%3CTBODY%3E%3CTR%3E%3CTD%3E%E2%96%B6%3C%2FTD%3E%3CTD%3EException%3C%2FTD%3E%3CTD%3EException%20thrown%3A%20'Microsoft.Bot.Schema.ErrorResponseException'%20in%20System.Private.CoreLib.dll%20(%22Operation%20returned%20an%20invalid%20status%20code%20'Forbidden'%22)%3C%2FTD%3E%3CTD%3EMicrosoft.Bot.Schema.ErrorResponseException%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENgrok%20returns%20a%20error%20500%20messages.%20However%2C%20if%20I%20send%20a%20message%20via%20a%20Teams%20channel%20to%20the%20bot%20I%20get%20a%20200%20message%20and%20the%20bot%20returns%20the%20expected%20message%20to%20me.%20Referring%20back%20to%20the%20error%2C%20it%20occurs%20at%20the%20spot%20where%20the%20bot%20is%20trying%20to%20reply%20to%20the%20user.%20So%20my%20theory%20is%2C%20somehow%20Teams%20still%20thinks%20that%20the%20policy%20of%20not%20allowing%20external%20apps%20is%20still%20in%20place%20and%20denies%20the%20bot%20from%20send%20the%20message%20to%20the%20user.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-650958%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBot%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-716888%22%20slang%3D%22en-US%22%3ERe%3A%20Bot%20doesn't%20reply%20in%20private%20chat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-716888%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F349717%22%20target%3D%22_blank%22%3E%40colbytimm%3C%2FA%3E%26nbsp%3B-%20Are%20new%20bots%20installed%20after%20toggling%20setting%20working%20fine%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-717447%22%20slang%3D%22en-US%22%3ERe%3A%20Bot%20doesn't%20reply%20in%20private%20chat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-717447%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F79135%22%20target%3D%22_blank%22%3E%40Wajeed%20Hanif%20Shaik%3C%2FA%3EI%20found%20that%20after%20a%20day%20it%20worked.%20Must%20be%20a%20timing%2Fsync%20issue%3F%20Not%20sure.%20Anyway%2C%20not%20experiencing%20this%20issue%20anymore%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
colbytimm
New Contributor

Note:

1) External apps is enabled in Office Admin Portal

 

If I install a bot in Teams, I'm able to talk to my bot via a private chat without issue. If I navigate to Office Admin Portal and toggle the "allow sideloading of external apps" from on to off, save it, and then toggle back to on, the bot fails to respond. I can however communicate to my bot via a Teams channel chat, by "@" the bot.

 

Things I did to try troubleshoot:

1) Uninstalled and installed bot again - didn't work

2) Logout and log back in - didn't work

3) Restart bot app service in Azure - didn't work

4) Local debug using ngrok - unable to solve issue

 

When I debuged the bot using ngrok I got the following error when sending a message to the bot via a private chat:

  Name Value Type

ExceptionException thrown: 'Microsoft.Bot.Schema.ErrorResponseException' in System.Private.CoreLib.dll ("Operation returned an invalid status code 'Forbidden'")Microsoft.Bot.Schema.ErrorResponseException

 

Ngrok returns a error 500 messages. However, if I send a message via a Teams channel to the bot I get a 200 message and the bot returns the expected message to me. Referring back to the error, it occurs at the spot where the bot is trying to reply to the user. So my theory is, somehow Teams still thinks that the policy of not allowing external apps is still in place and denies the bot from send the message to the user.

2 Replies

@colbytimm - Are new bots installed after toggling setting working fine?

@Wajeed Hanif ShaikI found that after a day it worked. Must be a timing/sync issue? Not sure. Anyway, not experiencing this issue anymore :)