A Slack event, normalised into one shape regardless of transport.
Socket Mode wraps events in an envelope (events_api, slash_commands,
interactive) and expects an ACK; the Events API delivers the same inner
payload over HTTP. Both are reduced here to the same struct so your
Slink.handle_event/2 never has to care which transport delivered it.
Fields
:type— the routable type. For event callbacks this is the inner Slack event type (e.g."app_mention","message"); otherwise the envelope kind ("slash_commands","interactive","url_verification", ...).:subtype— the event subtype, when present (e.g."bot_message").:payload— the inner event/command/interaction map you'll usually read.:raw— the full original map, if you need something not surfaced above.:transport—:socket_modeor:http.:kind—:event_callback,:slash_commands,:interactive, or:other.:envelope_id— Socket Mode ACK id (nil over HTTP).
Summary
Functions
The channel the event happened in, or nil.
The text addressed to the bot: the event's text with a leading <@…> mention
stripped and trimmed.
Whether this event was produced by a bot (including this app itself).
Normalise a decoded Events API HTTP body.
Normalise a decoded Socket Mode envelope.
Whether this event happened inside a thread.
Whether the app itself was mentioned — i.e. an app_mention event.
User IDs mentioned in the event's text, in order (e.g. ["U0123", "U0456"]).
Whether user_id is mentioned in the event's text.
The atom for a known Slack type string, or the string itself if unknown.
The thread_ts to reply into so a reply lands in this event's thread.
The event's text, or an empty string.
The thread this event belongs to, or nil if it's not in a thread.
The event's own message timestamp (ts), or nil.
The user who produced the event (author of the message), or nil.
Types
Functions
The channel the event happened in, or nil.
The text addressed to the bot: the event's text with a leading <@…> mention
stripped and trimmed.
For app_mention events the text starts with the bot mention, so this returns
just the instruction ("@bot deploy now" → "deploy now").
Whether this event was produced by a bot (including this app itself).
Slack tags bot-authored messages with a bot_id. Handlers use this to skip
the bot's own posts so an auto-reply never triggers itself in a loop.
Normalise a decoded Events API HTTP body.
Normalise a decoded Socket Mode envelope.
Whether this event happened inside a thread.
Whether the app itself was mentioned — i.e. an app_mention event.
This is the "someone @-mentioned the bot" signal. To see who else is
mentioned in the text, use mentions/1.
User IDs mentioned in the event's text, in order (e.g. ["U0123", "U0456"]).
Empty when nobody is mentioned.
Whether user_id is mentioned in the event's text.
The atom for a known Slack type string, or the string itself if unknown.
The thread_ts to reply into so a reply lands in this event's thread.
If the event is already in a thread, that thread; otherwise the event's own
ts, so replying starts a thread on it. nil if there's no timestamp.
The event's text, or an empty string.
The thread this event belongs to, or nil if it's not in a thread.
This is Slack's thread_ts — the ts of the thread's root message.
The event's own message timestamp (ts), or nil.
The user who produced the event (author of the message), or nil.