I have a bot with event scopes app_mention and messages.im. It also has OAuth scopes app_mentions.read, channels.history, chat.write, groups.history, and im.history.
If I @ mention my bot in a public channel, a thread off of a public channel, or directly message my bot I get an event. But if I'm in a private message with someone else and @ mention my bot, I don't get any events from the @mention.
What is the correct event scope to enable to get the event?
you can't unfortuantly. app_mention
only works in conversations the bot would have access to. You would need each user to directly give you access to im history and monitor every message event for a mention of the bot itself (probably either some regex or similar to look for the <@bot_name>
.
I know there was a link_names
part of the json object being sent for message events but you'd still need to check the message body to make sure its your bot being mentioned and not another user