Expand description
A set of exports which can be helpful to use.
Note that the SerenityError
re-export is equivalent to serenity::Error
, although is
re-exported as a separate name to remove likely ambiguity with other crate error enums.
§Examples
Import all of the exports:
use serenity::prelude::*;
Structs§
- Client
- A wrapper for HTTP and gateway connections.
- Context
- The context is a general utility struct provided on event dispatches.
- Gateway
Intents - Gateway Intents will limit the events your bot will receive via the gateway. By default, all intents except Privileged Intents are selected.
- Mutex
- An asynchronous
Mutex
-like type. - RwLock
- An asynchronous reader-writer lock.
- TypeMap
- TypeMap is a simple abstraction around the standard library’s
HashMap
type, where types are its keys. This allows for statically-checked value retrieval.
Enums§
- Client
Error - An error returned from the
Client
. - Gateway
Error - An error that occurred while attempting to deal with the gateway.
- Http
Error - Model
Error - An error returned from the
model
module. - Serenity
Error - A common error enum returned by most of the library’s functionality within a custom
Result
.
Traits§
- Cache
Http - This trait will be required by functions that need
Http
and can optionally use aCache
to potentially avoid REST-requests. - Event
Handler - The core trait for handling events by serenity.
- Mentionable
- Allows something - such as a channel or role - to be mentioned in a message.
- RawEvent
Handler - This core trait for handling raw events
- Type
MapKey - TypeMapKey is used to declare key types that are eligible for use
with
TypeMap
.