Module client

Source
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.
ClientBuilder
A builder implementing IntoFuture building a Client to interact with Discord.
Context
The context is a general utility struct provided on event dispatches.

Enums§

ClientError
An error returned from the Client.
FullEvent
This enum stores every possible event that an EventHandler can receive.

Traits§

EventHandler
The core trait for handling events by serenity.
RawEventHandler
This core trait for handling raw events