workshop-bot
workshop-bot copied to clipboard
fix(deps): update rust crate serenity to 0.12.0
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| serenity | dependencies | minor | 0.11.5 -> 0.12.0 |
Release Notes
serenity-rs/serenity (serenity)
v0.12.4
This is a hotfix release to fix broken behaviour of Message::author_permissions before it is relied on.
Thanks to the following for their contributions:
Deprecations
- #3037 Permission methods which do not respect channel permission overrides are now deprecated, use the
_invariants.
Additions
- #3008
From<&User>has been added toCreateEmbedAuthor, to avoid consuming the user.
Fixes
- #3037
Message::author_permissionsnow respects permission overrides, as it is documented to. - #3039
Message::author_permissionsnow respectsSEND_MESSAGES_IN_THREADSwhen used in threads.
Documentation improvements
- #3038 Documentation for
Guild::threadshas been expanded.
v0.12.3
Thanks to the following for their contributions:
- [@FabseGP]
- [@GnomedDev]
- [@HiccupEnthusiast]
- [@MarkusTheOrt]
- [@NiiightmareXD]
- [@ValgulNecron]
- [@gBasil]
- [@ivinjabraham]
- [@jamesbt365]
- [@limonfort]
- [@m1sk9]
- [@mkrasnitski]
- [@onzecki]
- [@rhgndf]
- [@stormofice]
- [@thmasq]
- [@thou-vow]
Deprecations
- #2894
Message(Id)::link_ensuredcan be replaced byMessage(Id)::linkif recieved via event, orMessageId::linkif the message was recieved via a HTTP request. - #2905
CreateInteractionResponse::PremiumRequiredhas been deprecated and replaced with Premium Buttons. - #3030
GuildChannel::permissions_for_userhas been deprecated, use the newMessage::author_permissionshelper orGuild::user_permissions_in.
Additions
- #2891 Guild Incident message types have been added to MessageType.
- #2913
CreateButtonnow implementsFrom<Button>. - #2914
User::display_namehas been added, as users may have two different names now. - #2920 Support for Application Emojis has been added, getting rid of those "emoji servers" many bots required.
- #2905 Support for Premium Buttons has been added, which link to the store page of a chosen SKU.
- #2926 A method to get the role icon URL has been added.
- #2939 Some missing fields have been added to to
CurrentApplicationInfo. - #2946 Support for the Get Guild Role endpoint has been added.
- #2960 Support for the Get Sticker Pack by Id endpoint has been added.
- #2962 Some missing entries in
GuildMemberFlagshave been added. - #2950 The missing
USE_EXTERNAL_APPSpermission has been added. - #2987 A builder for the Get Entitlements endpoint has been added.
- #2996
MessageReferenceKindhas been added to start supporting forwarding. - #3001
{PartialGuild, Guild}::partial_member_permissionshas been added for more efficent permissions checking - #3013 Interaction responses can now send polls.
- #3018 User App support has been stablised, usable without
unstable_discord_api. - #3021 Support for Entry Point Commands has been added.
- #3030 A
Message::author_permissionshelper has been added, alongsidePermissions::dm_permissions.
Deserialisation Fixes
- #2887, #2893 Messages with reactions no longer fail to deserialize due to super reaction changes.
- #2917 Application no longer fails to deserialize with
unstable_discord_api - #3032 Guilds with an @everyone role at position
-1no longer fail to deserialise.
General fixes
- #2886 A typo has been fixed in
GuildId::members_iterdocumentation. - #2906
CreateAttachmentdocumentation has been updated to be more consistent with other builders. - #2911
CreateEmbedAuthordocumentation can now spellembedcorrectly. - Pushed to Current
AuthorizingIntegrationOwnersis now usable, as the field was previously private. - #2945 (
Partial)Guild::member_permissionsis now usable without cache. - #2973
ChannelId::delete_messagesdocumentation has been expanded to document the single item case. - #2959 The rules for attachment names for local attachments in embeds have now been documented.
- #3005 The fields of
BulkBanResponsehave been made public. - #3006 The
bulk_banendpoint is now usable, previously unusable due toSendissues.
v0.12.2
Thanks to the following for their contributions:
- [@bend-n]
- [@GnomedDev]
- [@jamesbt365]
- [@MidSpike]
- [@mkrasnitski]
- [@RegenJacob]
Deprecations
Continuing with the deprecations started in 0.12.1, many more methods and fields have been deprecated in order to make an easier upgrade path to 0.13.
These deprecation messages include a migration path, it is recommended to go one by one using cargo check and migrate each warning to reduce the burden migrating to 0.13. Following is a list of the deprecation PRs and the justification for these changes.
- (#2791) The
Channel::is_nsfwmethod was wrong, useless, and served better byGuildChannel::nsfw - (#2794) These cache methods needed arcane borrow checker dances internally, and obscure the simplicity of the cache.
- (#2816)
Member::highest_role_infois now strictly less powerful than the newGuild::member_highest_roleand can avoid a cache lookup if used correctly. - (#2825)
-
Guild::is_largeis less accurate thanGuild::large
-
Message::is_ownis super simple to implement yourself
-
Message::is_privatesimply checks ifMessage::guild_idisnone.
- (#2838)
Event::PresencesReplacedoes not exist, and is a relic from when serenity supported user accounts. - (#2861)
TeamMember::permissionsis always["*"], so is useless.
Other notable changes
- (#2790) Added
CreateMessage::enforce_nonce, to prevent sending duplicate messages. - (#2801) Added
EditProfile::banner, allowing banners to be set for bots. - (#2810) Added
ChannelId::get_thread_member. - (#2812) Added
Guild::partial_member_permissions_in, which can be used to avoid fetching aMemberin message events just to check permissions. - (#2819) Added
From<User>forCreateEmbedAuthor, setting the author name and icon to theUser's info. - (#2813) Added
UserId::direct_message, so you don't need a fullUserto direct message. - (#2834) Added
Http::default_allowed_mentionsto set theAllowedMentionsto be used with every request. - (#2830) Added
Guild(Id)::bulk_ban, allowing bulk banning without hitting rate limits. - (#2836) Added support for Message Polls, including reading and sending them.
- (#2807) Added support for User Apps, alllowing user-installable application commands.
- (#2882) Added support for super reactions.
- Many documentation fixes and other optimisations to improve memory and CPU usage.
v0.12.1
Thanks to the following for their contributions:
- [@arqunis]
- [@GnomedDev]
- [@jamesbt365]
- [@kangalio]
- [@logand22]
- [@mkrasnitski]
- [@SenseiHiraku]
- [@vaporoxx]
- [@vidhanio]
- [@Xaeroxe]
- [@yanorei32]
Notable changes
In this release, the standard framework has been deprecated (#2733).
As Discord continues to endorse and evolve application commands (/...
commands, user commands, message commands, etc.), the standard framework
becomes increasingly outdated. Bots are also steadily losing (and already have
lost) access to contents of messages, making it difficult to build a
prefix-only bot. Unless you plan on restricting your bot to only accept
commands in DMs, allowing its presence in only fewer than 100 guilds, or
presenting a reasonable justification to Discord for permission to continue
using message contents, you should migrate to application commands. We
recommend poise, which supports writing
both prefix and application commands with a #[command] macro like the
standard framework.
Why not just update the framework?
Poise already exists and is better than the standard framework. Efforts should be directed at improving poise instead. To support application commands would require an overhaul of the standard framework, as they are special (for instance, Discord parses arguments on behalf of the bot and passes them as structured data, whereas for prefix commands, the bot must parse by itself).
Smaller, but still notable changes
- (#2621) Add a temporary cache for messages.
- (#2649) Deprecate
RoleId::to_role_cached- UseGuild::rolesinstead. - (#2726) Pack bitflags - Reduces alignments of
bitflags!types, resulting in a smaller memory footprint. - (#2696) Support attachments in forum posts.
- (#2560) Add support for monetization APIs.
- (#2648) Deprecate inefficient Emoji helpers - Use the emoji methods on
GuildId/Guildinstead.
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
AttachmentTypeenum has been replaced with aCreateAttachmentbuilder struct. This struct has thefile,path, andurlconstructors that eagerly evaluate the data passed to them -CreateAttachmentsimply stores the resulting raw data. This is in contrast toAttachmentTypewhich lazily carried filepaths/urls with it, and haddataandfilenamemethods for resolving them. Additionally, theCreateAttachment::to_base64method can be used to manually encode an attachment if needed. - A new
EditAttachmentsbuilder struct has been added for use with theattachmentsmethod on theEditMessage,EditWebhookMessage, andEditInteractionResponsebuilders. 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. EventCollectoris 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
RelatedIdandRelatedIdsForEventTypetypes 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_idEvent::guild_idEvent::channel_idEvent::message_idEventType::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
CacheReftype 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. CacheSettingshas 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
PrivateChannels (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_channelhas been renamed to justCache::channel. Additionally, some uses of theChannelenum in return types have been replaced with eitherGuildChannelorPrivateChannelas 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 |
AutocompleteInteractionhas been merged intoCommandInteraction, along with its corresponding methods.- The
kindfield has been removed from each of the interaction structs. - A
quick_modalmethod has been added toCommandInteractionandComponentInteraction. 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
dispatchmethod now takes aFullEventas argument instead of just aMessage. This enum contains all the data that is passed to theEventHandler. - An optional
initmethod 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
WsStreamtoWsClient. - The
ShardManagerMonitorandShardManagerMessagetypes have been removed. Their functionality has been replicated via methods directly onShardManager. Any fields with typeSender<ShardManagerMessage>, as well as theClient::shard_managerfield, have had their types changed toArc<ShardManager>. The new methods onShardManagerare the following:return_with_valueshutdown_finishedrestart_shardupdate_shard_latency_and_stage
- The
ShardClientMessageandInterMessageenums were deemed redundant wrappers aroundShardRunnerMessageand removed - users should useShardRunnerMessagedirectly instead. - The
ShardManagerErrortype 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_intervalto returnOption<Duration>instead ofOption<u64>. - Rename
Shard::check_heartbeattodo_heartbeat.
- Removed
ShardMessenger::newnow takes&ShardRunneras argument instead ofSender<ShardRunnerMessage>.- Removed the
ShardRunnerMessage::AddCollectorvariant in favor of theShardMessenger::add_collectormethod. This method adds the collectors immediately, whereasShardRunnerMessageis 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 thegatewayfeature instead of theclientfeature, 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_idparameter toHttp::{get,edit,delete}_webhook_message,Http::execute_webhook}, as well asWebhook::{get,delete}_message. - #2104, #2105 - Add an
audit_log_reasonparameter to manyHttpmethods and builder structs. - #2164 - Add
EventHandler::shards_readymethod. - #2186, #2201 - Add support for having a bot interactions endpoint URL.
- #2215 - Implement
Defaultfor many model types. - #2233 - Add
buttonandselect_menumethods to the following builders:CreateInteractionResponseMessageCreateInteractionResponseFollowupEditInteractionResponseCreateMessageEditMessageEditWebhookMessageExecuteWebhook
- #2247, #2357, #2385 - Add support for forum channels and creating forum posts using
ChannelId::create_forum_postandGuildChannel::create_forum_post. - #2257 - Add support for multiple event handlers by replacing the
event_handlerandraw_event_handlerfields with pluralizedevent_handlersandraw_event_handlersin the following structs:ShardManagerOptionsShardQueuerShardRunnerShardRunnerOptionsClientBuilder
- #2273, #2367 - Add events
ReactionRemoveEmojiandGuildAuditLogEntryCreate. - #2276 - Add support for automod regex patterns.
- #2297 - Add the
serenity::allmodule, which re-exports most public items in the crate. - #2336 - Add a
CreateButton::custom_idmethod. - #2369 - Add support for editing a guild's MFA level using
{GuildId, Guild, PartialGuild}::edit_mfa_level. - #2391 - Add attachments support to the
EditWebhookMessageendpoint by adding anew_attachmentsparameter toHttp::edit_webhook_message, as well as the following methods to theEditWebhookMessagebuilder:attachmentadd_existing_attachmentremove_existing_attachment
- #2415, #2461 - Add support for Discord's new usernames by adding the
User::global_namefield, and by making discriminators on usernames optional and non-zero. In particular, thePresenceUser::discriminatorandUser::discriminatorfields are now of typeOption<NonZeroU16>. - #2487 - Add support for the Get Current User Guild Member endpoint with the
{GuildId,Guild,PartialGuild}::current_user_membermethod. - #2503 - Add support for setting custom activity statuses.
- #2520 - Add the
User::static_facemethod, mirroringUser::face. - #2535 - Add pagination support to the Get Guild Bans endpoint.
- #2565 - Add support for the
VOICE_CHANNEL_STATUS_UPDATEgateway event. - #2576 - Add a
GuildId::everyone_rolemethod. - #2588 - Add audit log events for creator monetization.
- #2595 - Add the
CREATE_EVENTSandCREATE_GUILD_EXPRESSIONSpermissions, and renameMANAGE_EMOJIS_AND_STICKERStoMANAGE_GUILD_EXPRESSIONS(the old name is still present but deprecated). - #2600 - Add the
FormattedTimestamputility 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
HashtoTimestamp's derive list. - #2592 - Add experimental
typesizesupport. - #2618 - Implement
From<Into<String>>forAutocompleteChoice.
Changed
- #1896 -
Request::body_refnow returnsOption<&T>instead of&Option<&T>. - #1897, #2350 -
Typing::stopnow returnsboolinstead ofOption<()>. Also,Typing::startand any wrapper methods are now infallible. - #1922, #1940, #2090 - The following methods are no longer
async:ChannelId::nameContext::*Guild::{members_starting_with, members_containing, members_username_containing, members_nick_containing}Guild::default_channelPartialGuild::greater_member_hierarchyShardManager::newUserId::to_user_cached
- #1929 - Unbox the
Error::Httpvariant. - #1934 - Change
Guild::memberto returnCow<'_, Member>instead of justMember. - #1937 - Change all fields of
ShardManagerOptionsto be owned (Arcis cheap to clone). - #1947 - Change methods related to pruning to take and return
u8. - #1963 - Change
RequestBuilder::bodyfromOption<&[u8]>toOption<Vec<u8>>. - #1976 - Make
MessageInteractionnon-exhaustive, and add amemberfield. - #1977 - Rename
Permissions::USE_SLASH_COMMANDStoUSE_APPLICATION_COMMANDS. - #1980 - Rename
constants::OpCodetoOpcode, and the same forvoice_model::OpCode. - #1984 - Introduce
ShardInfofor tracking Shard ids, and change ids fromu64tou32. - #1990 - Change the
Message::noncefield to a customNonceenum instead of aserde_json::Value. - #1999 - Make
MembershipState,ScheduledEventStatus, andScheduledEventTypenon-exhaustive. - #2005 - Change
MessageActivityKindvariants to use CamelCase instead of ALL_CAPS. - #2007, #2018 - Rework presence setting and storing as follows:
- Replace
CurrentPresencewith aPresenceDatastruct. - Use
ActivityDatain place ofActivityfor setting the current presence. - Change the various
set_activitymethods 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 optionalpresenceparameter toShard::new.
- Replace
- #2008 - Unknown values for enum variants are now preserved for debugging purposes. Any
Unknownvariants on enums are now changed toUnknown(u8). Also, thenummethod for those enums is removed; users should callu8::frominstead. - #2017 - Change
Member::editto edit in place, and returnResult<()>instead ofResult<Member>. - #2023, #2170, #2459 - Use Id types everywhere instead of
u32,u64, orNonZeroU64. - #2030 - Change
{GuildId, Guild, PartialGuild}::deleteto returnResult<()>. - #2032 - Replace
impl From<String> for Timestampwithimpl TryFrom<&str>. - #2047 - The following functions are now
const:LightMethod::reqwest_methodRatelimit::{limit, remaining, reset, reset_after}RequestBuilder::newChannel::{id, position, name}Error::is_cache_errEvent::event_typeEventType::nameGatewayIntents::*Permissions::*
- #2052 - Change the
CommonFilterOptions::{filter_limit, collect_limit}fields fromu32toNonZeroU32. - #2054 - Change the
GuildChannel::message_countfield fromOption<u8>toOption<u32>. - #2073 - Move the
serenity::utils::colourmodule intoserenity::model. - #2127 - Replace
CreateAllowedMentions::parsewithall_users,all_roles, andeveryonemethods. - #2139 - Change
ChannelId::nameto returnResult<String>instead ofOption<String>. - #2144 - Don't offer different function signatures for
EventHandlermethods if thecachefeature 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
FutureforClientBuilderwithIntoFuture. - #2173 - Make
ClientBuilder::{get_token, get_type_map, get_cache_settings}infallible. - #2194 - Change
CacheUpdate::OutputforChannelDeleteEventfrom()toVec<Message>. - #2205 - Wrap the following large model fields in
Box:CommandInteraction::memberComponentInteraction::messageModalInteraction::messageMessage::memberMessage::interaction
- #2224 - Introduce
CreateSelectMenuKindandComponentInteractionDataKindenums to better enforce well-formation of requests. - #2244 - Flatten the
httpmodule by re-exporting all types found in submodules at the top level and removinng access to the submodules themselves. - #2277 - Make
ErrorResponsenon-exhaustive, change theurlfield fromUrltoString, and add amethodfield. - #2285 - Wrap the
Http::ratelimiterfield inOption, and remove the correspondingratelimiter_disabledfield. - #2285 - Add an optional
reasonparameter toHttp::{ban, kick}, and removeHttp::{ban,kick}_with_reason. - #2288 - Merge the
RouteandRouteInfoenums, and addmethodandparamsfields to theRequeststruct. - #2310 - Flatten the
model::applicationmodule in the same way thehttpmodule was flattened. - #2327 - Change the
ThreadMembersUpdateEvent::member_countfield fromu8toi16. - #2393 - Change the following field and enum variant types:
GuildUpdateEvent::guildfromPartialGuildtoGuildReaction::memberfromOption<PartialMember>toMemberIntegration::guild_idfromGuildIdtoOption<GuildId>IncidentUpdate::statusfromIncidentStatustoString(IncidentStatusis also removed){Guild,PartialGuild}::premium_subscription_countfromu64toOption<u64>InputText::valuefromStringtoOption<String>CurrentApplicationInfo::ownerfromUsertoOption<User>ScheduledEventMetadata::locationfromStringtoOption<String>Trigger::KeywordPresetfrom a tuple variant to a struct variant
- #2393 - Rename the following field and enum variants:
Incident::short_linktoshortlinkThreadDeleteEvent::channels_idtochannel_idsThreadMembersUpdateEvent::removed_members_idstoremoved_member_idsInviteTargetType::EmmbeddedApplicationtoEmbeddedApplicationScope::RelactionshipsReadtoRelationshipsRead
- #2393, #2418 - Change
CurrentUserto be a newtype aroundUser, implement theDereftrait, and remove theguilds,invite_url, andinvite_url_with_oauth2_scopesmethods. The only method now unique toCurrentUserisedit. All other methods are available to call via deref coercion. - #2397 - Make the following
modeltypes 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::OutputforChannelUpdateEventfrom()toChannel. Also, make{Guild,PartialGuild}::user_permissions_ininfallible and changeError::InvalidPermissionsinto a struct variant containing both the therequiredpermissions as well as thepresentpermissions. - #2460 - Wrap secret tokens in
secrecy::SecretStringto prevent them being leaked throughDebugimplementations, and so that they are zeroed when dropped. - #2462, #2467, #2586 - Change image hashes from
Strings to a dedicatedImageHashtype 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_userfields are now counted using au16. - Channel
positionfields now hold au16. - Role
posititionfields now hold au16. - All
auto_archive_positionfields are now an enumAutoArchivePosition. - All
afk_timeoutfields are now an enumAfkTimeout. - Replace the
DefaultReactionstruct with aForumEmojienum. - The
Sticker::sort_valuefield is now anOption<u16>. - The
min_valuesandmax_valuesfields for Select Menus now hold au8. - The
max_ageinvite field now holds au32. - The
max_usesinvite field now holds au8. - The
ActivityPartycurrent and maximum size are now of typeu32. - The
Ready::versionfield is now au8. - The
min_lengthandmax_lengthfields for Input Text components now hold au16. - The
mention_total_limitfield for automod triggers now holds au8. - The
RoleSubscriptionData::total_months_subscribedfield is now au16.
- All
- #2470 - Rename
{Http,ChannelId,GuildChannel}::create_public_threadtocreate_thread_from_message, and similarly renamecreate_private_threadtocreate_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
ThreadDeleteevent now provides the fullGuildChannelobject for the deleted thread if it is present in the cache. - #2553 - The
ThreadUpdateevent now provides the old thread'sGuildChannelobject if it is present in the cache. - #2554 - The
Webhook::source_guildandWebhook::source_channelfields 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 intoPartialGuilds orChannels by querying the API. - #2569 - Replaced the
json::preludemodule with public wrapper functions that abstract over bothserde_jsonandsimd-json. - #2593 - Rename
GatewayIntents::GUILD_BANStoGUILD_MODERATION(the old name is still present but is deprecated). - #2598 - Change
CreateInteractionResponseMessage::flagsto takeInteractionResponseFlagsinstead ofMessageFlags. - #2609 - Split parts of
ThreadMemberintoPartialThreadMember. - #2622 - Implement role addition/removal using dedicated endpoints.
- #2623 - Use dedicated types for
GuildId::audit_logs. - #2625 - Change
Guild::members_with_statusto 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::Categoryvariant, asGuildChannel::kindcan already beChannelType::Category. However, theChannel::categorymethod is still available. - #2161 - Remove the
Mention::Emojivariant. - #2162 - Remove
serenity::token::parse- usetoken::validateinstead. - #2246 - Remove the
absolute_ratelimitsfeature and replace it with a runtime configuration option. - #2308 - Remove
CacheAndHttp, and inline it as separatecacheandhttpfields in the following structs:ShardManagerOptionsShardQueuerShardRunnerShardRunnerOptionsClient
- #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_idResumedEvent::channel_idReady::{presences, private_channels, trace}InviteGuild::{text_channel_count, voice_channel_count}VoiceState::tokenIncidentUpdate::affected_components(and also theAffectedComponentstruct)Maintenance::{description, stop, start}SelectMenu::valuesMessageUpdateEvent::{author, timestamp, nonce, kind, stickers}PartialGuild::{owner, permissions}InviteTargetType::NormalTrigger::HarmfulLink
- #2424 - Remove the
FromStrAndCacheandStrExttraits. Also removesmodel::{ChannelParseError,RoleParseError}, which conflicted with types of the same name fromutils. - #2429 - Remove the useless re-exports of the various submodules of
modelfrom themodel::prelude, and don't re-export types from other libraries, likeDeserializeorHashMap. - #2466 - Remove the
DefaultAvatarenum. - #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
EventTypeenum. Instead ofEvent::event_type().name(), users should just callEvent::name. - #2578 - Remove the
PingInteraction::guild_localefield.
v0.11.7
Thanks to the following for their contributions:
- [@arqunis]
- [@B-2U]
- [@Collin-Swish]
- [@caoculus]
- [@Dean-Coakley]
- [@HexPandaa]
- [[@&
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.