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.How It Works
A native platform event is normalised into a portablePlatformEvent, 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 samePlatformEvent 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.Best Practices
Enable only the classes you need
Enable only the classes you need
Every unlisted class stays unsubscribed.
members in particular pulls the privileged Discord members intent β request it only when you use it.Safe to combine with status reactions
Safe to combine with status reactions
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.Hook errors are non-fatal
Hook errors are non-fatal
A raised exception inside a hook is logged at debug and swallowed β it never breaks the adapterβs event loop.
Route by kind inside REACTION_RECEIVED
Route by kind inside REACTION_RECEIVED
Reaction add and remove both fire
REACTION_RECEIVED. Branch on evt.kind (reaction_added vs reaction_removed) to distinguish them.Remember new_text is truncated in to_dict()
Remember new_text is truncated in to_dict()
PlatformEventInput.to_dict() truncates new_text to 500 chars for observability. The in-memory evt.new_text attribute is not truncated.Related
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.

