Callbacks¶
Module containing registered callbacks for various events. These events are how various parts of discord.py can communicate with the frontend runner or a user’s custom runner setup. These callbacks should not be used to trigger backend changes, that is the responsibility of the library internals.
- async dispatch_event(event: str, *args: Any, **kwargs: Any) None ¶
Dispatch an event to a set handler, if one exists. Will ignore handler errors, just print a log
- Parameters:
event – Name of the event to dispatch
args – Arguments to the callback
kwargs – Keyword arguments to the callback
- set_callback(cb: Callable[[...], Coroutine[None, None, None]], event: str) None ¶
Set the callback to use for a specific event
- Parameters:
cb – Callback to use
event – Name of the event to register for