v0.12.0
This release turned out to be one of serenity's largest ever, with well over 300 PRs in total! It contains quite a few major breaking changes to the API. Therefore, the changelog for this release also serves as a migration guide for users upgrading from the 0.11 series.
Thanks to the following for their contributions:
- @arqunis
- @alakhpc
- @AngelOnFira
- @Bloectasy
- @campbellcole
- @cheesycod
- @crivasr
- @darkyeg
- @fenhl
- @GnomedDev
- @jamesbt365
- @Joshument
- @kangalio
- @Kneemund
- @LaytonGB
- @marcantoinem
- @Miezhiko
- @Milo123459
- @mkrasnitski
- @nickelc
- @oSumAtrIX
- @Ruthenic
- @Sergiovan
- @skreborn
- @StckOverflw
- @tatsuya6502
- @tazz4843
- @vaporoxx
- @Xaeroxe
Builders
The closure-based API for constructing requests using the builder pattern has been ripped out and replaced. In place of closures, users must now pass in builder types directly. For example, in serenity 0.11, code like the following was very common:
let channel = guild
.create_channel(&http, |c| c.name("my-test-channel").kind(ChannelType::Text))
.await?;
Now, users instead write the following code:
let builder = CreateChannel::new("my-test-channel").kind(ChannelType::Text);
let channel = guild.create_channel(&http, builder).await?;
Or, inline like so:
let channel = guild
.create_channel(&http, CreateChannel::new("my-test-channel").kind(ChannelType::Text))
.await?;
Note that in this particular example, the channel name is now a mandatory field that must be passed in when constructing the builder. Mutating the builder with subsequent calls to CreateChannel::name
will change the underlying value. Additionally, all methods on builders now take mut self
and return Self
, instead of taking and returning &mut self
/&mut Self
. This allows for explicit construction as in the second example above. Also, builders no longer wrap a pub HashMap<&'static str, T>
; the hashmap has been flattened into concrete private fields.
Some benefits to this new approach to builders are:
- Because every closure has a type unique to it, each call to a method taking a closure would be monomorphized separately, resulting in binary bloat. This is no longer the case.
- Builders can be constructed once and then cloned and re-used multiple times.
- Enforcement of field requirements (as dictated by the Discord API docs) provides compile-time request validation.
Attachments
- The
AttachmentType
enum has been replaced with aCreateAttachment
builder struct. This struct has thefile
,path
, andurl
constructors that eagerly evaluate the data passed to them -CreateAttachment
simply stores the resulting raw data. This is in contrast toAttachmentType
which lazily carried filepaths/urls with it, and haddata
andfilename
methods for resolving them. Additionally, theCreateAttachment::to_base64
method can be used to manually encode an attachment if needed. - A new
EditAttachments
builder struct has been added for use with theattachments
method on theEditMessage
,EditWebhookMessage
, andEditInteractionResponse
builders. This new builder provides finer control when editing a message's existing attachments or uploading additional ones. Also, the following methods have been renamed to more accurately reflect their behavior:
serenity v0.11 | serenity v0.12 |
---|---|
EditMessage::attachment |
EditMessage::new_attachment |
EditMessage::add_existing_attachment |
EditMessage::keep_existing_attachment |
EditWebhookMessage::clear_existing_attachments |
EditWebhookMessage::clear_attachments |
EditInteractionResponse::clear_existing_attachments |
EditInteractionResponse::clear_attachments |
Collectors
Collectors have been redesigned and simplified at no cost to expressibility. There is now a generic collector::collect
function which takes a closure as argument, letting you filter events as they stream in.
- The specific collectors (
ComponentInteractionCollector
,ModalInteractionCollector
,MessageCollector
, andReactionCollector
) are simply convenience structs that wrap this underlying function. EventCollector
is now deprecated, as its use usually involved anti-patterns around fallibility. However, its functionality can still be replicated usingcollector::collect
. See example 10 for more details.- The
RelatedId
andRelatedIdsForEventType
types have been removed as they were only used byEventCollector
. Methods for retrieving them from events have also been removed; if users wish to extract "related" ids from an event, they should do so directly from the event's fields. The removed methods are the following:Event::user_id
Event::guild_id
Event::channel_id
Event::message_id
EventType::related_ids
Commands
In an effort to shorten long names and make import paths less unwieldy, Serenity now uses command
instead of application_command
in all places, except for the Permissions::USE_APPLICATION_COMMANDS
constant. This includes methods on the Http
, GuildId
, Guild
, PartialGuild
, and Command
types, as well as a few other miscellaneous places:
serenity v0.11 | serenity v0.12 |
---|---|
Http::*_{global,guild}_application_command* |
Http::*_{global,guild}_command* |
{GuildId,Guild,PartialGuild}::*_application_command* |
{GuildId,Guild,PartialGuild}::*_command* |
Command::*_global_application_command* |
Command::*_global_command* |
Interaction::application_command |
Interaction::command |
EventHandler::application_command_permissions_update |
EventHandler::command_permissions_update |
Route::ApplicationCommand* |
Route::Command* |
Permissions::use_application_commands |
Permissions::use_commands |
Additionally, the following command types have been renamed:
serenity v0.11 | serenity v0.12 |
---|---|
CreateApplicationCommand |
CreateCommand |
CreateApplicationCommandOption |
CreateCommandOption |
CreateApplicationCommandPermissionData |
CreateCommandPermission |
CreateApplicationCommandPermissionsData |
EditCommandPermissions |
CommandPermission |
CommandPermissions |
CommandPermissionData |
CommandPermission |
Furthermore, the methods on CreateCommandPermission
, such as new
, kind
, etc. have been replaced with constructors for each type of permission, e.g. role
, user
, channel
, etc., to avoid a possible mismatch between kind
and the id that gets passed in.
Finally, the {GuildId,Guild,PartialGuild}::create_command_permission
method has been renamed to edit_command_permission
to more accurately reflect its behavior.
Cache
- Cache methods now return a
CacheRef
type that wraps a reference into the cache. Other methods that returned a map, now return a wrapper type around a reference to the map, with a limited API to prevent accidental deadlocks. This all helps reduce the number of clones when querying the cache. Those wishing to replicate the old behavior can simply call.clone()
on the return type to obtain the wrapped data. CacheSettings
has new fieldstime_to_live
,cache_guilds
,cache_channels
, andcache_users
, allowing cache configuration on systems with memory requirements; whereas previously, memory-constrained systems were forced to disable caching altogether.- Caching for
PrivateChannel
s (aka DM channels) has been removed, as they are never sent across the gateway by Discord. Therefore, theCache::{private_channel, private_channels}
methods have been removed, andCache::guild_channel
has been renamed to justCache::channel
. Additionally, some uses of theChannel
enum in return types have been replaced with eitherGuildChannel
orPrivateChannel
as seen fit.
IDs
All *Id
types have had their internal representations made private. Therefore, the API has changed as follows:
serenity v0.11 | serenity v0.12 |
---|---|
ExampleId(12345) |
ExampleId::new(12345) |
example_id.as_u64() |
example_id.get() |
Note that all *Id
types now implement Into<u64>
and Into<i64>
. Additionally, attempting to instantiate an id with a value of 0
will panic.
Also, the implementations of FromStr
for the UserId
, RoleId
, and ChannelId
types now expect an integer rather than a mention string. The following table shows the new expected input strings:
serenity v0.11 | serenity v0.12 | |
---|---|---|
ChannelId |
<#81384788765712384> |
81384788765712384 |
RoleId |
<@&136107769680887808> |
136107769680887808 |
UserId |
<@114941315417899012> or <@!114941315417899012> |
114941315417899012 |
Users wishing to parse mentions should either parse into a Mention
object, or use the utils::{parse_user_mention, parse_role_mention, parse_channel_mention}
methods.
Interactions
The various interaction types have been renamed as follows:
serenity v0.11 | serenity v0.12 |
---|---|
ApplicationCommandInteraction |
CommandInteraction |
MessageComponentInteraction |
ComponentInteraction |
ModalSubmitInteraction |
ModalInteraction |
Method names on interaction types have been shortened in the following way:
serenity v0.11 | serenity v0.12 |
---|---|
create_interaction_response |
create_response |
create_followup_message |
create_followup |
delete_original_interaction_response |
delete_response |
delete_followup_message |
delete_followup |
edit_original_interaction_response |
edit_response |
edit_followup_message |
edit_followup |
get_interaction_response |
get_response |
get_followup_message |
get_followup |
AutocompleteInteraction
has been merged intoCommandInteraction
, along with its corresponding methods.- The
kind
field has been removed from each of the interaction structs. - A
quick_modal
method has been added toCommandInteraction
andComponentInteraction
. See the docs for more details.
Framework
The standard framework is now configurable at runtime, as the configure
method now takes self
by reference. In line with the builder changes, the Configuration
and BucketBuilder
builders are no longer closure-based and must be passed in directly. Also, the Framework
trait has been reworked to accomodate more use cases than just text commands:
- The
dispatch
method now takes aFullEvent
as argument instead of just aMessage
. This enum contains all the data that is passed to theEventHandler
. - An optional
init
method has been added, that allows for more complex framework initialization, which can include executing HTTP requests, or accessing cache or shard data.
As a result, the trait now accomodates alternative frameworks more easily, such as poise.
Gateway
- Renamed
WsStream
toWsClient
. - The
ShardManagerMonitor
andShardManagerMessage
types have been removed. Their functionality has been replicated via methods directly onShardManager
. Any fields with typeSender<ShardManagerMessage>
, as well as theClient::shard_manager
field, have had their types changed toArc<ShardManager>
. The new methods onShardManager
are the following:return_with_value
shutdown_finished
restart_shard
update_shard_latency_and_stage
- The
ShardClientMessage
andInterMessage
enums were deemed redundant wrappers aroundShardRunnerMessage
and removed - users should useShardRunnerMessage
directly instead. - The
ShardManagerError
type is removed in favor ofGatewayError
. - Serenity's handling of gateway heartbeats has been made more accurate and type safe as follows:
- Removed
Shard::heartbeat_instants
. Users should instead use thelast_heartbeat_{sent,ack}
methods, which now returnOption<Instant>
instead ofOption<&Instant>
. - Changed
Shard::heartbeat_interval
to returnOption<Duration>
instead ofOption<u64>
. - Rename
Shard::check_heartbeat
todo_heartbeat
.
- Removed
ShardMessenger::new
now takes&ShardRunner
as argument instead ofSender<ShardRunnerMessage>
.- Removed the
ShardRunnerMessage::AddCollector
variant in favor of theShardMessenger::add_collector
method. This method adds the collectors immediately, whereasShardRunnerMessage
is polled periodically in a loop - this could occasionally cause collectors to drop the first event they received. - All remaining types found at
serenity::client::bridge::{gateway,voice}::*
have been moved intoserenity::gateway
. They are now gated behind thegateway
feature instead of theclient
feature, however most users use these features in conjunction, and so should not see a change in required-enabled features.
MSRV
Serenity now uses Rust edition 2021, with an MSRV of Rust 1.74.
Miscellaneous
Added
- #1923, #2465 - Add a
thread_id
parameter toHttp::{get,edit,delete}_webhook_message
,Http::execute_webhook}
, as well asWebhook::{get,delete}_message
. - #2104, #2105 - Add an
audit_log_reason
parameter to manyHttp
methods and builder structs. - #2164 - Add
EventHandler::shards_ready
method. - #2186, #2201 - Add support for having a bot interactions endpoint URL.
- #2215 - Implement
Default
for many model types. - #2233 - Add
button
andselect_menu
methods to the following builders:CreateInteractionResponseMessage
CreateInteractionResponseFollowup
EditInteractionResponse
CreateMessage
EditMessage
EditWebhookMessage
ExecuteWebhook
- #2247, #2357, #2385 - Add support for forum channels and creating forum posts using
ChannelId::create_forum_post
andGuildChannel::create_forum_post
. - #2257 - Add support for multiple event handlers by replacing the
event_handler
andraw_event_handler
fields with pluralizedevent_handlers
andraw_event_handlers
in the following structs:ShardManagerOptions
ShardQueuer
ShardRunner
ShardRunnerOptions
ClientBuilder
- #2273, #2367 - Add events
ReactionRemoveEmoji
andGuildAuditLogEntryCreate
. - #2276 - Add support for automod regex patterns.
- #2297 - Add the
serenity::all
module, which re-exports most public items in the crate. - #2336 - Add a
CreateButton::custom_id
method. - #2369 - Add support for editing a guild's MFA level using
{GuildId, Guild, PartialGuild}::edit_mfa_level
. - #2391 - Add attachments support to the
EditWebhookMessage
endpoint by adding anew_attachments
parameter toHttp::edit_webhook_message
, as well as the following methods to theEditWebhookMessage
builder:attachment
add_existing_attachment
remove_existing_attachment
- #2415, #2461 - Add support for Discord's new usernames by adding the
User::global_name
field, and by making discriminators on usernames optional and non-zero. In particular, thePresenceUser::discriminator
andUser::discriminator
fields are now of typeOption<NonZeroU16>
. - #2487 - Add support for the Get Current User Guild Member endpoint with the
{GuildId,Guild,PartialGuild}::current_user_member
method. - #2503 - Add support for setting custom activity statuses.
- #2520 - Add the
User::static_face
method, mirroringUser::face
. - #2535 - Add pagination support to the Get Guild Bans endpoint.
- #2565 - Add support for the
VOICE_CHANNEL_STATUS_UPDATE
gateway event. - #2576 - Add a
GuildId::everyone_role
method. - #2588 - Add audit log events for creator monetization.
- #2595 - Add the
CREATE_EVENTS
andCREATE_GUILD_EXPRESSIONS
permissions, and renameMANAGE_EMOJIS_AND_STICKERS
toMANAGE_GUILD_EXPRESSIONS
(the old name is still present but deprecated). - #2600 - Add the
FormattedTimestamp
utility struct for representing a combination of a timestamp and a formatting style. - #2601 - Add support for more Discord subdomains in
utils::argument_convert::parse_message_url
. - #2614 - Add
Hash
toTimestamp
's derive list. - #2592 - Add experimental
typesize
support. - #2618 - Implement
From<Into<String>>
forAutocompleteChoice
.
Changed
- #1896 -
Request::body_ref
now returnsOption<&T>
instead of&Option<&T>
. - #1897, #2350 -
Typing::stop
now returnsbool
instead ofOption<()>
. Also,Typing::start
and any wrapper methods are now infallible. - #1922, #1940, #2090 - The following methods are no longer
async
:ChannelId::name
Context::*
Guild::{members_starting_with, members_containing, members_username_containing, members_nick_containing}
Guild::default_channel
PartialGuild::greater_member_hierarchy
ShardManager::new
UserId::to_user_cached
- #1929 - Unbox the
Error::Http
variant. - #1934 - Change
Guild::member
to returnCow<'_, Member>
instead of justMember
. - #1937 - Change all fields of
ShardManagerOptions
to be owned (Arc
is cheap to clone). - #1947 - Change methods related to pruning to take and return
u8
. - #1963 - Change
RequestBuilder::body
fromOption<&[u8]>
toOption<Vec<u8>>
. - #1976 - Make
MessageInteraction
non-exhaustive, and add amember
field. - #1977 - Rename
Permissions::USE_SLASH_COMMANDS
toUSE_APPLICATION_COMMANDS
. - #1980 - Rename
constants::OpCode
toOpcode
, and the same forvoice_model::OpCode
. - #1984 - Introduce
ShardInfo
for tracking Shard ids, and change ids fromu64
tou32
. - #1990 - Change the
Message::nonce
field to a customNonce
enum instead of aserde_json::Value
. - #1999 - Make
MembershipState
,ScheduledEventStatus
, andScheduledEventType
non-exhaustive. - #2005 - Change
MessageActivityKind
variants to use CamelCase instead of ALL_CAPS. - #2007, #2018 - Rework presence setting and storing as follows:
- Replace
CurrentPresence
with aPresenceData
struct. - Use
ActivityData
in place ofActivity
for setting the current presence. - Change the various
set_activity
methods to take anOption<ActivityData>
to allow for clearing the current presence by passing inNone
. - Add support for setting a presence when first identifying to the gateway by adding presence methods to
ClientBuilder
, and adding an optionalpresence
parameter toShard::new
.
- Replace
- #2008 - Unknown values for enum variants are now preserved for debugging purposes. Any
Unknown
variants on enums are now changed toUnknown(u8)
. Also, thenum
method for those enums is removed; users should callu8::from
instead. - #2017 - Change
Member::edit
to edit in place, and returnResult<()>
instead ofResult<Message>
. - #2023, #2170, #2459 - Use Id types everywhere instead of
u32
,u64
, orNonZeroU64
. - #2030 - Change
{GuildId, Guild, PartialGuild}::delete
to returnResult<()>
. - #2032 - Replace
impl From<String> for Timestamp
withimpl TryFrom<&str>
. - #2047 - The following functions are now
const
:LightMethod::reqwest_method
Ratelimit::{limit, remaining, reset, reset_after}
RequestBuilder::new
Channel::{id, position, name}
Error::is_cache_err
Event::event_type
EventType::name
GatewayIntents::*
Permissions::*
- #2052 - Change the
CommonFilterOptions::{filter_limit, collect_limit}
fields fromu32
toNonZeroU32
. - #2054 - Change the
GuildChannel::message_count
field fromOption<u8>
toOption<u32>
. - #2073 - Move the
serenity::utils::colour
module intoserenity::model
. - #2127 - Replace
CreateAllowedMentions::parse
withall_users
,all_roles
, andeveryone
methods. - #2139 - Change
ChannelId::name
to returnResult<String>
instead ofOption<String>
. - #2144 - Don't offer different function signatures for
EventHandler
methods if thecache
feature is disabled. Relevant cache-dependant data is now passed in usingOption
. - #2149 - Change channel positions, role positions, and bitrates to always be
u32
. - #2173 - Replace the implementation of
Future
forClientBuilder
withIntoFuture
. - #2173 - Make
ClientBuilder::{get_token, get_type_map, get_cache_settings}
infallible. - #2194 - Change
CacheUpdate::Output
forChannelDeleteEvent
from()
toVec<Message>
. - #2205 - Wrap the following large model fields in
Box
:CommandInteraction::member
ComponentInteraction::message
ModalInteraction::message
Message::member
Message::interaction
- #2224 - Introduce
CreateSelectMenuKind
andComponentInteractionDataKind
enums to better enforce well-formation of requests. - #2244 - Flatten the
http
module by re-exporting all types found in submodules at the top level and removinng access to the submodules themselves. - #2277 - Make
ErrorResponse
non-exhaustive, change theurl
field fromUrl
toString
, and add amethod
field. - #2285 - Wrap the
Http::ratelimiter
field inOption
, and remove the correspondingratelimiter_disabled
field. - #2285 - Add an optional
reason
parameter toHttp::{ban, kick}
, and removeHttp::{ban,kick}_with_reason
. - #2288 - Merge the
Route
andRouteInfo
enums, and addmethod
andparams
fields to theRequest
struct. - #2310 - Flatten the
model::application
module in the same way thehttp
module was flattened. - #2327 - Change the
ThreadMembersUpdateEvent::member_count
field fromu8
toi16
. - #2393 - Change the following field and enum variant types:
GuildUpdateEvent::guild
fromPartialGuild
toGuild
Reaction::member
fromOption<PartialMember>
toMember
Integration::guild_id
fromGuildId
toOption<GuildId>
IncidentUpdate::status
fromIncidentStatus
toString
(IncidentStatus
is also removed){Guild,PartialGuild}::premium_subscription_count
fromu64
toOption<u64>
InputText::value
fromString
toOption<String>
CurrentApplicationInfo::owner
fromUser
toOption<User>
ScheduledEventMetadata::location
fromString
toOption<String>
Trigger::KeywordPreset
from a tuple variant to a struct variant
- #2393 - Rename the following field and enum variants:
Incident::short_link
toshortlink
ThreadDeleteEvent::channels_id
tochannel_ids
ThreadMembersUpdateEvent::removed_members_ids
toremoved_member_ids
InviteTargetType::EmmbeddedApplication
toEmbeddedApplication
Scope::RelactionshipsRead
toRelationshipsRead
- #2393, #2418 - Change
CurrentUser
to be a newtype aroundUser
, implement theDeref
trait, and remove theguilds
,invite_url
, andinvite_url_with_oauth2_scopes
methods. The only method now unique toCurrentUser
isedit
. All other methods are available to call via deref coercion. - #2397 - Make the following
model
types non-exhaustive:model::application::{Interaction, ActionRow, Button, SelectMenu, SelectMenuOption, InputText}
model::application::{PartialCurrentApplicationInfo, Team, TeamMember, InstallParams}
model::channel::{PartialGuildChannel, ChannelMention}
model::gateway::{ActivityEmoji, ClientStatus}
model::guild::{Ban, GuildPrune, GuildInfo, UnavailableGuild, GuildWelcomeScreen}
model::guild::{ScheduledEventMetadata, ScheduledEventUser}
model::guild::automod::{Rule, TriggerMetadata, Action, ActionExecution}
model::misc::EmojiIdentifier
- #2428 - Change
CacheUpdate::Output
forChannelUpdateEvent
from()
toChannel
. Also, make{Guild,PartialGuild}::user_permissions_in
infallible and changeError::InvalidPermissions
into a struct variant containing both the therequired
permissions as well as thepresent
permissions. - #2460 - Wrap secret tokens in
secrecy::SecretString
to prevent them being leaked throughDebug
implementations, and so that they are zeroed when dropped. - #2462, #2467, #2586 - Change image hashes from
String
s to a dedicatedImageHash
type which saves on space by storing the hash directly as bytes. - #2464 - Optimize the size of many model structs by changing the types of their fields:
- All
rate_limit_per_user
fields are now counted using au16
. - Channel
position
fields now hold au16
. - Role
positition
fields now hold au16
. - All
auto_archive_position
fields are now an enumAutoArchivePosition
. - All
afk_timeout
fields are now an enumAfkTimeout
. - Replace the
DefaultReaction
struct with aForumEmoji
enum. - The
Sticker::sort_value
field is now anOption<u16>
. - The
min_values
andmax_values
fields for Select Menus now hold au8
. - The
max_age
invite field now holds au32
. - The
max_uses
invite field now holds au8
. - The
ActivityParty
current and maximum size are now of typeu32
. - The
Ready::version
field is now au8
. - The
min_length
andmax_length
fields for Input Text components now hold au16
. - The
mention_total_limit
field for automod triggers now holds au8
. - The
RoleSubscriptionData::total_months_subscribed
field is now au16
.
- All
- #2470 - Rename
{Http,ChannelId,GuildChannel}::create_public_thread
tocreate_thread_from_message
, and similarly renamecreate_private_thread
tocreate_thread
, to more accurately reflect their behavior. The corresponding endpoints have also been renamed fromChannelPublicThreads
/ChannelPrivateThreads
, toChannelMessageThreads
/ChannelThreads
, respectively. - #2519 - Make stage channels text-based.
- #2551 - The
ThreadDelete
event now provides the fullGuildChannel
object for the deleted thread if it is present in the cache. - #2553 - The
ThreadUpdate
event now provides the old thread'sGuildChannel
object if it is present in the cache. - #2554 - The
Webhook::source_guild
andWebhook::source_channel
fields have had their types changed fromOption<PartialGuild>
/Option<PartialChannel>
to their ownOption<WebhookGuild>
/Option<WebhookChannel>
types in order to avoid deserialization errors. These new types contain very few fields, but have methods for converting intoPartialGuild
s orChannel
s by querying the API. - #2569 - Replaced the
json::prelude
module with public wrapper functions that abstract over bothserde_json
andsimd-json
. - #2593 - Rename
GatewayIntents::GUILD_BANS
toGUILD_MODERATION
(the old name is still present but is deprecated). - #2598 - Change
CreateInteractionResponseMessage::flags
to takeInteractionResponseFlags
instead ofMessageFlags
. - #2609 - Split parts of
ThreadMember
intoPartialThreadMember
. - #2622 - Implement role addition/removal using dedicated endpoints.
- #2623 - Use dedicated types for
GuildId::audit_logs
. - #2625 - Change
Guild::members_with_status
to returnimpl Iterator<Item = &Member>
instead ofVec<Member>
.
Removed
- #1864, #1902 - Remove all deprecated types, fields, and methods.
- #1885 - Remove the lifetime parameter on
model::application::ResolvedTarget
. - #1927 - Remove
model::guild::GuildContainer
. - #1938 - Remove
EventHandler::{guild_unavailable, unknown}
. - #1959 - Remove
EditProfile::{email, password, new_password}
. - #2034 - Remove
serenity::json::from_number
. Users should call.into()
instead. - #2128 - Remove the
Channel::Category
variant, asGuildChannel::kind
can already beChannelType::Category
. However, theChannel::category
method is still available. - #2161 - Remove the
Mention::Emoji
variant. - #2162 - Remove
serenity::token::parse
- usetoken::validate
instead. - #2246 - Remove the
absolute_ratelimits
feature and replace it with a runtime configuration option. - #2308 - Remove
CacheAndHttp
, and inline it as separatecache
andhttp
fields in the following structs:ShardManagerOptions
ShardQueuer
ShardRunner
ShardRunnerOptions
Client
- #2393 - Remove non-existent fields and enum variants that Discord no longer sends back from the API. The following fields have been removed:
VoiceServerUpdateEvent::channel_id
ResumedEvent::channel_id
Ready::{presences, private_channels, trace}
InviteGuild::{text_channel_count, voice_channel_count}
VoiceState::token
IncidentUpdate::affected_components
(and also theAffectedComponent
struct)Maintenance::{description, stop, start}
SelectMenu::values
MessageUpdateEvent::{author, timestamp, nonce, kind, stickers}
PartialGuild::{owner, permissions}
InviteTargetType::Normal
Trigger::HarmfulLink
- #2424 - Remove the
FromStrAndCache
andStrExt
traits. Also removesmodel::{ChannelParseError,RoleParseError}
, which conflicted with types of the same name fromutils
. - #2429 - Remove the useless re-exports of the various submodules of
model
from themodel::prelude
, and don't re-export types from other libraries, likeDeserialize
orHashMap
. - #2466 - Remove the
DefaultAvatar
enum. - #2531 - The following bitflag types no longer implement
PartialOrd
/Ord
:- ActivityFlags
- ApplicationFlags
- ChannelFlags
- GatewayIntents
- GuildMemberFlags
- InteractionResponseFlags
- MessageFlags
- Permissions
- SpeakingState
- SystemChannelFlags
- ThreadMemberFlags
- UserPublicFlags
- #2559 - Remove the
EventType
enum. Instead ofEvent::event_type().name()
, users should just callEvent::name
. - #2578 - Remove the
PingInteraction::guild_locale
field.