Client library for the Discord API.
The Discord API can be divided into three main components: the RESTful API to which calls can be made to take actions, a websocket-based permanent connection over which state updates are received, and the voice calling system.
Log in to Discord with
from_bot_token as appropriate.
The resulting value can be used to make REST API calls to post messages and manipulate Discord
connect() will open a websocket connection, through which events can be
received. These two channels are enough to write a simple chatbot which can
read and respond to messages.
For more in-depth tracking of Discord state, a
State can be seeded with
ReadyEvent obtained when opening a
Connection and kept updated with
the events received over it.
To join voice servers, call
Connection::voice to get a
VoiceConnection and use
to join a channel, then
stop to control playback. Manipulating deaf/mute state
and receiving audio are also possible.
For examples, see the
examples directory in the source tree.
Builder types used for patches and other complex data structures.
Struct and enum definitions of values in the Discord model.
Voice communication module.
Websocket connection to the Discord servers.
Client for the Discord REST API.
Known state composed from received events.
A reference to a private or public channel.
Discord API error type.
Retrieves the active maintenances from the status page.
Retrieves the current unresolved incidents from the status page.
Retrieves the upcoming maintenances from the status page.
Read an image from a file into a string suitable for upload.