Repository navigation
Catching Direct Messages #199
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Milestone
Description
Activity
- addedquestionFurther information is requestedFurther information is requested
on Jan 11, 2021 @cgamio Hello, thanks for asking the question. I do understand this is a bit confusing but the event type to catch this pattern is not
message.imbutmessage(message.imis{event.type}.{event.channel_type}).https://api.slack.com/events/message.im
{ "token": "one-long-verification-token", "team_id": "T061EG9R6", "api_app_id": "A0PNCHHK2", "event": { "type": "message", "channel": "D024BE91L", "user": "U2147483697", "text": "Hello hello can you hear me?", "ts": "1355517523.000005", "event_ts": "1355517523.000005", "channel_type": "im" }, "type": "event_callback", "authed_teams": [ "T061EG9R6" ], "event_id": "Ev0PV52K21", "event_time": 1355517523 }Thus, updating your code as below should help.
@app.event("message")I will improve this framework to raise an exception that tells what's wrong with the "message.*".
Thanks for the heads up! So I'll expand that listener to include all of
messageand then create a middleware or otherwise filter by messages that have the channel_type set toim@cgamio Yes, you're on the right track 👍 Let me close this issue now.
- added a commit that references this issue
on Jan 19, 2021 - added a commit that references this issue
on Jan 20, 2021
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
I'm trying to catch DM's and treat them differently from other messages. I've tried leveraging the
message.imevent type as described here, but that doesn't seem to be caught by using the event listener decoratorReproducible in:
Steps to reproduce:
message.imtypeExpected result:
The function should execute
Actual result:
The function is passed over, presumably because the event type doesn't fit.
and then nothing happens