2023-09-10 Updates

We've published minor versions of a number of crates. Most of these are related to support for new Discord API features, but a lot of bugfixes are included as well. We are also increasing our MSRV.

Bugfixes

twilight-gateway will no longer swallow messages when an I/O error is encountered during the reply to the message. It further will no longer attempt to send commands before a resume has been sent upon reconnecting and also attempt to resume any pending identify request.

UpdateFollowup's body type has been corrected to a Message instead of an empty body.

The validation of CommandOptions and the scheduled event get users limit in twilight-validate was incorrect and has been adjusted.

Using GetInvite's with_counts and with_expiration methods resulted in incorrect query strings being generated, this has been fixed.

Deprecations

ConfigBuilder::with_config has been deprecated in favor of a From<Config> implementation on ConfigBuilder.

Documentation Improvements

An accidental half-sentence in Client::delete_messages' documentation was removed.

Broken intra-doc links in choice_name were fixed.

twilight-http's Client::guild_members documentation was not setting the member limit mentioned in the documentation, it now matches the description.

Feature Additions

Discord's new username system is now supported and User::global_name has been added.

Guild onboarding is now supported and respective models and routes have been added to twilight-model and twilight-http: Client::guild_onboarding and GetGuildOnboarding in twilight-http; Onboarding, OnboardingPrompt, OnboardingPromptEmoji, OnboardingPromptOption, OnboardingPromptType, OnboardingPromptMarker and OnboardingPromptOptionMarker in twilight-model.

Join raid and mention raid protection are now supported in twilight-model and twilight-cache-in-memory. Guild::safety_alerts_channel_id, AutoModerationTriggerMetadata::mention_raid_protection_enabled and GuildFeature::RaidAlertsDisabled were added.

The Role::flags field is now supported and the RoleFlags enum has been added.

The Attachment::flags field is now supported and the AttachmentFlags enum has been added.

AuditLogOptionalEntryInfo has a new field, integration_type, for the type of integration that performed the action. The missing GuildIntegrationType::GuildSubscription variant has been added.

The GatewayReaction::message_author_id field which is included in ReactionAdd events was added.

The USE_EXTERNAL_SOUNDS permission is now supported.

AuditLogEventType was extended to include the monetization event types, CreatorMonetizationRequestCreated and CreatorMonetizationTermsAccepted.

It is now possible to set a default forum layout during channel creation via CreateGuildChannel::default_forum_layout.

The ThreadMemberUpdate event now includes the guild_id.

Event::guild_id has been extended to return more events' guild ID.

The twilight-model internal IdVisitor now implements visit_i64, allowing deserialization of Id types from integers using simd-json.

twilight-model no longer depends on tracing.

MSRV

All twilight ecosystem crates now target a MSRV of rustc 1.67. This was necessary due to MSRV increases in our dependencies.

Performance Improvements

The gateway ratelimiter now re-uses its cleanup instant, thus removing a syscall.