You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My first use case involved the bot creating a private channel, inviting users, posting messages in that channel, and then receiving those keywords. Everything works great.
My next use case involves the bot positing to an existing public channel, and listening for those same keywords on the thread. The bot can post to the public channel, but does not receive the message notifications on the thread, or for any message in the public channel. I have confirmed that my bot is a "member" of the channel; it is listed in the integrations tab of the channel info popup, and has posted to the channel.
As an additional debugging step, I added a handler to log all messages:
This fires every time a user posts to a private channel created by my bot, or replies in a thread to a post in that channel, but it never fires when a user posts to the public channel where the bot is a member, or to the thread which the bot posted.
I've checked my subscribed event types; here's the relevant part of my manifest:
I believe I should need the message.channels event and the channels.history scope to get messages from a public group where my bot is a member, and I have both. I'm not sure what else to check.
Hi @jclark-dot-org 👋🏻 Thanks for the detailed issue report! 🙇🏻
I agree with you, the message.channels event and the channels.history scope should allow your bot to receive events in public channels that it's joined. Since you've confirmed that the bot is part of the public channel, I think a clue to the problem is that you're not receiving events for activity in the public channel.
Please excuse the obvious question, but it's good to confirm before we try to dig deeper. Have you re-installed your bot to the Slack Workspace after adding the latest scopes and events? Often, you need to re-install the bot for those changes to take effect and since you're not receiving log data, it makes me think that a re-install may help.
Obvious questions are good! I did indeed reinstall my app, but your question made me go try again. I'm installing from an "Add to Slack" button on my own site via https://slack.com/oauth/v2/authorize, which means I'm specifying all requested scopes in that URL. I double checked, and sure enough, channels:history was missing from my scopes param. I added it, reinstalled the app, and voila, I'm receiving the missing messages. Thanks for the help 🙏 !
If I can just append a related question... is there any way for my https://slack.com/oauth/v2/authorize/... install URL to specify that scopes should just be taken from my app manifest/config, instead of needing to duplicate the list of scopes in both places (install URL and manifest)? I reviewed the OAuth docs and didn't see such an option
My bot listens for and responds to certain keywords:
My first use case involved the bot creating a private channel, inviting users, posting messages in that channel, and then receiving those keywords. Everything works great.
My next use case involves the bot positing to an existing public channel, and listening for those same keywords on the thread. The bot can post to the public channel, but does not receive the message notifications on the thread, or for any message in the public channel. I have confirmed that my bot is a "member" of the channel; it is listed in the integrations tab of the channel info popup, and has posted to the channel.
As an additional debugging step, I added a handler to log all messages:
This fires every time a user posts to a private channel created by my bot, or replies in a thread to a post in that channel, but it never fires when a user posts to the public channel where the bot is a member, or to the thread which the bot posted.
I've checked my subscribed event types; here's the relevant part of my manifest:
And my scopes, also from the manifest:
I believe I should need the
message.channels
event and thechannels.history
scope to get messages from a public group where my bot is a member, and I have both. I'm not sure what else to check.@slack/bolt
version4.2.0
Your
App
and Receiver ConfigurationNode.js runtime version
v20.17.0
Steps to reproduce:
I cannot publish all of my code due to corporate IP, but as my description above outlines, the basic issue is:
app.message()
.Expected result:
Bot should see both user messages
Actual result:
Bot only sees message in private channel
The text was updated successfully, but these errors were encountered: