Skip to content

Slack reaction webhook fields#3275

Closed
emir-karabeg wants to merge 1 commit intostagingfrom
cursor/slack-reaction-webhook-fields-8b3a
Closed

Slack reaction webhook fields#3275
emir-karabeg wants to merge 1 commit intostagingfrom
cursor/slack-reaction-webhook-fields-8b3a

Conversation

@emir-karabeg
Copy link
Collaborator

Summary

This PR fixes the Slack webhook handler for reaction_added and reaction_removed events, which previously failed to extract event-specific fields correctly.

It introduces special handling for these reaction events to:

  • Correctly extract channel from event.item.channel.
  • Use item.ts for the timestamp field, referencing the reacted message.
  • Extract the reaction emoji name from event.reaction.
  • Add item_user (the original message author) and event_ts (when the reaction occurred).
  • Fetch the original message text using conversations.history API if the bot has channels:history scope, 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:history and reactions:read scopes.

Fixes #(issue) - Assuming there's an issue tracking this, otherwise remove.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

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

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos


Slack Thread

Open in Web Open in Cursor 

- 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
Copy link

cursor bot commented Feb 20, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Feb 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Feb 20, 2026 10:22pm

Request Review

@waleedlatif1 waleedlatif1 deleted the cursor/slack-reaction-webhook-fields-8b3a branch February 21, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants