使用已卸载应用程序的 Teams 主动消息

Teams proactive messages with uninstalled app

我正在尝试构建一个必须定期发送主动消息的个人 Teams 机器人。我通过在用户安装应用程序时存储对话来实现它,就像 examples here 一样。现在它运行良好,但我意识到我一直在向已卸载我的应用程序的用户发送消息。我似乎找不到在用户卸载个人范围的机器人(应用程序)时触发的任何事件。

我试过 conversation events,但至少个人范围的机器人似乎没有被触发。

我正在使用 NodeJs botbuilder SDK。

欢迎任何建议,谢谢。

据我所知,不幸的是没有这样的事件。我认为您目前只会收到 403,但没有太多信息。这是由于变化引起的——事实上,微软昨天刚刚发布了这方面的公告。请参阅“post 个人范围内机器人卸载行为的更改”段落中的 https://developer.microsoft.com/en-us/office/blogs/best-practices-and-updates-for-bot-lifecycle-events-in-microsoft-teams/

Moving forward we’ll also align the post uninstall behavior for bots in the personal scope with the teams and groupChat scopes and you will not be able to send or receive messages after an app has been uninstalled. Your bot will receive a 403 response code to new messages posted by your bot. The 403 response code will have fields telling you the reason behind the it – which is either the app was uninstalled or the bot was blocked. We expect these changes to roll out in the coming few months.