How to filter bot users belong to my app when I listen to member_joined_channel event

拜拜、爱过 提交于 2019-12-11 15:54:49

问题


I want to know when bot user (belongs to my app) is added to private channel , I know member_joined_channel event will fired for all invites in the private channel but I am interested in the event only when my bot user is added to private channel and ignore other invites. Is there any way I can filter?

My app is installed in different workspaces . Bot user id of same app is different for different workspace so I cannot filter by bot user id.


回答1:


Every time your app is installed into a new workspace it will receive the new tokens along with the new bot user ID for that workspace. If you store that bot user ID you can later filter events for your bot.

Since you also get the team ID with each event you just need to match against the respective bot user ID for that team.



来源:https://stackoverflow.com/questions/57578404/how-to-filter-bot-users-belong-to-my-app-when-i-listen-to-member-joined-channel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!