My team has created a simple teams bot that sends adaptive cards to inform users on updates regarding our platform. When the bot gets a ping from our service’s api, it uses the data sent over in the request to send a simple adaptive card to the targeted user(s). However we recently stumbled across the issue where a user may have the bot blocked. This scenario leads to the bot defaulting to the default botAdapter.onTurnError
where it posts 2 messages in the bot’s installed channel — stating the error and to fix the source code.
I am at a loss on how to better handle these issues, is there a way to pre-check that a user has the bot blocked and thus not attempt to send the message? We are surprised to find that the bot framework doesn’t handle this more elegantly already by default, but cannot find any documentation or examples on how to potentially override the onTurnError
within index.ts
with the way we have our routes set up.
We have tried putting the calls in try/catch blocks, but the same default onTurnError
occurs, crashing the bot and sending the two messages in the installed channel.
Mia Matos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1