Closed
Conversation
- Add fetchSlackReactionMessageText helper to fetch original message text via conversations.history API for reaction_added/reaction_removed events - Handle reaction events separately with correct field extraction: - channel: extract from event.item.channel (not event.channel) - timestamp: use item.ts (message timestamp) not event_ts (reaction time) - reaction: extract emoji name from event.reaction - item_user: extract message author from event.item_user - event_ts: new field for when the reaction was added/removed - text: fetch via API if bot token has channels:history scope - Gracefully handle missing permissions (missing_scope error) - Update Slack trigger outputs to document new reaction fields - Add channels:history and reactions:read scopes to setup instructions Co-authored-by: Emir Karabeg <emir-karabeg@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the Slack webhook handler for
reaction_addedandreaction_removedevents, which previously failed to extract event-specific fields correctly.It introduces special handling for these reaction events to:
channelfromevent.item.channel.item.tsfor thetimestampfield, referencing the reacted message.reactionemoji name fromevent.reaction.item_user(the original message author) andevent_ts(when the reaction occurred).textusingconversations.historyAPI if the bot haschannels:historyscope, gracefully returning an empty string if permissions are insufficient.Additionally, the Slack webhook trigger output fields and setup instructions have been updated to reflect these changes, including the necessary
channels:historyandreactions:readscopes.Fixes #(issue) - Assuming there's an issue tracking this, otherwise remove.
Type of Change
Testing
Type checks and lint checks were run and passed on the modified files. The logic for fetching message text and handling permissions was verified.
Checklist
Screenshots/Videos
Slack Thread