help with event listeners (channels and direct message to app or bot)
See original GitHub issueDescription
Hello, I am having trouble with my slack app listening to events. I have this snippet of code:
// Does not work
this.app.event('message.channels', async ({ event, context }) => {
console.log('message channels');
});
// This works (simple use case to validate I can listen to messages from channels.)
this.app.message(RegExp('(.*?)'), async ({ message, say, event, payload }) => {
console.log('message event');
});
I double checked and I am subscribed to bot events for message.channels
.
I would also like to know how I can subscribe to message.app_home
. I am no longer seeing that event as an option inside of the events subscription.
Thanks and sorry if I missed something from the docs.
What type of issue is this? (place an x
in one of the [ ]
)
- bug
- enhancement (feature request)
- [ x ] question
- documentation related
- testing related
- discussion
Requirements (place an x
in each of the [ ]
)
- I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
- I’ve read and agree to the Code of Conduct.
- I’ve searched for any related issues and avoided creating a duplicate issue.
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version:
node version:
OS version(s):
Steps to reproduce:
Expected result:
What you expected to happen
Actual result:
What actually happened
Attachments:
Logs, screenshots, screencast, sample project, funny gif, etc.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
message event - Slack API
A message is delivered from several sources: ... The channel property is the ID of the channel, private group or DM channel this...
Read more >Bolt for JavaScript - Slack Platform Developer Tools
To listen to messages that your app has access to receive, you can use the message() method which filters out events that aren't...
Read more >Java Discord Bot - Event Listeners - YouTube
https://discord.gg/cortexdev Want to Support the Channel ? ... Getting the channel the message was sent in 8:20 Testing the message listener ...
Read more >Conversation events in your Teams bot - Microsoft Learn
Work with conversation events from your Microsoft Teams bot, channel event updates, team member events, and message reaction events with ...
Read more >Slack Event Handler - Mango OS Support
This tutorial will cover how to create a slack app, a bot user and install it to your workspace. Mango will utilies the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Gotcha! Thanks for answering my questions!
@roger-king Hi, I do understand this is a bit confusing but the event type in listener registration, it requires
event.type
in a payload, not the name in the documentation page. 🙇As an example payload in https://api.slack.com/events/message.channels describes, the
event.type
for the subscription is"message"
. Subscribingmessage.channels
in Slack app configuration page and havingthis.app.event('message', async ({ event, context }) => {
in your Bolt app should work for you.