Expand description
A module for Client and supporting types.
The Client contains information about a single bot’s token, as well as event handlers.
Dispatching events to configured handlers and starting the shards’ connections are handled
directly via the client. In addition, the http module and Cache are also automatically
handled by the Client module for you.
A Context is provided for every handler.
The http module is the lower-level method of interacting with the Discord REST API.
Realistically, there should be little reason to use this yourself, as the Context will do this
for you. A possible use case of using the http module is if you do not have a Cache, for
purposes such as low memory requirements.
Click here for an example on how to use a Client.
Re-exports§
pub use crate::cache::Cache;
Structs§
- Client
- A wrapper for HTTP and gateway connections.
- Client
Builder - A builder implementing
IntoFuturebuilding aClientto interact with Discord. - Context
- The context is a general utility struct provided on event dispatches.
Enums§
- Client
Error - An error returned from the
Client. - Full
Event - This enum stores every possible event that an
EventHandlercan receive.
Traits§
- Event
Handler - The core trait for handling events by serenity.
- RawEvent
Handler - This core trait for handling raw events