Serenity is a Rust crate for Discord bots with optional caching, sharded gateway handling, HTTP wrappers, and feature-gated modules.
Overview
Serenity wraps Discord’s REST and gateway APIs for Rust programs. Applications typically build a Client with EventHandler implementations to react to messages and other events. The library is deprecated as of v0.12.1.
The library manages shard connections and can maintain a cache of guilds, channels, and users to cut redundant HTTP calls. HTTP helpers mirror Discord endpoints with optional parameters.
Cargo features toggle cache, framework integration, collectors, voice plugins, TLS backends, and unstable API flags. The poise framework builds higher-level slash and text commands on top of Serenity.
Songbird is the companion crate recommended for voice channel audio. Examples demonstrate basic bots such as ping-pong responders.
Key features
- Discord gateway client
- Optional in-memory cache
- Event handler traits
- Modular Cargo features
- HTTP API wrappers
- Shard management
Use cases
- Discord chat bots in Rust
- Slash command services
- Guild automation tools
- Cached Discord data access