-
Notifications
You must be signed in to change notification settings - Fork 594
/
Cargo.toml
149 lines (135 loc) · 6.01 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
[package]
authors = ["Alex M. M. <[email protected]>"]
description = "A Rust library for the Discord API."
documentation = "https://docs.rs/serenity"
homepage = "https://github.com/serenity-rs/serenity"
keywords = ["discord", "api"]
license = "ISC"
name = "serenity"
readme = "README.md"
repository = "https://github.com/serenity-rs/serenity.git"
version = "0.12.4"
edition = "2021"
rust-version = "1.74"
include = ["src/**/*", "LICENSE.md", "README.md", "CHANGELOG.md", "build.rs"]
[workspace]
members = ["examples/*"]
[dependencies]
# Required dependencies
bitflags = "2.4.2"
serde_json = "1.0.108"
async-trait = "0.1.74"
tracing = { version = "0.1.40", features = ["log"] }
serde = { version = "1.0.192", features = ["derive"] }
url = { version = "2.4.1", features = ["serde"] }
tokio = { version = "1.34.0", features = ["fs", "macros", "rt", "sync", "time", "io-util"] }
futures = { version = "0.3.29", default-features = false, features = ["std"] }
dep_time = { version = "0.3.36", package = "time", features = ["formatting", "parsing", "serde-well-known"] }
base64 = { version = "0.22.0" }
secrecy = { version = "0.8.0", features = ["serde"] }
arrayvec = { version = "0.7.4", features = ["serde"] }
serde_cow = { version = "0.1.0" }
# Optional dependencies
fxhash = { version = "0.2.1", optional = true }
simd-json = { version = "0.13.4", optional = true }
uwl = { version = "0.6.0", optional = true }
levenshtein = { version = "1.0.5", optional = true }
chrono = { version = "0.4.31", default-features = false, features = ["clock", "serde"], optional = true }
flate2 = { version = "1.0.28", optional = true }
reqwest = { version = "0.11.22", default-features = false, features = ["multipart", "stream"], optional = true }
static_assertions = { version = "1.1.0", optional = true }
tokio-tungstenite = { version = "0.21.0", optional = true }
typemap_rev = { version = "0.3.0", optional = true }
bytes = { version = "1.5.0", optional = true }
percent-encoding = { version = "2.3.0", optional = true }
mini-moka = { version = "0.10.2", optional = true }
mime_guess = { version = "2.0.4", optional = true }
dashmap = { version = "5.5.3", features = ["serde"], optional = true }
parking_lot = { version = "0.12.1", optional = true }
ed25519-dalek = { version = "2.0.0", optional = true }
typesize = { version = "0.1.2", optional = true, features = ["url", "time", "serde_json", "secrecy", "dashmap", "parking_lot", "details"] }
# serde feature only allows for serialisation,
# Serenity workspace crates
command_attr = { version = "0.5.3", path = "./command_attr", optional = true }
serenity-voice-model = { version = "0.2.0", path = "./voice-model", optional = true }
[dev-dependencies.http_crate]
version = "0.2.11"
package = "http"
[features]
# Defaults with different backends
default = ["default_no_backend", "rustls_backend"]
default_native_tls = ["default_no_backend", "native_tls_backend"]
# Serenity requires a backend, this picks all default features without a backend.
default_no_backend = [
"builder",
"cache",
"chrono",
"client",
"framework",
"gateway",
"model",
"http",
"standard_framework",
"utils",
]
# Enables builder structs to configure Discord HTTP requests. Without this feature, you have to
# construct JSON manually at some places.
builder = []
# 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.
cache = ["fxhash", "dashmap", "parking_lot"]
# Enables collectors, a utility feature that lets you await interaction events in code with
# zero setup, without needing to setup an InteractionCreate event listener.
collector = ["gateway", "model"]
# Wraps the gateway and http functionality into a single interface
# TODO: should this require "gateway"?
client = ["http", "typemap_rev"]
# Enables the Framework trait which is an abstraction for old-style text commands.
framework = ["client", "model", "utils"]
# Enables gateway support, which allows bots to listen for Discord events.
gateway = ["flate2"]
# Enables HTTP, which enables bots to execute actions on Discord.
http = ["mime_guess", "percent-encoding"]
# 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
model = ["builder", "http", "utils"]
voice_model = ["serenity-voice-model"]
standard_framework = ["framework", "uwl", "levenshtein", "command_attr", "static_assertions", "parking_lot"]
# 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.
unstable_discord_api = []
# Enables some utility functions that can be useful for bot creators.
utils = []
voice = ["client", "model"]
# Enables unstable tokio features to give explicit names to internally spawned tokio tasks
tokio_task_builder = ["tokio/tracing"]
interactions_endpoint = ["ed25519-dalek"]
# Uses chrono for Timestamp, instead of time
chrono = ["dep:chrono", "typesize?/chrono"]
# This enables all parts of the serenity codebase
# (Note: all feature-gated APIs to be documented should have their features listed here!)
full = ["default", "collector", "unstable_discord_api", "voice", "voice_model", "interactions_endpoint"]
# Enables simd accelerated parsing.
simd_json = ["simd-json", "typesize?/simd_json"]
# Enables temporary caching in functions that retrieve data via the HTTP API.
temp_cache = ["cache", "mini-moka", "typesize?/mini_moka"]
# Removed feature (https://github.com/serenity-rs/serenity/pull/2246)
absolute_ratelimits = []
# Backends to pick from:
# - Rustls Backends
rustls_backend = [
"reqwest/rustls-tls",
"tokio-tungstenite/rustls-tls-webpki-roots",
"bytes",
]
# - Native TLS Backends
native_tls_backend = [
"reqwest/native-tls",
"tokio-tungstenite/native-tls",
"bytes",
]
[package.metadata.docs.rs]
features = ["full"]
rustdoc-args = ["--cfg", "docsrs"]