Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kind to all interaction enum variants to fix interaction serde #3096

Open
wants to merge 174 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
89bbb1d
Remove temporary `Vec` usage in the `http` module (#2624, #2646)
GnomedDev Dec 3, 2023
f7fe0ca
Remove deprecated items (#2645)
GnomedDev Dec 3, 2023
044b6e4
Remove more deprecated items (#2651)
GnomedDev Dec 8, 2023
c651467
Remove `*_arc` methods (#2654)
GnomedDev Dec 8, 2023
4c17fc2
Clean up `ShardManager`/`ShardQueuer`/`ShardRunner` (#2653)
GnomedDev Dec 9, 2023
981a4db
Put `Message::thread` behind a `Box` (#2658)
GnomedDev Dec 9, 2023
659c081
Replace `Vec` and `String` with `FixedArray` and `FixedString` for al…
GnomedDev Dec 10, 2023
47d72e9
Fix truncation when using `FixedString<u8>` where multibyte character…
GnomedDev Dec 14, 2023
179b678
Encode timestamps in RFC3339 (#2665)
Kerollmops Dec 22, 2023
9c6d6f5
Switch to `i64` in methods associated with `CreateCommandOption` (#2668)
ARandomDev99 Dec 22, 2023
cd65f37
Get rid of the duplicate users cache (#2662)
GnomedDev Dec 28, 2023
8affe80
Change `Embed::fields` to use `FixedArray` (#2674)
GnomedDev Dec 28, 2023
42caf58
Use `FixedArray` and `FixedString` in model enums (#2675)
GnomedDev Dec 28, 2023
b37f291
Bitpack boolean fields using fancy proc macro (#2673)
GnomedDev Dec 31, 2023
3fba8d6
Use `nonmax::NonMax*` types in `Option`s wherever possible (#2681)
GnomedDev Jan 2, 2024
09bb92e
Remove unused warning `#[allow(...)]`s (#2682)
GnomedDev Jan 2, 2024
39707c5
Get rid of `unsafe` (#2686)
GnomedDev Jan 3, 2024
882a13b
Swap Git dependencies for crates.io published versions (#2685)
GnomedDev Jan 3, 2024
c85c311
Swap Id from `NonZero` to `NonMax` (#2689)
GnomedDev Jan 5, 2024
270becf
Rewrite builders to take `Cow`s (#2688)
GnomedDev Jan 6, 2024
b8d8d5c
Store `Request::params` as a slice instead of owning `ArrayVec` (#2694)
GnomedDev Jan 7, 2024
2cd52a2
Revert `Request::params` back to `Option` (#2695)
mkrasnitski Jan 7, 2024
6df7088
Remove unnecessary `Vec` in `WsClient` (#2705)
GnomedDev Jan 10, 2024
5c23447
Feature gate `#[instrument]` macros (#2707)
GnomedDev Jan 10, 2024
9d2b3e4
Remove `impl Into<Option>` (#2701)
GnomedDev Jan 10, 2024
ab0b40a
Get rid of `IntoIterator` generics wherever they are inefficent (#2698)
GnomedDev Jan 10, 2024
a14ecde
Clean up `Ratelimiter` (#2687)
GnomedDev Jan 10, 2024
ce85fd6
Handle overflow checks in central locations (#2697)
GnomedDev Jan 10, 2024
275a1d8
Shrink size and clean up `Error` (#2700)
GnomedDev Jan 10, 2024
dacfbf8
Remove manual `#[inline]` attributes (#2702)
GnomedDev Jan 10, 2024
145331c
Remove `Into<*Id>` and `AsRef<str>` (#2704)
GnomedDev Jan 11, 2024
01da5b9
Remove `Event::Unknown` variant (#2708)
mkrasnitski Jan 12, 2024
12ed84d
Use `NonMax` to signal builder range constraints (#2703)
GnomedDev Jan 14, 2024
a223c39
Stop using `Value` in error parsing (#2710)
GnomedDev Jan 14, 2024
a6ee617
Fix new clippy lints (#2713)
GnomedDev Jan 14, 2024
5becda3
Update to `small-fixed-array` v0.2 (#2711)
GnomedDev Jan 14, 2024
c914b67
Fix `@everyone` role deserialisation (#2716)
GnomedDev Jan 16, 2024
3137bd1
Fix `GuildChannel` deserialisation with `user_limit` (#2715)
GnomedDev Jan 16, 2024
b4bbfb1
Fix maximum description length to the correct size (#2718)
Milo123459 Jan 16, 2024
152a2c8
Remove dashboard example (#2714)
GnomedDev Jan 16, 2024
e216dd6
Fix compilation from rebase
arqunis Jan 16, 2024
f41bb43
Remove deprecated `absolute_ratelimits` feature (#2719)
GnomedDev Jan 16, 2024
fd4b422
Implement `max_concurrency` support when starting shards (#2661)
mkrasnitski Jan 16, 2024
b87ddb2
Remove typemap without making everything generic (#2720)
GnomedDev Jan 16, 2024
58d0cb2
Provide `Arc<Data>` instead of `&Data` (#2722)
GnomedDev Jan 17, 2024
956e104
Add `Client::try_data` to fallibly fetch the data type (#2723)
GnomedDev Jan 18, 2024
1e94d0b
Fix voice manager initialisation (#2727)
GnomedDev Jan 21, 2024
ca7059d
Remove some pedantic lints from the whitelist (#2728)
mkrasnitski Jan 21, 2024
14b9b27
Reduce unknown events to debug level, again (#2730)
GnomedDev Jan 21, 2024
49fa608
Fix compilation from rebase
arqunis Jan 22, 2024
add8493
Fix testing example
mkrasnitski Jan 22, 2024
de99a6e
Remove `PartialEq` implementations from all builders (#2734)
mkrasnitski Jan 22, 2024
8baf3a2
Remove various instances of `impl AsRef<T>` (#2736)
GnomedDev Jan 24, 2024
2359406
Remove `simd-json` support (#2735)
GnomedDev Jan 24, 2024
9c24f8b
Fix massive code size of `client::dispatch` (#2739)
GnomedDev Jan 25, 2024
ca0b106
Fix RoleTags deserialisation after removal of simd-json (#2742)
GnomedDev Jan 26, 2024
fb5e5a4
Avoid cloning FullEvent in dispatch code (#2740)
GnomedDev Jan 27, 2024
fbcf4d9
Remove the builder trait and only take required arguments (#2741)
GnomedDev Jan 27, 2024
1f59c15
Use Serializer::collect_seq in serialize impls (#2744)
GnomedDev Jan 28, 2024
d4a3c5b
Convert enum number into wrapper struct to save type sizes (#2746)
GnomedDev Jan 29, 2024
0151fe7
Use Arc<str> to store the token (#2745)
GnomedDev Jan 29, 2024
9a45c77
Remove standard framework (#2731)
GnomedDev Jan 29, 2024
fe1b2fe
Re-add Secret to bot token (#2748)
GnomedDev Jan 29, 2024
b643124
Take Arc<Http> in ClientBuilder::new_with_http (#2749)
GnomedDev Feb 3, 2024
e23ba02
Remove duplicate content_safe implementation (#2759)
GnomedDev Feb 9, 2024
3b654c0
Simplify the message cache (#2757)
GnomedDev Feb 9, 2024
6dcce5d
Upgrade to small-fixed-array 0.4 (#2755)
GnomedDev Feb 9, 2024
05687d7
Avoid HashMap in ShardQueue (#2750)
GnomedDev Feb 11, 2024
ec5f423
Switch to a generic type argument for `ClientBuilder::data` (#2765)
vicky5124 Feb 11, 2024
73a1a5e
Fix `VoiceServerUpdate::guild_id` being wrapped in `Option` (#2766)
GnomedDev Feb 13, 2024
9b9d479
Improve MessageBuilder to fit with other builders (#2767)
GnomedDev Feb 15, 2024
bfc5a0b
Fill message cache with ChannelId::messages and ChannelId::pins (#2768)
GnomedDev Feb 15, 2024
7a689ee
Defer deserialisation of Dispatch to handle errors (#2764)
GnomedDev Feb 16, 2024
e886b47
Remove `CreateAttachment::id` field (#2771)
mkrasnitski Feb 17, 2024
b780cce
Fix compilation from rebase
arqunis Mar 1, 2024
85bb5a4
Fix remaining clippy warnings
GnomedDev Mar 1, 2024
684e775
Format unformatted code from rebase
arqunis Mar 1, 2024
30420eb
Remove rebase artifacts in README
arqunis Mar 1, 2024
ea5a5f1
Synchronise README example from the `current` branch
arqunis Mar 1, 2024
1cb2cae
Minor adjustments
mkrasnitski Mar 1, 2024
c6ca561
Apply Strum derives for FullEvent and Event (#2788)
cheesycod Mar 10, 2024
a52c000
Remove `Channel::name` (#2787)
GnomedDev Mar 10, 2024
2255376
Use join_to_string throughout serenity (#2785)
GnomedDev Mar 10, 2024
95c20ab
Use ToArrayString for int -> str (#2786)
GnomedDev Mar 10, 2024
48441e1
Rename `unstable_discord_api` to `unstable` and disable it by default…
cheesycod Mar 10, 2024
159936e
Remove deprecated Channel::is_nsfw methods (#2792)
GnomedDev Mar 11, 2024
4941e08
Replace manual Hash/Eq implementation on User/Role (#2793)
GnomedDev Mar 12, 2024
96a30fc
Remove useless method wrappers (#2795)
GnomedDev Mar 13, 2024
5e17b60
Fix unused variable warning from rebase
GnomedDev Mar 13, 2024
ad208b5
Remove deprecated mapped refs and Cache::channels (#2796)
GnomedDev Mar 13, 2024
cd84fb5
Use ExtractMap instead of HashMap when possible (#2797)
GnomedDev Mar 17, 2024
543dcad
Remove examples and inaccurate docs from HTTP (#2805)
GnomedDev Mar 17, 2024
1bb922e
Use NonMax in HTTP function signatures (#2803)
GnomedDev Mar 17, 2024
0f29374
Fix infinite loop in event deserialisation
arqunis Mar 19, 2024
743d44e
Make Guild::shard_id follow additive features (#2813)
GnomedDev Mar 21, 2024
098157f
Remove deprecated `Member` and `Guild` methods (#2817)
GnomedDev Mar 26, 2024
00b6358
Replace `CacheHttp` with `&Http` in more methods (#2818)
GnomedDev Mar 28, 2024
67aa884
Remove `serde_json::Value` from `Http` (#2806)
GnomedDev Mar 28, 2024
8263207
Add audit log reasons to remaining model methods (#2821)
GnomedDev Mar 29, 2024
f821bc6
Remove even more impl CacheHttp (#2822)
GnomedDev Mar 29, 2024
a9f2057
Remove `fs` feature for `tokio` by default (#2824)
UserIsntAvailable Mar 30, 2024
bd32132
Update `reqwest` to v0.12 (#2826)
GnomedDev Apr 1, 2024
e1fe002
Only include `cache::Settings::time_to_live` if temp cache is enabled…
GnomedDev Apr 3, 2024
4867284
Add resume_gateway_url support (#2832)
GnomedDev Apr 6, 2024
866c6f0
Correct documentation for `UserId::to_user` (#2809)
jamesbt365 Apr 9, 2024
74e52ed
Use CreateAttachment for EditGuild::banner (#2844)
NotNorom Apr 20, 2024
b78c564
Fix AuditLogEntry::user_id (#2846)
GnomedDev Apr 20, 2024
d75a77e
Restore match arm for `Error::Gateway` variant (#2847)
mkrasnitski Apr 22, 2024
208d2f0
Remove multiple event handler support (#2849)
GnomedDev Apr 24, 2024
23529ee
Use RwLock for active collectors collection (#2851)
TheCataliasTNT2k Apr 26, 2024
1bd7b2b
Provide old presence data from the cache on presence update (#2852)
jamesbt365 Apr 28, 2024
fa8fd64
Allow filtering events before they are dispatched (#2853)
TheCataliasTNT2k Apr 28, 2024
226f1b6
Remove permission checks (#2855)
jamesbt365 May 1, 2024
b6c24aa
Implement ToArrayString for Mention (#2857)
GnomedDev May 7, 2024
4bbb0ec
Add PartialGuild::greater_member_hierarchy + member_highest_role (#2856)
cheesycod May 8, 2024
ea35878
Remove recently deprecated items
GnomedDev May 23, 2024
b8b6f5e
Update bool_to_bitflags to fix compilation without unstable
GnomedDev May 14, 2024
dd107c3
Remove RUSTFLAGS from .cargo/config.toml (#2875)
jamesbt365 May 23, 2024
224f6a1
Remove deprecated link_ensured method (#2898)
GnomedDev Jun 10, 2024
b9dbfb4
Add GuildId param to ChannelId::to_channel (#2895)
GnomedDev Jun 16, 2024
671749e
Clean up `Message::reply` (#2897)
GnomedDev Jun 16, 2024
4776a03
Use `ArrayString` in more places via `aformat!` (#2902)
GnomedDev Jun 22, 2024
7f7df5f
Bump MSRV to Rust 1.79 (#2916)
mkrasnitski Jul 11, 2024
4bbb032
Remove deprecated `CreateInteractionResponse::PremiumRequired` varian…
mkrasnitski Aug 5, 2024
f6976e4
Add `OAuth2Token`, `OAuth2TokenRevocation`, and `OAuth2AuthorizationC…
valentinegb Aug 8, 2024
e3ae972
Allow setting both normal and raw event handlers (#2933)
tazz4843 Aug 16, 2024
ff36f7b
Merge `client` feature/module into `gateway` (#2947)
mkrasnitski Aug 22, 2024
d800798
Remove methods on `ClientBulder` that don't serve a purpose (#2953)
mkrasnitski Aug 23, 2024
1b0272e
Fix and make `edit_role_position` plural (#2954)
mkrasnitski Aug 23, 2024
e3ab55b
Fix model functions using `SerializeIter` (#2955)
GnomedDev Aug 26, 2024
31d8125
Remove `InternalEventHandler` (#2952)
mkrasnitski Aug 26, 2024
8c5fa77
Truncate cache if `max_messages` is set to a lower value at runtime (…
ivinjabraham Aug 30, 2024
cb903c8
Add enum for JSON error codes in `DiscordJsonError` (#2964)
ivinjabraham Sep 1, 2024
52ab4c5
Update to DashMap 6 (#2961)
GnomedDev Sep 9, 2024
6bb9457
Fix unused warnings when compiling without certain features (#2970)
mkrasnitski Sep 13, 2024
c3d6f67
Fix public doctests that are marked `ignore` (#2976)
mkrasnitski Sep 20, 2024
9abe45e
Allow embeds to be optional in followup messages (#2968)
TapGhoul Oct 7, 2024
7682724
Swap `Vec<T>` for `Cow<[T]>` in `CreateActionRow::Buttons` (#2985)
GnomedDev Oct 7, 2024
09731ab
Remove more `json!` usage (#2986)
GnomedDev Oct 7, 2024
fae6b9b
Replace outdated secrecy library with own impl (#2997)
GnomedDev Oct 21, 2024
169e48a
Check for lints which change public API (#2999)
GnomedDev Oct 21, 2024
68f87dd
Stop using serde_json::Value in AutocompleteChoice::value (#3000)
GnomedDev Oct 21, 2024
f4e02d9
feat: Make FullEvent serializable (#3010)
cheesycod Oct 31, 2024
6316570
Add `Context::data_ref` (#3017)
GnomedDev Nov 6, 2024
a2485cb
Delete passthrough methods (#3023)
GnomedDev Nov 11, 2024
89aee0d
Swap CreateAttachment::data to Bytes (#3016)
GnomedDev Nov 11, 2024
d575045
Add `EditCommand` builder (#3028)
mkrasnitski Nov 12, 2024
5c411de
Remove deprecated GuildChannel::permissions_for_user (#3033)
GnomedDev Nov 13, 2024
ec7c778
Improve some docs (#3027)
mkrasnitski Nov 13, 2024
a17ecb7
Add config for the shard start wait time (#3031)
cheesycod Nov 13, 2024
4f3e638
Remove Option around Interaction::app_permissions (#3034)
GnomedDev Nov 13, 2024
0ea730e
Remove deprecated permissions methods (#3042)
GnomedDev Nov 16, 2024
d82435a
Update `tokio-tungstenite` dependency to 0.24 (#3048)
DPlayer234 Nov 18, 2024
0778190
Perform some misc TODO cleanups (#3050)
GnomedDev Nov 18, 2024
dff8dee
Transport compression support (#3036)
fgardt Nov 18, 2024
67f5b6a
Get rid of redundant status argument in Http::wind (#3049)
GnomedDev Nov 18, 2024
9a030ab
Perform some minor cleanups (#3051)
mkrasnitski Nov 19, 2024
d1d8687
Improve token semantics and clean up gateway feature gates (#3052)
mkrasnitski Nov 22, 2024
d36ff49
Add Token to serenity::all (#3054)
GnomedDev Nov 22, 2024
c80cd65
Use correct token prefix after parsing
arqunis Nov 23, 2024
00650cd
Add guild_id to ReactionRemoveAll (#3058)
jamesbt365 Nov 25, 2024
c89fa8d
Bump the discriminant of audit_log::Action to u16 (#3062)
GnomedDev Nov 25, 2024
55c388c
Fix transport compression feature & add CI tests (#3067)
fgardt Nov 26, 2024
f9db63b
Factor out collector methods on models into traits (#3055)
mkrasnitski Nov 27, 2024
7619136
Remove unused `json.rs` file (#3071)
mkrasnitski Dec 2, 2024
d8d1817
Fix clippy warning on next (#3078)
mkrasnitski Dec 8, 2024
8555e29
Add a function for parsing a channel ID from a channel URL (#3075)
TheCataliasTNT2k Dec 8, 2024
77b5c5f
Fix clippy warning (#3081)
mkrasnitski Dec 9, 2024
c9d4329
Add `newly_created` bool field to the `ThreadCreate` event (#3084)
jamesbt365 Dec 19, 2024
5f9aa6d
Fix deserialisation of `Token` type (#3086)
arqunis Jan 9, 2025
5f07257
Fix issues from rebase
arqunis Jan 16, 2025
45fb401
Remove `ContentSafeOptions::show_discriminator`
arqunis Jan 16, 2025
31025c0
Change MessageUpdateEvent to just contain a full Message (#3061)
GnomedDev Jan 19, 2025
cb9091b
add kind to all interaction enum variants to fix interaction serde
cheesycod Jan 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .cargo/config.toml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
ci:
- .github/**/*
command_attr:
- command_attr/**/*
examples:
- examples/**/*
builder:
Expand Down
62 changes: 29 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: CI
on: [push, pull_request]

env:
rust_min: 1.74.0
rust_nightly: nightly-2024-03-09
rust_min: 1.82.0
rust_nightly: nightly-2024-11-01

jobs:
test:
Expand All @@ -26,7 +26,9 @@ jobs:
- no cache
- no gateway
- unstable Discord API features
- simd-json
- zlib compression
- zstd compression
- zlib and zstd compression

include:
- name: beta
Expand All @@ -38,22 +40,26 @@ jobs:
- name: no default features
features: " "
- name: no cache
features: builder client framework gateway model http standard_framework utils rustls_backend
- name: simd-json
features: default_no_backend rustls_backend simd_json
features: framework rustls_backend
- name: no gateway
features: model http rustls_backend
features: model rustls_backend
- name: chrono
features: chrono
- name: unstable API + typesize
features: default unstable_discord_api typesize
features: default unstable typesize
dont-test: true
- name: builder without model
features: builder
dont-test: true
- name: unstable Discord API (no default features)
features: unstable_discord_api
features: unstable
dont-test: true
- name: zlib compression
features: default transport_compression_zlib
- name: zstd compression
features: default transport_compression_zstd
- name: zlib and zstd compression
features: default transport_compression_zlib transport_compression_zstd

steps:
- name: Checkout sources
Expand Down Expand Up @@ -131,9 +137,6 @@ jobs:
- name: Cache
uses: Swatinem/rust-cache@v2

- name: Remove cargo build config
run: rm .cargo/config.toml

- name: Build
run: cargo build

Expand Down Expand Up @@ -210,8 +213,7 @@ jobs:

- name: Build docs
run: |
cargo doc --no-deps --features collector,voice,unstable_discord_api
cargo doc --no-deps -p command_attr
cargo doc --no-deps --features full,unstable
env:
RUSTDOCFLAGS: -D rustdoc::broken_intra_doc_links

Expand Down Expand Up @@ -241,32 +243,26 @@ jobs:
- name: 'Check example 4'
run: cargo check -p e04_message_builder
- name: 'Check example 5'
run: cargo check -p e05_command_framework
run: cargo check -p e05_sample_bot_structure
- name: 'Check example 6'
run: cargo check -p e06_sample_bot_structure
run: cargo check -p e06_env_logging
- name: 'Check example 7'
run: cargo check -p e07_env_logging
run: cargo check -p e07_shard_manager
- name: 'Check example 8'
run: cargo check -p e08_shard_manager
- name: 'Check example 9'
run: cargo check -p e09_create_message_builder
run: cargo check -p e08_create_message_builder
- name: 'Check example 09'
run: cargo check -p e09_collectors
- name: 'Check example 10'
run: cargo check -p e10_collectors
run: cargo check -p e10_gateway_intents
- name: 'Check example 11'
run: cargo check -p e11_gateway_intents
run: cargo check -p e11_global_data
- name: 'Check example 12'
run: cargo check -p e12_global_data
run: cargo check -p e12_parallel_loops
- name: 'Check example 13'
run: cargo check -p e13_parallel_loops
run: cargo check -p e13_sqlite_database
- name: 'Check example 14'
run: cargo check -p e14_slash_commands
run: cargo check -p e14_message_components
- name: 'Check example 15'
run: cargo check -p e15_simple_dashboard
run: cargo check -p e15_webhook
- name: 'Check example 16'
run: cargo check -p e16_sqlite_database
- name: 'Check example 17'
run: cargo check -p e17_message_components
- name: 'Check example 18'
run: cargo check -p e18_webhook
- name: 'Check example 19'
run: cargo check -p e19_interactions_endpoint
run: cargo check -p e16_interactions_endpoint
1 change: 0 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
RUSTDOCFLAGS: --cfg docsrs -D warnings
run: |
cargo doc --no-deps --features full
cargo doc --no-deps -p command_attr

- name: Prepare docs
shell: bash -e -O extglob {0}
Expand Down
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ your code.

## Unsafe

Code that defines or uses `unsafe` functions must be reasoned with comments.
`unsafe` code can pose a potential for undefined behaviour related bugs and other
kinds of bugs to sprout if misused, weakening security. If you commit code containing
`unsafe`, you should confirm that its usage is necessary and correct.
Unsafe code is forbidden, and safe alternatives must be found. This can be mitigated by using
a third party crate to offload the burden of justifying the unsafe code, or finding a safe
alternative.

# Comment / Documentation style

Expand Down
85 changes: 41 additions & 44 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,49 +24,51 @@ repository = "https://github.com/serenity-rs/serenity.git"
keywords = ["discord", "api"]
license = "ISC"
edition = "2021"
rust-version = "1.74"
rust-version = "1.82"

[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"] }
serde = { version = "1.0.192", features = ["derive", "rc"] }
url = { version = "2.4.1", features = ["serde"] }
tokio = { version = "1.34.0", features = ["fs", "macros", "rt", "sync", "time", "io-util"] }
tokio = { version = "1.34.0", features = ["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"] }
zeroize = { version = "1.7" } # Not used in serenity, but bumps the minimal version from secrecy
arrayvec = { version = "0.7.4", features = ["serde"] }
serde_cow = { version = "0.1.0" }
small-fixed-array = { version = "0.4", features = ["serde"] }
bool_to_bitflags = { version = "0.1.2" }
nonmax = { version = "0.5.5", features = ["serde"] }
strum = { version = "0.26", features = ["derive"] }
to-arraystring = "0.2.0"
extract_map = { version = "0.1.0", features = ["serde", "iter_mut"] }
aformat = "0.1.3"
bytes = "1.5.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 }
zstd-safe = { version = "7.2.1", optional = true }
reqwest = { version = "0.12.2", default-features = false, features = ["multipart", "stream", "json"], optional = true }
tokio-tungstenite = { version = "0.24.0", features = ["url"], 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 }
dashmap = { version = "6.1.0", features = ["serde"], optional = true }
parking_lot = { version = "0.12.1"}
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"] }
typesize = { version = "0.1.6", optional = true, features = ["url", "time", "serde_json", "secrecy", "parking_lot", "nonmax", "extract_map_01"] }
# 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"
version = "1.1.0"
package = "http"

[features]
Expand All @@ -76,49 +78,44 @@ 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",
"transport_compression_zlib",
"transport_compression_zstd",
]

# Enables builder structs to configure Discord HTTP requests. Without this feature, you have to
# construct JSON manually at some places.
builder = []
builder = ["tokio/fs"]
# 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"]
cache = ["fxhash", "dashmap"]
# 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"]
collector = ["gateway"]
# Enables the Framework trait which is an abstraction for old-style text commands.
framework = ["client", "model", "utils"]
framework = ["gateway"]
# Enables gateway support, which allows bots to listen for Discord events.
gateway = ["flate2"]
gateway = ["model", "flate2"]
# Enables HTTP, which enables bots to execute actions on Discord.
http = ["mime_guess", "percent-encoding"]
http = ["dashmap", "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 zlib-stream transport compression of incoming gateway events.
transport_compression_zlib = ["flate2", "gateway"]
# Enables zstd-stream transport compression of incoming gateway events.
transport_compression_zstd = ["zstd-safe", "gateway"]
# 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 = []
unstable = []
# Enables some utility functions that can be useful for bot creators.
utils = []
voice = ["client", "model"]
voice = ["gateway"]
# Enables unstable tokio features to give explicit names to internally spawned tokio tasks
tokio_task_builder = ["tokio/tracing"]
interactions_endpoint = ["ed25519-dalek"]
Expand All @@ -127,33 +124,33 @@ 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"]
#
# Unstable functionality should be gated under the `unstable` feature.
full = ["default", "collector", "voice", "voice_model", "interactions_endpoint"]

# 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 = []
typesize = ["dep:typesize", "dashmap/typesize", "small-fixed-array/typesize", "bool_to_bitflags/typesize"]

# Enables compile-time heavy instrument macros from tracing
tracing_instrument = ["tracing/attributes"]

# 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"]

Loading
Loading