Skip to main content
Inbound platform events let your agent hear more than text β€” reactions, edits, deletions, member changes, and thread creations from Discord, Telegram, Slack, and other supported platforms.

Quick Start

Register a hook on the agent, then opt the channel in from the gateway config.
Nothing new fires unless a channel opts in via events:. Omit the key and behaviour is unchanged β€” the surface is purely additive and capability-gated.

Opt-In Classes

1

reactions

Hear when a user adds or removes a reaction. Branch on evt.kind to tell add from remove.
2

edits

Hear message edits and deletions.
3

members

Hear when a user joins or leaves. Requires the privileged members gateway intent, which the adapter enables only when you request this class.
4

threads

Hear when a new thread is created. thread_id and the parent chat_id are populated.
Combine classes in one list: events: [reactions, edits, members, threads].

How It Works

A native platform event is normalised into a portable PlatformEvent, which fires the matching HookEvent. Every adapter emits through one DRY seam, fire_platform_event, which maps PlatformEvent.kind onto the matching HookEvent. Reaction add and remove both fire REACTION_RECEIVED β€” the kind field disambiguates.

Which Event Fires When?

Pick the class that matches what you want to hear.

Configuration Options

Each class token subscribes the adapter to a set of native handlers.

Hook Payload (PlatformEventInput)

Every inbound event carries a PlatformEventInput. Import it directly when you need the type:

Platform Coverage

Only Discord is wired today. Other adapters translate their native events into the same PlatformEvent in follow-up releases.
Platforms that cannot deliver a given event simply never emit β€” nothing raises, hooks that never fire cost nothing. Enabling events: on a platform that hasn’t wired it yet is safe and forward-compatible.

Common Patterns

Reaction-as-approval β€” react βœ… to approve, no typing required.
Undo-on-delete β€” retract a stored plan when the source message disappears.
Welcome-on-join β€” greet new members.
Thread-scoped session β€” open a new agent session tied to a thread.

Best Practices

Every unlisted class stays unsubscribed. members in particular pulls the privileged Discord members intent β€” request it only when you use it.
The bot’s own reactions and edits are filtered out automatically, so internal ack/done housekeeping is never mistaken for a user reaction. You can enable reactions alongside status reactions without loops.
A raised exception inside a hook is logged at debug and swallowed β€” it never breaks the adapter’s event loop.
Reaction add and remove both fire REACTION_RECEIVED. Branch on evt.kind (reaction_added vs reaction_removed) to distinguish them.
PlatformEventInput.to_dict() truncates new_text to 500 chars for observability. The in-memory evt.new_text attribute is not truncated.

Hook Events

Full reference for every HookEvent member.

Bot Status Reactions

The outbound counterpart β€” the bot adds emoji to show run state.

Interactive Bot Actions

Button and select-menu clicks β€” another interactive surface.

Messaging Bots

Where the gateway config lives.