Event handlers
You subscribe withclient.on(...) and receive typed event payloads:
Middleware
client.use(...) lets you intercept events before downstream handlers:
Why this matters
Middleware is a good fit for:- dropping bot messages
- guild allowlists
- rate limiting or coarse feature gates
- logging and metrics
Event typing
The event system is one of Chameleon’s best DX wins:- the event name narrows the payload shape
event.typesupports further narrowing in shared flows- you avoid a lot of nullable probing that is common in untyped gateway payload handling