Cargo Features

serenity = { version = "0.12.0", default-features = false, features = ["default_native_tls", "default_no_backend", "builder", "cache", "collector", "client", "framework", "gateway", "http", "model", "voice_model", "standard_framework", "unstable_discord_api", "utils", "voice", "tokio_task_builder", "interactions_endpoint", "chrono", "full", "simd_json", "temp_cache", "absolute_ratelimits", "rustls_backend", "native_tls_backend", "reqwest", "tokio-tungstenite"] }
default full? = default_no_backend, rustls_backend

Defaults with different backends

default_native_tls = default_no_backend, native_tls_backend
default_no_backend default default_native_tls? = builder, cache, chrono, client, framework, gateway, http, model, standard_framework, utils

Serenity requires a backend, this picks all default features without a backend.

builder default_no_backend model?

Enables builder structs to configure Discord HTTP requests. Without this feature, you have to construct JSON manually at some places.

Affects serenity::builder

cache default_no_backend temp_cache? = dashmap, fxhash, parking_lot

Enables the cache, which stores the data received from Discord gateway to provide access to complete guild data, channels, users and more without needing HTTP requests.

Affects context::Context.cache, client::Client.cache, help_commands::has_all_requirements, help_commands::searched_lowercase, help_commands::create_customised_help_data, shard_manager::ShardManagerOptions.cache, shard_queuer::ShardQueuer.cache, shard_runner::ShardRunner.cache, shard_runner::ShardRunnerOptions.cache, http::CacheHttp.cache, serenity::cache, help_commands::with_embeds, help_commands::plain

collector full? = gateway, model

Enables collectors, a utility feature that lets you await interaction events in code with zero setup, without needing to setup an InteractionCreate event listener.

Affects serenity::collector, quick_modal::QuickModalResponse, quick_modal::CreateQuickModal

client default_no_backend framework? voice? = http, typemap_rev

Wraps the gateway and http functionality into a single interface TODO: should this require "gateway"?

Affects serenity::client

framework default_no_backend standard_framework? = client, model, utils

Enables the Framework trait which is an abstraction for old-style text commands.

Affects shard_manager::ShardManagerOptions.framework, shard_queuer::ShardQueuer.framework, shard_runner::ShardRunnerOptions.framework, serenity::framework

gateway collector? default_no_backend = flate2

Enables gateway support, which allows bots to listen for Discord events.

Affects client::ClientBuilder, client::Client, serenity::gateway

http client? default_no_backend model? = mime_guess, percent-encoding

Enables HTTP, which enables bots to execute actions on Discord.

Affects builder::Builder, tokio::spawn_named, serenity::http, help_commands::with_embeds, help_commands::plain

model collector? default_no_backend framework? voice? = builder, http, utils

Enables wrapper methods around HTTP requests on model types.
Requires "builder" to configure the requests and "http" to execute them.
Note: the model type definitions themselves are always active, regardless of this feature.
TODO: remove dependeny on utils feature

Affects channel_id::MessagesIter, channel::AttachmentType, guild_id::MembersIter, mention::MentionParseError, misc::EmojiIdentifierParseError

voice_model full? = serenity-voice-model
standard_framework default_no_backend = command_attr, framework, levenshtein, parking_lot, static_assertions, uwl

Affects framework::standard

unstable_discord_api full?

Enables support for Discord API functionality that's not stable yet, as well as serenity APIs that are allowed to change even in semver non-breaking updates.

Affects gateway::Activity.sync_id, gateway::Activity.session_id

utils default_no_backend framework? model?

Enables some utility functions that can be useful for bot creators.

Affects serenity::utils, mention::MentionParseError, misc::EmojiIdentifierParseError

voice full? = client, model

Affects client::Client.voice_manager, shard_manager::ShardManagerOptions.voice_manager, shard_queuer::ShardQueuer.voice_manager, shard_runner::ShardRunnerOptions.voice_manager


Enables unstable tokio features to give explicit names to internally spawned tokio tasks

Enables tracing of tokio

interactions_endpoint full? = ed25519-dalek

Affects serenity::interactions_endpoint

chrono default_no_backend

Uses chrono for Timestamp, instead of time

Enables chrono, chrono of optional typesize

full = collector, default, interactions_endpoint, unstable_discord_api, voice, voice_model

This enables all parts of the serenity codebase
(Note: all feature-gated APIs to be documented should have their features listed here!)

simd_json = simd-json

Enables simd accelerated parsing.

Enables simd_json of optional typesize

temp_cache = cache, mini-moka

Enables temporary caching in functions that retrieve data via the HTTP API.

Enables mini_moka of optional typesize


Removed feature (

rustls_backend default = bytes

Backends to pick from:
- Rustls Backends

Enables rustls-tls of reqwest, rustls-tls-webpki-roots of tokio-tungstenite

native_tls_backend default_native_tls? = bytes

- Native TLS Backends

Enables native-tls of reqwest and tokio-tungstenite

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

fxhash cache?

simd-json simd_json?

With default features

uwl standard_framework?
levenshtein standard_framework?
flate2 gateway?

With default (rust_backend)

reqwest implicit feature

With multipart and stream

static_assertions standard_framework?
tokio-tungstenite implicit feature

With default features

typemap_rev client?
bytes native_tls_backend? rustls_backend

With default (std)

percent-encoding http?

With default (std)

mini-moka temp_cache?

With default (sync)

mime_guess http?

With default (rev-mappings)

dashmap cache?

With serde

parking_lot cache? standard_framework?
ed25519-dalek interactions_endpoint?

With default features

command_attr standard_framework?

serenity-voice-model voice_model?