Changelog¶
This page keeps a detailed human friendly rendering of what’s new and changed in specific versions. Please see Version Guarantees for more information.
v2.12.0a50+g0d5fef7 [UNRELEASED]¶
Breaking Changes¶
Emoji.guild_idcan now beNoneif the emoji is owned by an application. You can useEmoji.is_guild_emoji()andEmoji.is_app_emoji()to check if this is a Guild or App Emoji. (#1223)SKU.subscriptions()mistakenly returned a coroutine, unlike other iterator methods. Instead ofasync for x in await sku.subscriptions():, correct usage now isasync for x in sku.subscriptions():. (#1274)Drop support for Python 3.8 as it reached end of life in October 2024 and no longer receives security updates. (#1394)
Drop support for Python 3.9 as it reached end of life in October 2025 and no longer receives security updates. (#1427)
New Features¶
- Add support to
Emojito represent application-owned emojis. (#1223, #1388, #1397) New methods on
Client:Client.fetch_application_emoji(),Client.fetch_application_emojis()andClient.create_application_emoji().New attributes/methods on
Emoji:Emoji.application_id,Emoji.is_guild_emoji()andEmoji.is_app_emoji().
- Add support to
Add support for modifying application info using
AppInfo.edit(). (#1237)Add
ui.FileUploadcomponent for use within modals. (#1390)Improve error messaging when a command parameter’s annotation cannot be resolved at runtime. (#1411)
Add new
MessageCallobject and associatedMessage.callattribute for viewing information about a call in private channels. (#1414)[ext.commands] Add
Context.app_permissionsandContext.permissionsas a shorthands synonymous withInteraction.app_permissionsandInteraction.permissions. (#1429)
Bug Fixes¶
Change
SKU.subscriptions()to be a synchronous method (returning an async iterator), to match other iterator methods. (#1274)Add a
__repr__method toInstallTypeConfiguration. (#1398)AllowedMentionsnow takes a Sequence rather than a List for users and roles in order to support covariance. (#1410)
Documentation¶
Update all references to
UnionandOptionalin the documentation to use PEP 604 syntax (X | YandX | Nonerespectively). (#1395)Update references to
Dictand other collections in the documentation to use built-in PEP 585 syntax (dict,list,set, etc.) instead of thetypingcounterparts (Dict,List,Set, etc.). (#1395)Update version resolution in
docs/conf.pyto useimportlib.metadatainstead of regex. (#1446)
Miscellaneous¶
Migrate away from pdm and replace with
uvandnox. See CONTRIBUTING.md for additional information. (#1362)Update minimum required setuptools version to
>=77.0.3. (#1366)Remove upper bound on audioop-lts version and allow v0.2.x. (#1378)
Update all standard library types to use built-in generics (such as
list[int]instead ofList[int]) where applicable. (#1396)
v2.11.0¶
This version adds the new v2 components to create fully component-driven messages, select menus in modals, support for setting a guild-specific avatar/banner/bio, user nameplates and tags, new message pin endpoints (now with up to 250 pins!), and includes many other improvements and several bugfixes.
Deprecations¶
InteractionResponse.require_premium()is deprecated in favour of premium buttons (seeui.Button.sku_id). (#1276)Deprecate
with_expirationquery parameter ofClient.fetch_invite()as it is no longer supported from the discord API. (#1296)Deprecate awaiting
Messageable.pins()in favour ofasync for msg in channel.pins(). (#1305)- Using
ActionRows (or plainTextInputs, which implicitly get wrapped in action rows) in modals is now deprecated in favor ofui.Label. (#1321) This deprecates
ui.ActionRow.add_text_input(),ui.ActionRow.with_modal_components().Using
TextInput.labelis also deprecated in favor ofLabel("<text>", TextInput(...)).
- Using
New Features¶
- Add support for guild incident actions. (#1230)
Add
IncidentsDataandGuild.incidents_dataattribute.New
invites_disabled_untilanddms_disabled_untilparameters forGuild.edit().
[ext.commands] Allow passing autocompleters that take a
Cogas first argument toParam. (#1269)Support premium buttons using
ui.Button.sku_id. (#1276)- Add support for components v2 (example): (#1294)
These components allow you to have more control over the layout of your messages, and are used instead of the classic
contentandembedsfields.- New top-level components:
ui.Section: Displays an accessory (ui.Thumbnailorui.Button) alongside some text.ui.TextDisplay: Text component, similar to thecontentfield of messages.ui.MediaGallery: A gallery/mosaic of up to 10MediaGalleryItems.ui.File: Display an uploaded file as an attachment.ui.Separator: A spacer/separator adding vertical padding.ui.Container: Contains other components, visually similar toEmbeds.Each component has a corresponding new
ComponentType.
New
MessageFlags.is_components_v2flag. This is set automatically when sending v2 components, and cannot be reverted once set.New
ui.walk_components()andui.components_from_message()utility functions.All
ui.*components now inherit from a commonui.UIComponentbase class.Components now have an
idattribute, which is a unique (per-message) optional numeric identifier.
Add
NameplateandCollectiblesclasses, as well asUser.collectiblesandClientUser.collectiblesattributes. (#1302)Update the
Messageable.pins(),Message.pin()andMessage.unpin()methods to use the new API endpoints.Messageable.pins()returns now an asynchronous iterator to yield all pinned messages. (#1305)Add the new
Activity.details_url,Activity.state_url,Activity.status_display_typeandStatusDisplayTypeRPC attributes and enum. (#1307)Add
flagsparameter toWebhook.edit_message(),WebhookMessage.edit(), andInteractionResponse.edit_message(). (#1310)Add
Role.primary_colour(),Role.secondary_colour(),Role.tertiary_colour(),Colour.holographic_style(), and aliases, as well asprimary_colour,secondary_colour,tertiary_colourarguments, and aliases, toRole.edit()andGuild.create_role(). (#1311)Add the
pin_messagespermission. (#1313)Add
MemberFlags.automod_quarantined_guild_tag()member flag. (#1315)Add
AuditLogAction.automod_quarantine_useraction type. (#1317)- Add support for new components in
Modals. (#1321, #1361) The new top-level
ui.Labelcomponent wraps other components (currentlyTextInputand select menus) in a modal with a label and description.ui.TextDisplaycan now be used as a top-level component in modals.ui.StringSelectand auto-populated select menus such asui.UserSelectare now usable in modals when placed inside aui.Label.The new modal-specific
requiredfield can be used to make a select menu optional.The values provided by users on modal submit are available in
ModalInteraction.resolved_values(raw values inModalInteraction.resolved_values).
- Add support for new components in
Add
PrimaryGuildandUser.primary_guild(). (#1333)Add preliminary support for Python 3.14. (#1337)
Support setting a guild-specific nickname, avatar, and banner using
Member.edit(). (#1364)Implement missing fields on
AppInfo:event_webhooks_url,event_webhooks_status,event_webhooks_types,redirect_uris. (#1369)- Added support for emoji added system messages. (#1370)
New message type
MessageType.emoji_addedNew system channel flag attr
SystemChannelFlags.emoji_added_notifications
Bug Fixes¶
Prevent
DeprecationWarningrelated toMessage.interactionfield on shard reconnect. (#1267)Fix missing/faulty
Subscription-related gateway events. (#1275)[ext.commands] Fix extracting localization key for
sub_command_group()s from docstring, to be more consistent with top-level slash commands and sub commands. (#1285)Improve checks for partial
Guilds in guild-dependent attributes of channels and threads, which could previously raise errors with user-installed apps, as they don’t always receive complete guild data. (#1287)[ext.tasks] Correctly handle
Loop.change_intervalwhen called frombefore_loop()or through other means before initial loop run. (#1290)Avoid stripping port from voice websocket endpoints. (#1301)
Properly support aiohttp 3.11 without deprecation warnings. (#1324)
Depend on typing_extensions explicitly, rather than through aiohttp. (#1328)
Fix
Guild.fetch_members()andTextChannel.archived_threads()iterators returning more elements than specified bylimitunder certain circumstances. (#1331)Fix missing
avatar_decorationon the oldMemberinon_member_update()events. (#1350)
Documentation¶
Update required permissions for
Guild.invites()and in the invite attribute table. (#1348)
Miscellaneous¶
[ext.commands] Add typing annotations to
HelpCommandand related types. (#828)Add the first 25 characters of
Message.contentto the repr ofMessage. (#884)Decrease the default
Guild.filesize_limitfrom 25MB to 10MB. (#1272)Update internal package management tooling to latest versions, speed up CI by caching dependency metadata. (#1278)
Remove bad example code snippet that can cause bugs using yt_dlp lib. (#1304)
Bump ruff to 0.12.11. (#1326)
Bump pytest and the rest of the test suite to the latest supported versions on Python 3.8. (#1327)
Add more typing to most modules, increasing type completeness. (#1329)
Migrate determining which packages to include in the built wheel and package from a static setup.py list to dynamic configured in pyproject.toml. (#1356)
Rework the
nox -s coveragesession to allow providing arguments directly to coverage.py. (#1359)
v2.10.2¶
This is a maintenance release with several bugfixes.
Bug Fixes¶
Fix missing/faulty
Subscription-related gateway events. (#1275)[ext.commands] Fix extracting localization key for
sub_command_group()s from docstring, to be more consistent with top-level slash commands and sub commands. (#1285)Improve checks for partial
Guilds in guild-dependent attributes of channels and threads, which could previously raise errors with user-installed apps, as they don’t always receive complete guild data. (#1287)[ext.tasks] Correctly handle
Loop.change_intervalwhen called frombefore_loop()or through other means before initial loop run. (#1290)Avoid stripping port from voice websocket endpoints. (#1301)
Properly support aiohttp 3.11 without deprecation warnings. (#1324)
Miscellaneous¶
Decrease the default
Guild.filesize_limitfrom 25MB to 10MB. (#1272)Remove bad example code snippet that can cause bugs using yt_dlp lib. (#1304)
v2.10.1¶
Bug Fixes¶
Prevent
DeprecationWarningrelated toMessage.interactionfield on shard reconnect. (#1267)
v2.10.0¶
This release comes with support for user apps (see Installation/Interaction Contexts), polls, message forwarding,
avatar decorations, media channels, soundboards, subscriptions/monetization,
proper support for Python 3.12 and 3.13 functionality (such as 3.12’s new type statement),
and lots of smaller features, improvements, and other bugfixes.
See below for a complete list of changes.
Deprecations¶
Client.fetch_premium_sticker_packs()was renamed toClient.fetch_sticker_packs(); the old name is deprecated. (#1082)Deprecate
Message.interactionattribute andInteractionReference. UseMessage.interaction_metadatainstead. (#1173)Deprecate
ApplicationCommand.dm_permissionand related fields/parameters of application command objects. Usecontextsinstead. (#1173)
New Features¶
Support activity assets with
mp:prefix inActivity.large_image_urlandActivity.small_image_url, now returning the correct url. (#687)Move asset properties from
Activityto all activity types:large_image_url,small_image_url,large_image_text,small_image_text. (#687)[ext.commands] Skip evaluating annotations of
self(if present) andctxparameters in prefix commands. These may now use stringified annotations with types that aren’t available at runtime. (#847)Add
guild_scheduled_eventparameter toStageChannel.create_instance(). (#882)- Add support for avatar decorations using: (#889)
Added
with_countsparameter toClient.fetch_guild()andClient.fetch_guilds(), used to determine whether to include the guild’s member count and presence information. (#892)Move the event listener system implementation from
ext.commands.BottoClient, making Clients able to have more than one listener per event type. (#975)- Support voice channel effect events. (#993)
New events:
on_voice_channel_effect(),on_raw_voice_channel_effect().New types:
VoiceChannelEffect,RawVoiceChannelEffectEvent.New enum:
VoiceChannelEffectAnimationType.
Interactions now always have a properchannelattribute, even when the bot is not part of the guild or cannot access the channel due to other reasons. (#1012)Add
delete_afterparameter toInteraction.edit_original_response(),InteractionResponse.edit_message()andInteractionMessage.edit(). (#1014)Make
Interactionand subtypes accept the bot type as a generic parameter to denote the type returned by thebotandclientproperties. (#1036, #1121)[ext.commands] Implement
app_check()andapp_check_any()decorators. (#1045)[ext.commands] Log errors raised by
ext.commands.Cog.cog_unload(). (#1046)- Add support for media channels. (#1050)
- Add
MediaChannel. Unless otherwise noted, media channels behave just like forum channels.
- Add
Add
ChannelType.media.Add
CategoryChannel.create_media_channel,Guild.create_media_channel.
Rename
Intents.emojis_and_stickerstoIntents.expressions. An alias is provided for backwards compatibility. (#1068)- Implement soundboard features. (#1068)
Sound models:
PartialSoundboardSound,SoundboardSound,GuildSoundboardSound- Managing sounds:
Get soundboard sounds using
Guild.soundboard_sounds,Client.get_soundboard_sound, or fetch them usingGuild.fetch_soundboard_sound(),Guild.fetch_soundboard_sounds(), orClient.fetch_default_soundboard_sounds()New sounds can be created with
Guild.create_soundboard_sound()Handle guild soundboard sound updates using the
guild_soundboard_sounds_updateevent
Send sounds using
VoiceChannel.send_soundboard_sound()New attributes:
Guild.soundboard_limit,VoiceChannelEffect.sound,Client.soundboard_soundsNew audit log actions:
AuditLogAction.soundboard_sound_create,soundboard_sound_update,soundboard_sound_delete
Add
RoleFlagstype andRole.flags. (#1069)Add
AttachmentFlagstype andAttachment.flags. (#1073)Add support for threads in
Webhook.fetch_message(),edit_message(), anddelete_message(), as well as their sync counterparts. (#1077)Add
default_layoutparameter toGuild.create_forum_channel()andForumChannel.clone(). (#1078)Add
AuditLogActionvalues related to creator monetization. (#1080)Add
applied_tagsparameter toWebhook.send(). (#1085)Make
CustomActivity.statefall back to the providedname, simplifying setting a custom status. (#1087)Add
Permissions.create_guild_expressionsandPermissions.create_events. (#1091)Add
TeamMember.role. (#1094)[ext.commands] Update
Bot.is_ownerto take team member roles into account. (#1094)Add
created_atproperty toAutoModRule,ForumTag,Integration,StageInstance, andTeam. (#1095)Support
integration_typefield inAuditLogEntry.extra(forkickandmember_role_updateactions). (#1096)Add new
Colours:light_embed()anddark_embed(). (#1102)- Support application subscriptions and one-time purchases (see the official docs for more info). (#1113, #1186, #1249, #1257)
New types:
SKU,Entitlement,Subscription.New
Interaction.entitlementsattribute, andInteractionResponse.require_premium()response type.New events:
on_entitlement_create(),on_entitlement_update(),on_entitlement_delete(),on_subscription_create(),on_subscription_update()andon_subscription_delete().New
Clientmethods:skus(),entitlements(),fetch_entitlement(),create_entitlement().
Add
SelectDefaultValue, and adddefault_valuesto all auto-populated select menu types. (#1115)[ext.commands] Support Python 3.12’s
typestatement andtyping.TypeAliasTypeannotations in command signatures. (#1128)Add
Invite.type. (#1142)Add
Locale.es_LATAMlocale. (#1148)Make typing more precise for
Client.create_global_command(),Client.edit_global_command(),Client.create_guild_command()andClient.edit_guild_command(). (#1151)Add raw equivalent of
on_presence_update()-on_raw_presence_update(). (#1152)InteractionReference.usercan now be aMemberin guild contexts. (#1160)Add
bannerparameter toClientUser.edit(). (#1165)- Add support for user-installed commands. See Installation/Interaction Contexts for further details. (#1173, #1261)
Add
ApplicationCommand.install_typesandApplicationCommand.contextsfields, with respectiveApplicationInstallTypesandInteractionContextTypesflag types.Interactionchanges:Add
Interaction.contextfield, reflecting the context in which the interaction occurred.Add
Interaction.authorizing_integration_ownersfield andAuthorizingIntegrationOwnersclass, containing details about the application installation.Interaction.app_permissionsis now always provided by Discord.
Add
Message.interaction_metadataandInteractionMetadatatype, containing metadata for the interaction associated with a message.Add
integration_typeparameter toutils.oauth_url().Add
AppInfo.guild_install_type_configandAppInfo.user_install_type_configfields.[ext.commands] Add
install_typesandcontextsparameters to application command decorators.[ext.commands] Add
install_types()andcontexts()decorators.[ext.commands] Using the
GuildCommandInteractionannotation now setsinstall_typesandcontexts, instead ofdm_permission.[ext.commands] Add
default_install_typesanddefault_contextsparameters toBot.
Support banning multiple users at once using
Guild.bulk_ban(). (#1174)- Add the new poll discord API feature. This includes the following new classes and events: (#1175)
New types:
Poll,PollAnswer,PollMedia,RawPollVoteActionEventandPollLayoutType.Edited
abc.Messageable.send(),Webhook.send(),ext.commands.Context.send()anddisnake.InteractionResponse.send_message()to be able to send polls.Edited
Messageto store a newMessage.pollattribute for polls.Edited
Eventto contain the newon_poll_vote_add(),on_poll_vote_remove(),on_raw_poll_vote_add()andon_raw_poll_vote_remove().
Add the possibility to pass
disnake.Fileobjects toEmbed.set_author()andset_footer(). (#1184)Add support for message forwarding. New
ForwardedMessage, new enumMessageReferenceType, new methodMessage.forward(), editedMessageReferenceto support message forwarding. (#1187)The
clsparameter of UI component decorators (such asui.button()) now accepts any matching callable, in addition to item subclasses. (#1190)Implement new
Member.guild_bannerproperty. (#1203)Add
Permissions.use_external_apps, and a newPermissions.appscategory to match the Discord client UI. (#1211)Add new
poll_resultmessage type. (#1212)Add
Guild.fetch_voice_state()to fetch theVoiceStateof a member. (#1216)Add new
Attachment.titleattribute. (#1218)Add
AppInfo.approximate_guild_countandAppInfo.approximate_user_install_count. (#1220)Add new
Client.fetch_sticker_pack()method. (#1221)- For interactions in private channels,
Interaction.channelis now always a properDMChannelorGroupChannelobject, instead ofPartialMessageable. (#1233) This also applies to other channel objects in interactions, e.g. channel parameters in slash commands, or
ui.ChannelSelect.values.
- For interactions in private channels,
Add support for
BaseFlagsto allow comparison withflag_valuesand vice versa. (#1238)Implement
is_guest,started_home_actions,completed_home_actions,automod_quarantined_username,dm_settings_upsell_acknowledgednew member flags. (#1245)Implement the new
Guild.fetch_role()API method. (#1247)
Bug Fixes¶
Fix
ui.Modaltimeout issues with long-running callbacks, and multiple modals with the same user andcustom_id. (#914)[ext.commands] Fix incorrect typings of
InvokableApplicationCommand.add_check,InvokableApplicationCommand.remove_check,Bot.add_app_command_checkandBot.remove_app_command_check. (#1045)Update
Colour.dark_theme()to match Discord theme change. (#1102)Update
choicestype in app commands to accept anySequenceorMapping, instead of the more constrainedlist/dicttypes. (#1136)Support fetching invites with
nullchannel (e.g. friend invites). (#1142)Adjust type annotations to allow
Objectascategoryparameter inGuild.create_text_channel()and similar methods. (#1162)[ext.commands] Fix usage of
role-type cooldowns in threads, which incorrectly operated on a per-channel basis instead. (#1200)[ext.commands] Fix incorrect exception when using the
default_member_permissions()decorator on auser_command()while also using the cog-leveluser_command_attrsfield. (#1252)Escape forward slashes in HTTP route parameters. (#1264)
Documentation¶
Add inherited attributes to
TeamMember, and fixTeamMember.avatardocumentation. (#1094)Document the
Optionattributes, thedescriptionandoptionsproperties forext.commands.InvokableSlashCommandand thedescriptionandbodyproperties forext.commands.SubCommand. (#1112)Make all “Supported Operations” container elements collapsible. (#1126)
Miscellaneous¶
Update the
python -m disnake newcogtemplate to include all missing special methods. (#808)Overhaul and simplify contribution guide. (#1098)
[ext.commands] Rewrite slash command signature evaluation to use the same mechanism as prefix command signatures. This should not have an impact on user code, but streamlines future changes. (#1116)
Start testing with Python 3.12 in CI. (#1117)
Reduce the amount of unknown (unresolved) types in public-facing APIs. (#1167)
Remove
disnake[discord]extra; the shim is deprecated, and has not been updated for several versions. (#1196)Move enum member documentation into docstrings. (#1243)
Support Python 3.13. (#1263)
v2.9.3¶
This is a maintenance release with several minor bugfixes.
Notably, this includes support for a newer voice encryption mode;
all modes supported in previous versions are scheduled to be discontinued on 18th November 2024,
and voice connections using the builtin VoiceClient will fail to connect.
New Features¶
Add support for
aead_xchacha20_poly1305_rtpsizeencryption mode for voice connections, and remove deprecatedxsalsa20_poly1305*modes. (#1228)
Bug Fixes¶
Attempt to handle abrupt websocket closures on
aiohttp >= 3.9.0andpython < 3.11.0gracefully. (#1241)
Documentation¶
Adding some clarifying documentation around the type of
AuditLogEntry.extrawhen the action isoverwrite_create. (#1180)
Miscellaneous¶
Raise PyNaCl version requirement to
v1.5.0. (#1228)
v2.9.2¶
Bug Fixes¶
[ext.commands] Fix erroneous
LocalizationWarnings when using localized slash command parameters in cogs. (#1133)Handle unexpected
RECONNECTopcode whereHELLOis expected during initial shard connection. (#1155)Reconnect gateway websocket on protocol errors. (#1159)
Avoid
AttributeErrorinFFmpegAudiowhen cleaning up after failing to spawn ffmpeg process. (#1164)Fix base URL for stickers with
StickerFormatType.gif. (#1189)
Documentation¶
Adding some clarifying documentation around the executable parameters of audio classes based off of internal discussions. (#1158)
Miscellaneous¶
Add
StandardStickertostickersparameter type annotation ofMessageable.send()andForumChannel.create_thread(). (#1134)
v2.9.1¶
Bug Fixes¶
Allow
clsargument in select menu decorators (e.g.ui.string_select()) to be specified by keyword instead of being positional-only. (#1111)[ext.commands] Fix edge case in evaluation of multiple identical annotations with forwardrefs in a single signature. (#1120)
Fix
Thread.permissions_for()not working in some cases due to an incorrect import. (#1123)
Documentation¶
Miscellaneous grammar/typo fixes for Audit Logs. (#1105)
v2.9.0¶
This release comes with support for the new username system, text in stage, role subscriptions, silent messages, and onboarding. The documentation has been updated, splitting the monolithic API Reference page into smaller pages.
See below for a complete list of changes.
Deprecations¶
AutoModTriggerType.harmful_linkis obsolete, it is now enabled Discord-wide. (#986)The
PartyTypeenum is deprecated, as voice activity IDs are not officially documented and the enum regularly becomes outdated. (#1035)[ext.commands]
RangeandStringnow require a type argument (i.e.Range[int, 1, 5]instead ofRange[1, 5], similarly withString[str, 2, 4]). The old form is deprecated. (#991)[ext.commands] The mypy plugin is now a no-op. It was previously used for supporting
Range[]andString[]annotations. (#991)
New Features¶
Clone most attributes in
TextChannel.clone(),VoiceChannel.clone(),StageChannel.clone(),CategoryChannel.clone(), andForumChannel.clone(), and add them as keyword-only parameters to make in-place edits. See the specificclonemethod’s documentation for details. (#635)Implement new
AutoModTriggerMetadata.mention_raid_protection_enabledparameter. (#898)- Add support for raid alerts. (#899)
Add
raid_alerts_disabledandsafety_alerts_channelparameters toGuild.edit().
- Add features related to role subscriptions. (#904, #913)
New message type:
role_subscription_purchase.New role tags:
RoleTags.subscription_listing_id,RoleTags.is_available_for_purchase, andRoleTags.is_subscription.New type
RoleSubscriptionDataand attributeMessage.role_subscription_data.New system channel flags:
role_subscription_purchase_notificationsandrole_subscription_purchase_notification_replies.
Add
oldest_firstparameter toGuild.audit_logs(). (#919)- Implement Onboarding. (#928)
Add
Onboarding,OnboardingPromptandOnboardingPromptOption.Add
Guild.onboarding().
Add
flagsparameter to message send and edit methods. (#929)- Messages can now be sent within
StageChannelinstances. (#942) StageChannelnow inherits fromabc.Messageable- New
StageChannelproperties:
- New
- New
StageChannelmethods: .is_nsfw,.get_partial_message,.delete_messages,.purge,.webhooks,.create_webhook
- New
Add
nsfwandslowmode_delayparameters toGuild.create_stage_channel()andCategoryChannel.create_stage_channel()Add
nsfwandslowmode_delayparameters toStageChannel.edit()Add text related permission support to
StageChannel.permissions_for().
- Messages can now be sent within
- New message types that are sent within
StageChannelinstances: (#942)
- New message types that are sent within
Add edit support for
user_limittoStageChannel.edit(). (#942)Add support for setting
user_limitandvideo_quality_modewhen creating aStageChannelwithGuild.create_stage_channel(). (#942)- Cleanup general error raising to be less confusing. (#950)
Overall, most errors about incorrect types no longer include the internal error in their traceback.
Add support for
AutoModBlockMessageAction.custom_message(#954)Support comparison of
VoiceRegionobjects. (#962)Add a new voice channel activity,
PartyType.gartic_phone. (#984)Add
ApplicationFlags.application_auto_moderation_rule_create_badge(#988)- Add support for new username system - see the official help article for details. Existing functionality is kept backwards-compatible while the migration is still ongoing. (#1025, #1044)
- Add
User.global_name, and update attributes/methods to account for it:
- Add
Update
str(user)andstr(member)to not include#0discriminator of migrated users.Adjust
User.default_avatarto account for new default avatar handling, also addingDefaultAvatar.fuchsia.
Support
animatedemoji field in reaction removal events (e.g.on_raw_reaction_remove()). (#1040)- Implement receiving voice messages. (#1041)
New flag:
MessageFlags.is_voice_messageNew
Attachmentfields:duration,waveform
[ext.commands] Add
Bot.get_listeners(). (#976)[ext.commands]
UserConverterandMemberConverter, now mostly match the behavior ofGuild.get_member_named()
Bug Fixes¶
Fix a bug with
ForumChannel.clone()not properly copying thedefault_auto_archive_durationattribute into the newly-cloned channel. (#635)Fix
VoiceClientnot continuing to play audio when moving between channels. (#845)Prevent stray voice websocket heartbeat threads after reconnecting. (#863)
Fix KeepAlive logging un-intentionally attempting to interpolate stack trace logger calls (#940)
Fix
VoiceChannel.permissions_for()not disablingPermissions.manage_webhookswhen the user cannot connect to the channel. (#942)RawTypingEvent.timestampis now a timezone-awaredatetimeinstead of a naive one. (#945)Fix attribute error when attempting to access
DMChannel.flagsunder certain circumstances. (#960)Fix voice connection discovery using incorrect packet sizes. (#967)
Fix
Guild.get_or_fetch_members()not caching anything in the case of 1 unresolved ID. (#974)Fix audit log parsing issue with new user profile automod actions. (#995)
Improve
GuildStickerdeserialization, fixGuildSticker.edit()parameter types to match documentation. (#996)Fix
ForumChannel.create_thread()usage with files only (and no other content), and fix file descriptions not being sent on thread creation. (#1008)Fix some instances where threads were not being returned in
AuditLogEntry.extra. (#1009)Guild.fetch_members()no longer requires themembersintent to be enabled when connecting to the gateway, now it solely depends on the intent being enabled in the developer portal. (#1013)Fix error when trying to access
Client.application_flagsif anapplication_idwas passed to the constructor. (#1027)Raise
TypeErrorinGuild.create_automod_rule()andAutoModRule.edit()when an action has an invalid type, instead of a rather cryptic error. (#1030)Fix permission resolution for
Threads to usePermissions.send_messages_in_threadsinstead ofPermissions.send_messagesfor calculating implicit permissions. (#1047)Fix typing issue with
abc.Userprotocol requirements, which previously resulted inUserandMembernot conforming to the protocol. (#1051)[ext.commands] Allow referencing the same ParamInfo instance in multiple signatures. (#946)
[ext.commands] Fix type-checker support for
RangeandStringby requiring type argument (i.e.Range[int, 1, 5]instead ofRange[1, 5]). (#991)[ext.commands] Raise
TypeErrorifInteractionBotorAutoShardedInteractionBothas prefix commands related things in aCog(#1018)[ext.commands] Fix member nickname not being used by
clean_contentconverter when user wasn’t found in mentions. (#1029)
Documentation¶
- Split the monolithic API Reference pages into multiple sub-references. (#392)
Main
disnakeAPI reference can now be found at API Reference.disnake.ext.commandsAPI reference is now under Commands API Reference.Legacy
api.htmlandext/commands/api.htmlpages are deprecated.Links with pre-existing references (eg
/api.html#disnake.AppInfo) will be redirected to their appropriate page.
Update automod rule limits. (#931)
Remove incorrect documentation for
InvokableApplicationCommand.invoke(). (#961)Add a searchbox for filtering the sidebar on the API Reference pages. (#963)
Clarify docs about the
on_member_update()andon_raw_member_update()events. (#992)Remove
pins()method from unsupported channel types. (#1033)Update “Creating a Bot Account” page with newer images and synchronise info according to latest changes made by Discord. (#1039)
Add note to
GuildChannel.create_inviteand all subclasses about the new 30 day expiration limit imposed for non-community guilds. (#1056)[ext.commands] Fix commands extension events being duplicated in search results. (#944)
Miscellaneous¶
- Change dependency and environment management to use pdm. (#836, #953)
Please check CONTRIBUTING.md for more details.
Change the main linter to
ruffinstead offlake8. (#935)Support PyNaCl v1.5. (#968)
Remove
disnake.utils.parse_token()(never documented), which has been broken for newer tokens for some time, and was based on unofficial information about the token structure. (#990)Update typings of
Message.activityand internalTeampayloads to match API documentation. (#996)Increase the default
Guild.filesize_limitfrom 8MB to 25MB, matching the recent increase by Discord. (#1005)
v2.8.2¶
This maintenance release contains backports from v2.9.0.
Bug Fixes¶
Fix audit log parsing issue with new user profile automod actions. (#995)
Improve
GuildStickerdeserialization, fixGuildSticker.edit()parameter types to match documentation. (#996)Fix
ForumChannel.create_thread()usage with files only (and no other content), and fix file descriptions not being sent on thread creation. (#1008)
Miscellaneous¶
Update typings of
Message.activityand internalTeampayloads to match API documentation. (#996)Increase the default
Guild.filesize_limitfrom 8MB to 25MB, matching the recent increase by Discord. (#1005)
v2.8.1¶
Bug Fixes¶
Fix
VoiceClientnot continuing to play audio when moving between channels. (#845)Fix KeepAlive logging un-intentionally attempting to interpolate stack trace logger calls (#940)
Fix attribute error when attempting to access
DMChannel.flagsunder certain circumstances. (#960)Fix voice connection discovery using incorrect packet sizes. (#967)
Documentation¶
Update automod rule limits. (#931)
v2.8.0¶
This release comes with support for NSFW application commands,
the on_audit_log_entry_create() event,
and a new Event enum for use with methods like Client.wait_for().
Breaking Changes¶
StickerPack.cover_sticker_id,.cover_stickerand.bannerare now optional and may returnNone. (#912)AuditLogEntry.usermay now be anObjectif the user cannot be found, particularly in entries from theon_audit_log_entry_create()event. (#920)
New Features¶
Add
GuildBuilderandClient.guild_builder()for full coverage of the guild creation endpoint. (#578)Support regex within automod using
AutoModTriggerMetadata.regex_patterns. (#794)Add
File.closedandFile.bytes_lengthproperties. (#839)- Add support for NSFW application commands. (#865)
Add
nsfwparameter to command constructors and decorators.
Add
UserFlags.active_developerandPublicUserFlags.active_developer. (#866)Adds reasons/descriptions to
ConnectionClosederrors. (#873)Update
AutoModTriggerMetadataoverloads to allow passingallow_listto keyword-based rules. (#877)The
PublicUserFlags.discord_certified_moderatoris now an alias ofPublicUserFlags.moderator_programs_alumni. (#883)Add
ForumChannel.default_layout, anddefault_layoutparameter to channel edit methods. (#885, #903)Adds
Eventenumeration to use inClient.wait_for(),disnake.ext.commands.Bot.wait_for()and indisnake.ext.commands.Bot.listen()decorator. (#895)Add new
MessageType.interaction_premium_upsellandMessageType.guild_application_premium_subscriptionmessage types. (#905)- Add application role connection features. (#906)
Add
ApplicationRoleConnectionMetadataandApplicationRoleConnectionMetadataTypetypes.Add
Client.fetch_role_connection_metadataandClient.edit_role_connection_metadatamethods.Add
RoleTags.is_linked_roleandAppInfo.role_connections_verification_urlattributes.
Add
StickerFormatType.gif. (#910)Add support for the
on_audit_log_entry_create()gateway event, and addIntents.moderationintent.Intents.bansis now an alias ofIntents.moderation. (#915)Add fallback to
ObjectforAuditLogEntry.user(#920)
Bug Fixes¶
[ext.commands] Fix
help_commandparameter annotations to allowNonevalue. (#849)Fix user cache memory leak where unused objects weren’t being evicted (provided that
Intents.membersis enabled). (#858)Fix
Message.author.public_flagsalways being0when the member cache is disabled. (#870)Export missing
ThreadWithMessageclass. (#879)Add previously missing
applied_tagsparameter to allForumChannel.create_thread()overloads. (#880)Fix conversion of custom emoji strings (e.g.
<:this:934852112221872198>) inMessage.add_reaction()and similar methods to more strictly adhere to the API documentation. (#887)Fix
Client.delete_guild_command()not updating the local command cache. (#907)Fix errors when trying to deserialize stickers with unknown formats. (#911)
Make
StickerPack.cover_sticker_id,.cover_stickerand.banneroptional. (#912)Fix handling of
ECONNRESETerrors on Linux. (#921)
Documentation¶
Enable OpenSearch, allowing easy integration of the search functionality into browsers. (#859)
Remove documentation regarding private threads requiring boosts. (#872)
Update
AutoModTriggerMetadatafield limits. (#877)
Miscellaneous¶
v2.7.2¶
Bug Fixes¶
Fix
VoiceClientnot continuing to play audio when moving between channels. (#845)Fix KeepAlive logging un-intentionally attempting to interpolate stack trace logger calls (#940)
Fix attribute error when attempting to access
DMChannel.flagsunder certain circumstances. (#960)Fix voice connection discovery using incorrect packet sizes. (#967)
v2.7.1¶
Bug Fixes¶
Fix
Message.author.public_flagsalways being0when the member cache is disabled. (#870)Export missing
ThreadWithMessageclass. (#879)Fix
Client.delete_guild_command()not updating the local command cache. (#907)Fix errors when trying to deserialize stickers with unknown formats. (#911)
v2.7.0¶
This release comes with support for python 3.11 and new selects.
Breaking Changes¶
Properly document that
Message.system_contentmay returnNone. While this is documented as a breaking change, this function always could returnNoneif the message type was not recognised. (#766)Rename
InteractionDataResolved.get()toget_by_id(). (#814)
Deprecations¶
Rename
ApplicationCommandInteractionDataResolvedtoInteractionDataResolved. (#814)[ext.commands] Deprecate the
sync_commands,sync_commands_debug, andsync_commands_on_cog_unloadparameters ofBotandInteractionBot. These have been replaced with thecommand_sync_flagsparameter which takes aCommandSyncFlagsinstance. (#806)
New Features¶
- Update
Message.system_contentto be accurate to the client as of October 2022. (#766) This also properly documents that it is possible to return
None.
- Update
Add type hints to all flag constructors, now supporting type-checking for creating flag classes (e.g.
Intents(members=True)) which used to be untyped. (#778)Add
GuildScheduledEvent.start(),.endand.cancelshortcuts. (#781)Improve the cli, allowing the usage of
ext.commands.InteractionBot,ext.commands.AutoShardedInteractionBot. (#791)- Add new select menu components. (#800, #803)
Add new
ComponentTypevalues.Add
UserSelectMenu,RoleSelectMenu,MentionableSelectMenu,ChannelSelectMenucomponents.Add
ui.UserSelect,ui.RoleSelect,ui.MentionableSelect,ui.ChannelSelectUI types.Add
ui.user_select(),ui.role_select(),ui.mentionable_select(),ui.channel_select()decorators.Add
ui.ActionRow.add_user_select(),add_role_select(),add_mentionable_select(),add_channel_select()- Renamed string select types for clarity (previous names will continue to work):
SelectMenu->StringSelectMenuui.Select->ui.StringSelectui.select()->ui.string_select()ui.ActionRow.add_select()->ui.ActionRow.add_string_select()
Add
MessageInteraction.resolved_valuesandMessageInteractionData.resolved.
Support
delete_afterparameter when sending ephemeral interaction responses. (#816)Allow
slowmode_delayparameter ofForumChannel.create_thread()to be optional. (#822)Add
suppress_embedsparameter toInteraction.edit_original_response()andInteractionMessage.edit(). (#832)[ext.commands] Add
CommandSyncFlagsto provide sync configuration toBotandInteractionBot(and their autosharded variants) ascommand_sync_flags. (#265, #433, #468, #806)
Bug Fixes¶
Add the missing attributes for
PermissionOverwrite:use_application_commandsanduse_embedded_activities. (#777)Ensure that embed fields are copied properly by
Embed.copy()and that the copied embed is completely separate from the original one. (#792)Fix an issue with
Member.ban()erroring when thedelete_message_daysparameter was provided. (#810)Try to get threads used in interactions (like threads in command arguments) from the cache first, before creating a new instance. (#814)
Fix creation of threads in text channels without
Permissions.manage_threads. (#818)Fix off-by-one error in
AutoModKeywordPresetsvalues. (#820)Update event loop handling to avoid warnings when running on Python 3.11. (#827)
[ext.commands] Fix a case where optional variadic arguments could have infinite loops in parsing depending on the user input. (#825)
Documentation¶
Speed up page load by changing hoverxref tooltips to be lazily loaded. (#393)
Remove reference to the v1.0 migration guide from the main index page, and move legacy changelogs to a separate page. (#697)
Add a note warning mentioning that using a
disnake.Fileobject as file kwarg makes adisnake.Embednot reusable. (#786)Update broken Discord API Docs links, add
:ddocs:role for easily creating links to the API documentation. (#793)Add a custom 404 page for when the navigated page does not exist. (#797)
Miscellaneous¶
v2.6.3¶
This maintenance release contains backports from v2.8.0.
Bug Fixes¶
Fix
Message.author.public_flagsalways being0when the member cache is disabled. (#870)Export missing
ThreadWithMessageclass. (#879)Fix
Client.delete_guild_command()not updating the local command cache. (#907)Fix errors when trying to deserialize stickers with unknown formats. (#911)
v2.6.2¶
This maintenance release contains backports from v2.7.0.
Bug Fixes¶
Fix creation of threads in text channels without
Permissions.manage_threads. (#818)Fix off-by-one error in
AutoModKeywordPresetsvalues. (#820)[ext.commands] Fix a case where optional variadic arguments could have infinite loops in parsing depending on the user input. (#825)
v2.6.1¶
This maintenance release contains backports from v2.7.0.
Bug Fixes¶
Ensure that embed fields are copied properly by
Embed.copy()and that the copied embed is completely separate from the original one. (#792)Fix an issue with
Member.ban()erroring when thedelete_message_daysparameter was provided. (#810)
v2.6.0¶
This release adds support for new forum channel features (like tags) as well as auto moderation, among other things. See below for more.
Also note the breaking changes listed below, which may require additional code changes.
Breaking Changes¶
- Update
Clientclasses such that their initialization kwargs are explicitly stated and typehinted. (#371) Replaced
**kwargs/**optionswith explicit keyword arguments for the__init__methods ofClient,ext.commands.Bot,ext.commands.InteractionBot, allAutoSharded*variants, and all relevant parent classes.
- Update
Call new
disnake.on_gateway_error()instead of letting exceptions propagate that occurred while deserializing a received gateway event. (#401)- Rework
Embedinternals. (#435) Embed.set_footer()now requires thetextparameter.Embed.typeis now optional, although this could previously beEmbed.Empty.EmptyEmbedandEmbed.Emptyare deprecated in favor ofNone, have been removed from the documentation, and will result in type-checking errors.
- Rework
- Refactor
ui.ActionRowwith complete typings. (#462) ui.ActionRow.childrennow returns an immutableSequenceinstead of alist.
- Refactor
Remove
InvalidArgumentand replace it withTypeErrorandValueError. (#471)Rename
channel_idparameter tochannelonGuild.create_scheduled_eventandGuildScheduledEvent.edit(). (#548, #590)Raise
TypeErrorinstead ofValueErrorinGuildScheduledEventvalidation. (#560)Assume the local timezone instead of UTC when providing naive datetimes to scheduled event related methods. (#579)
- Update
ModalInteractiontypings. (#583) ModalInteraction.walk_componentsis replaced byModalInteraction.walk_raw_components().
- Update
Change the default of the
ignore_timeoutparameter for allpermissions_formethods toFalse. (#672)- Update activity attributes to match API types. (#685)
Make
Spotify.start,Spotify.end,Spotify.durationoptional.Remove
Activity.timestamps, values are accessible throughActivity.start,Activity.end.Change type of
Activity.buttonsto List[str].
Remove
WidgetMember.nick;WidgetMember.namecontains the member’s nickname, if set. (#736)[ext.commands] Change
has_permissionsandbot_has_permissionschecks to take timeouts into consideration. (#318, #672)[ext.commands] Change
commands.register_injectionto now return an instance ofInjection. (#669)- [ext.commands] Changed parameters of
SubCommandandSubCommandGroupto now require their parent command. (#759) This only affects code that creates an instance of SubCommand or SubCommandGroup manually by calling their constructors.
- [ext.commands] Changed parameters of
[ext.tasks] Change
ext.tasks.Loopto use keyword-only parameters. (#655)
Deprecations¶
EmptyEmbedandEmbed.Emptyare deprecated in favor ofNone, have been removed from the documentation, and will result in type-checking errors. (#435, #768)The
delete_message_daysparameter ofGuild.ban()andMember.ban()is deprecated in favour ofclean_history_duration. (#659)[ext.commands] Using
command_prefix=NonewithBotis now deprecated in favour ofInteractionBot. (#689)
New Features¶
Add custom type support for
disnake.ui.button()anddisnake.ui.select()decorators usingclsparameter. (#281)Add
disnake.on_gateway_error(),Client.on_gateway_error()andenable_gateway_error_handlerclient parameter. (#401)- Update channel edit method annotations. (#418)
slowmode_delayanddefault_auto_archive_durationare now optional.categorymay now be anyabc.Snowflake, not necessarily aCategoryChannel.
- Add new
ui.ActionRowmethods:insert_item(),clear_items(),remove_item(),pop(), as well as anindexparameter foradd_button(). (#462) Also support item access/deletion through
row[i].
- Add new
Expose the icon and recipient data for
Invites whose target is a channel of typeChannelType.group. (#498)- Implement auto moderation. (#530, #698, #757)
New types:
AutoModAction,AutoModTriggerMetadata,AutoModRule,AutoModActionExecutionNew enums:
AutoModTriggerType,AutoModEventType,AutoModActionTypeNew flags:
AutoModKeywordPresetsNew methods:
Guild.create_automod_rule(),Guild.fetch_automod_rule(),Guild.fetch_automod_rules()New intents:
Intents.automod_configuration,Intents.automod_execution(+Intents.automodshortcut for both)New events:
on_automod_rule_create(),on_automod_rule_update(),on_automod_rule_delete(),on_automod_action_execution()+ all the relevant
AuditLogEntryandAuditLogChangesfields.
- Expose additional provided objects by Discord in audit log handling. (#532)
Also adds
PartialIntegration, and anintegrationattribute onAuditLogEntry.extrawhen the type isAuditLogAction.application_command_permission_update.
Add
Webhook.application_idfor accessing the ID of the app that created the webhook, if any. (#534)- Use
SessionStartLimit.remainingwhen attempting to connect to Discord. (#537) Now raises
SessionStartLimitReachedif there are not enough remaining starts to start the client.
- Use
Add multiple converters for previously undocumented fields for audit logs. (#546)
AuditLogDiffcan now have the following attributes with the specified types:AuditLogDiff.unicode_emoji, used for role icons, was renamed toAuditLogDiff.emoji.Implement
ChannelFlagson all channel types. (#547)Make all *InteractionData dataclasses dicts (
MessageInteractionData,ApplicationCommandInteractionData, and so on). (#549)Add support for
WebhookinForumChannelinstances. (#550)Add
GuildScheduledEvent.created_atandGuildScheduledEvent.urlproperties. (#561)Add the
Embed.check_limits()method to check if an Embed would be rejected from Discord. (#567)Add
bitrateparameter toGuild.create_stage_channel(). (#571)Add
Guild.edit_mfa_level()for modifying the guild’s MFA level. (#574)Add the
slowmode_delayparameter toGuild.create_voice_channel(). (#582)Add the
Interaction.app_permissionsproperty, which shows the app permissions in the channel. (#586)Allow
entity_typeparameterGuild.create_scheduled_eventto be missing. (#590)Add
min_lengthandmax_lengthsupport toOptionandext.commands.Param. (#593)Add
AllowedMentions.from_messagefor constructing an allowed mentions object from aMessage. (#603)- Add support of more operators to all
Flagclasses. This list includesIntentsandPermissions. (#605, #615, #616) &,|,^, and~bitwise operator support.<,<=,>, and>=comparison operator support.Support
|operators between flag instances and flag values.Support
~operator on flag values, which create a flag instance with all except this specific flag enabled.Support
|operators between flag values which create a flag instance with both flag values enabled.
- Add support of more operators to all
Support passing raw integer value to
Intentsconstructor. (#613)Add
GuildScheduledEventStatus.cancelledas an alias forcanceled. (#630)Add
on_raw_member_remove()andon_raw_member_update()events, with theRawGuildMemberRemoveEventmodel. (#638)Add
Thread.message_count,Thread.total_message_sentandMessage.positionattributes. (#640)Add support for setting
ChannelFlagsdirectly when editing a channel or thread. (#642)Add
ApplicationFlags.application_command_badgeflag which shows whether an application has at least one globally registered application command. (#649)Add support for
Interaction.datawhich guarantees that every subclass ofInteractionhas thedataattribute. (#654)Add
clean_history_durationparameter toGuild.ban()andMember.ban(). (#659)Add
Game.assets. (#685)Add permission typings to all methods that take permissions directly, for example
disnake.abc.GuildChannel.set_permissions()anddisnake.ext.commands.bot_has_permissions()to name a few. (#708)Add
GatewayParamsfor configuring gateway connection parameters (e.g. disabling compression). (#709)Add
resume_gateway_urlhandling to gateway/websocket resume flow. (#709, #769)Add support for modifying the
INVITES_DISABLEDguild feature usingGuild.edit(). (#718)- Implement remaining forum channel features. (#724)
Add
ForumTagdataclass.Add
ForumChannel.get_tag(),ForumChannel.get_tag_by_name(),Thread.add_tags()andThread.remove_tags().Add
ForumChannel.default_thread_slowmode_delay,ForumChannel.default_reaction, andForumChannel.default_sort_order.New audit log fields for the above features.
Add
BotIntegration.scopes. (#729)Return the
disnake.ui.Viewinstance fromView.add_item,View.remove_itemandView.clear_itemsto allow for fluent-style chaining. (#733)Add
Widget.presence_count. (#736)Add
InteractionResponse.type, which contains the type of the response made, if any. (#737)- Add aliases to the
original_messagemethods. (#738)
- Add aliases to the
- Change
ForumChannel.create_thread()to not require thecontentparameter to be provided. (#739) Like
TextChannel.send(), at least one ofcontent,embed/embeds,file/files,stickers,components, orviewmust be provided.
- Change
- Return the
disnake.ui.ActionRowinstance on multiple methods to allow for fluent-style chaining. (#740) This applies to
ActionRow.append_item,ActionRow.insert_item,ActionRow.add_button,ActionRow.add_select,ActionRow.add_text_input,ActionRow.clear_items, andActionRow.remove_item.
- Return the
Add support for equality checks between two
disnake.Embeds. (#742)Add
Permissions.use_embedded_activitiesas an alias forPermissions.start_embedded_activities. (#754)Add
Permissions.use_application_commandsas an alias forPermissions.use_slash_commands. (#755)Support setting
with_messageparameter ofInteractionResponse.deferfor modal interactions toFalse. (#758)- [ext.commands] Add a way to get the parent or root commands of slash commands. (#277)
[ext.commands] Introduce
commands.Stringfor defining string option length limitations. (#593)[ext.commands] Add support for Union[
User,Role] and Union[User,Member,Role] annotations in slash commands. (#595)- [ext.commands] Add support for injected parameters autocompletion (#670)
Add
Injection.autocompletedecoratorAdd
autocompleterskeyword-only argument toInjection,inject, andregister_injection
[ext.tasks] Add support for subclassing
ext.tasks.Loopand using subclasses inext.tasks.loop()decorator. (#655)
Bug Fixes¶
- Update incorrect channel edit method annotations. (#418)
Fix
sync_permissionsparameter type.Remove
topicparameter fromStageChannel.edit(), addbitrate.
Properly close sockets when receiving a voice server update event. (#488)
Warn the user that bools are not supported for
default_member_permissions. (#520)- Update the Guild Iterator to not get stuck in an infinite loop. (#526)
Add a missing import for the scheduled event user iterator.
Change the default guild
GuildStickerlimit to 5. (#531)Handle optional
Localeinstances (no longer create an enum value). (#533)- Update the type field handling for audit logs. (#535)
AuditLogDiff.typeobjects are no longer alwaysChannelTypeinstances.
Dispatch
disnake.on_reaction_remove()forThreadinstances. (#536)Update
Guild.bitrate_limitto use the correct value for theVIP_REGIONSfeature flag. (#538)Handle
ThreadAutoArchiveDurationinstances fordefault_auto_archive_durationwhen editing channels. (#568)Assume that
Noneis an empty channel name and keepchannel.namea string. (#569)Remove the
$prefix fromIDENTIFYpayload properties. (#572)Replace old application command objects in cogs with the new/copied objects. (#575)
Fix opus function calls on arm64 macOS. (#620)
Improve channel/guild fallback in resolved interaction data, using
PartialMessageablefor unhandled/unknown channels instead of usingNone. (#646)Check the type of the provided parameter when validating names to improve end-user errors when passing an incorrect object to slash command and option names. (#653)
Make the
ext.commands.default_member_permissions()decorator always work in cogs. (#678)Fix
Spotify.start,Spotify.end,Spotify.durationraisingKeyErrorinstead of returningNone, improve activity typing. (#685)Fixes message initialization failing with threads and no intents by explicitly checking we have a guild object where one is required. (#699, #712)
Fixed an issue where it would be possible to remove other features when enabling or disabling the
COMMUNITYfeature for aGuild. (#705)- Fix invalid widget fields. (#736)
Widget.invite_urlandWidget.fetch_inviteare now optional.WidgetMember.avatarandWidgetMember.activitynow work properly and no longer always raise an exception or returnNone.
No longer use deprecated @! syntax for mentioning users. (#743)
Fix creation of forum threads without
Permissions.manage_threads. (#746)Don’t count initial message in forum threads towards
Thread.message_countandThread.total_message_sent. (#747)[ext.commands] Handle
VoiceChannelincommands.is_nsfw(). (#536)[ext.commands] Handle
Union[User, Member]annotations on slash commands arguments when using the decorator interface. (#584)[ext.commands] Change
has_permissionsandbot_has_permissionschecks to work with interactions in guilds that only added theapplications.commandsscope, and in DMs. (#673)[ext.commands] Fix edge case with parsing command annotations that contain a union of non-type objects, like
Optional[Literal[1, 2, 3]]. (#770)
Documentation¶
Add sidebar-navigable sub-sections to Event Reference section of API Reference documentation. (#460)
Remove notes that global application command rollout takes up to an hour. (#518)
Update sphinx from 4.4.0 to version 5.1, and take advantage of new options. (#522, #565)
Update the requests intersphinx url to the new url of the requests documentation. (#539)
Build an htmlzip version of the documentation for downloading. (#541)
Expand and complete the attribute documentation for
AuditLogDiff. (#546)Add note about currently required client override for slash localisations. (#553)
Restructure the
examples/directory, and update + clean up all examples. (#562, #716)Clarify vanity invite handling in
Guild.invites. (#576)Clarify the targets of
Permissions.is_strict_subset()andPermissions.is_strict_superset(). (#612)Clarify when the user is a
Memberor aUserindisnake.on_member_ban()events. (#623)Update
InteractionReference.namedescription, now includes group and subcommand. (#625, #648)Note that
Interaction.channelmay be aPartialMessageablein inaccessible threads, in addition to DMs. (#632)Fix the grammatical errors in
Guildchannel properties. (#645)Update fields listed in
on_user_update()andon_member_update()docs. (#671)Add previously missing inherited attributes to activity types. (#685)
Add documentation for the
strictparameter toClient.get_or_fetch_user()andGuild.get_or_fetch_member(). (#710)Remove note about application command localization requiring a client build override. (#711)
Change references to public guilds to reference the
COMMUNITYfeature instead. (#720)Clarify
Thread.delete()criteria for threads in forum channels. (#745)Clarify behavior of kwargs in flag methods when both a flag and an alias are given. (#749)
[ext.commands] Document the
i18nattribute onext.commands.Botandext.commands.InteractionBotclasses. (#652)[ext.commands] Document
commands.Injection. (#669)[ext.commands] Improve documentation around using
NoneforBot.command_prefix. (#689)
Miscellaneous¶
Refactor the test bot to be easier to use for all users. (#247)
Refactor channel edit overloads and internals, improving typing. (#418)
Run pyright on examples and fix any typing issues uncovered by this change. (#519)
Add initial testing framework. (#529)
Explicitly type activity types with literal return values. (#543)
Explicitly type channel types with literal return values. (#543)
Update PyPI url and minor wording in the README. (#556)
Add
flake8as our linter. (#557)Update pyright to 1.1.254. (#559)
- Add generic parameters to user/message command decorators. (#563)
Update default parameter type to improve compatibility with callable/dynamic defaults.
Run docs creation in GitHub actions to test for warnings before a pull is merged. (#564)
Add more typing overrides to
GuildCommandInteraction. (#580)Rework internal typings for interaction payloads. (#588)
Add typings for all gateway payloads. (#594)
- Add
towncrierandsphinxcontrib-towncrierto manage changelogs. (#600) Use
towncrierfor changelog management.Use
sphinxcontrib-towncrierto build changelogs for the in-development documentation.
- Add
Expand contributing documentation to include more information on creating pull requests and writing features. (#601)
Add flake8-comprehensions for catching inefficient comphrehensions. (#602)
- Resolve minor flake8 issues. (#606)
Don’t use star imports except in
__init__.pyfiles.Don’t use ambiguous variable names.
Don’t use setattr and getattr with constant variable names.
Add
flake8-pytest-stylefor linting pytest specific features with flake8. (#608)Replace all
TypeVarinstances withtyping_extensions.Selfacross the entire library where possible. (#610)Remove the internal
fill_with_flagsdecorator for flags classes and use the built inobject.__init_subclass__()method. (#616, #660)Add
slicetoui.ActionRow__getattr__and__delattr__annotations. (#624)Update and standardise all internal Snowflake regexes to match between 17 and 19 characters (inclusive). (#651)
Rename internal module
disnake.ext.commands.flagstodisnake.ext.commands.flag_converter. (#667)Improve parallel documentation build speed. (#690)
Limit installation of
cchardetin the[speed]extra to Python versions below 3.10 (see aiohttp#6857). (#702)Update annotation and description of
optionsparameter ofui.ActionRow.add_selectto matchui.Select. (#744)Update typings to explicitly specify optional types for parameters with a
Nonedefault. (#751)Adopt SPDX License Headers across all project files. (#756)
v2.5.3¶
This is a maintenance release with backports from v2.6.0.
Bug Fixes¶
Fix creation of forum threads without
Permissions.manage_threads. (#746)[ext.commands] Fix edge case with parsing command annotations that contain a union of non-type objects, like
Optional[Literal[1, 2, 3]]. (#771)
Miscellaneous¶
Limit installation of
cchardetin the[speed]extra to Python versions below 3.10 (see aiohttp#6857). (#772)
v2.5.2¶
This release is a bugfix release with backports from upto v2.6.0.
Bug Fixes¶
Warn the user that bools are not supported for
default_member_permissions. (#520)- Update the Guild Iterator to not get stuck in an infinite loop. (#526)
Add a missing import for the scheduled event user iterator.
Change the default guild
GuildStickerlimit to 5. (#531)Handle optional
Localeinstances (no longer create an enum value). (#533)[ext.commands] Handle
VoiceChannelincommands.is_nsfw(). (#536)Dispatch
disnake.on_reaction_remove()forThreadinstances. (#536)Update
Guild.bitrate_limitto use the correct value for theVIP_REGIONSfeature flag. (#538)Make all *InteractionData dataclasses dicts (
MessageInteractionData,ApplicationCommandInteractionData, and so on). (#549)Handle
ThreadAutoArchiveDurationinstances fordefault_auto_archive_durationwhen editing channels. (#568)Assume that
Noneis an empty channel name and keepchannel.namea string. (#569)Remove the
$prefix fromIDENTIFYpayload properties. (#572)Replace old application command objects in cogs with the new/copied objects. (#575)
[ext.commands] Handle
Union[User, Member]annotations on slash commands arguments when using the decorator interface. (#584)Fix opus function calls on arm64 macOS. (#620)
Improve channel/guild fallback in resolved interaction data, using
PartialMessageablefor unhandled/unknown channels instead of usingNone. (#646)
Documentation¶
Remove notes that global application command rollout takes up to an hour. (#518)
Update the requests intersphinx url to the new url of the requests documentation. (#539)
Clarify the targets of
Permissions.is_strict_subset()andPermissions.is_strict_superset(). (#612)Update
InteractionReference.namedescription, now includes group and subcommand. (#625, #648)
v2.5.1¶
Bug Fixes¶
[ext.commands] Fix
autocomplete()decorator in cogs (#521)
v2.5.0¶
This version adds support for API v10 (which comes with a few breaking changes), forum channels, localizations, permissions v2, improves API coverage by adding support for previously missing features like guild previews, widgets, or welcome screens, and contains several miscellaneous enhancements and bugfixes.
Regarding the message content intent:
Note that earlier versions will continue working fine after the message content intent deadline (August 31st 2022),
as long as the intent is enabled in the developer portal. However, from this version (2.5.0) onward, the intent needs to be
enabled in the developer portal and your code.
See this page of the guide for more information.
If you do not have access to the intent yet, you can temporarily continue using API v9 by calling disnake.http._workaround_set_api_version(9) before connecting,
which will keep sending message content before the intent deadline, even with the intent disabled.
Breaking Changes¶
The
message_contentintent is now required to receive message content and related fields, see above (#353)The new permissions v2 system revamped application command permissions, with the most notable changes being the removal of
default_permissionandcommands.guild_permissionsin favor of new fields/methods - see below for all new changes (#405)TextChannel.create_thread()now requires either amessageor atypeparameter (#355)GuildScheduledEvent.fetch_users()andGuild.bans()now return an async iterator instead of a list of users (#428, #442)Guild.audit_logs()no longer supports theoldest_firstparameter (#473)Store channels have been removed as they’re not supported by Discord any longer (#438)
on_thread_join()will no longer be invoked when a new thread is created, seeon_thread_create()(#445)The voice region enum was replaced with a generic
VoiceRegiondata class (#477)localeattributes are now of typeLocaleinstead ofstr(#439)Invite.revokedandThread.archiver_idhave been removed (deprecated in 2.4) (#455)Slash command names and option names are no longer automatically converted to lowercase, an
InvalidArgumentexception is now raised instead (#422)The
interactionparameter ofui.Item.callback()can no longer be passed as a kwarg (#311)The
youtube,awkwordandsketchy_artistPartyTypes no longer work and have been removed (#408, #409)Trying to defer an interaction response that does not support deferring (e.g. autocomplete) will now raise a
TypeError(#505)[ext.commands] Failure to convert an input parameter annotated as
LargeIntnow raises aLargeIntConversionFailure(#362)
Deprecations¶
Public stages and stage discoverability are deprecated and no longer supported (#287)
Voice regions on guild level are deprecated and no longer have any effect; they should be set on a per-channel basis instead (#357, #374)
Guild.create_integration(),Integration.delete(),StreamIntegration.edit()andStreamIntegration.sync()can’t be used by bots anymore and will be removed in a future version (#361)AppInfo.summary,PartialAppInfo.summaryandIntegrationApplication.summaryare deprecated, use.descriptioninstead (#369)The
suppressparameter for edit methods has been deprecated in favor ofsuppress_embeds, with unchanged functionality (#474)
New Features¶
- Support API v10 (#353)
New intent:
Intents.message_content[ext.commands] New warning:
MessageContentPrefixWarning
- Add forum channels (#448, #479, #504, #512)
Add
ForumChannelAdd
CategoryChannel.create_forum_channel,Guild.create_forum_channelAdd
pinnedparameter toThread.edit()Add
Permissions.create_forum_threads, alias ofsend_messages
- Add application command localizations, see Localizations (#269)
Most
nameanddescriptionparameters now also accept aLocalizedobjectUpdate docstring parsing to accommodate for localizations
Add
Client.i18nAdd
localization_providerandstrict_localizationparameters toClientAdd
with_localizationsparameter toClient.fetch_global_commands(),Client.fetch_guild_commands()Add localization example
- Support permissions v2, see Default Member Permissions (#405)
- Breaking changes:
Remove support for
default_permissionRemove
GuildApplicationCommandPermissions.edit(),PartialGuildApplicationCommandPermissions,UnresolvedGuildApplicationCommandPermissionsRemove
Client.edit_command_permissions(),Client.bulk_edit_command_permissions(),Client.edit_command_permissions(),Client.edit_command_permissions()Remove
Guild.get_command_permissions(),Guild.edit_command_permissions(),Guild.bulk_edit_command_permissions()Update behavior of
GuildCommandInteractionannotation to automatically setdm_permission=Falseinstead of adding a local check, remove support for subcommandsAdd
ApplicationCommandPermissionTypeenum, change type ofApplicationCommandPermissions.typeto support channel targets[ext.commands] Remove
guild_permissions()decorator[ext.commands] Remove
sync_permissionsparameter fromBot
- New features:
Add
dm_permissionanddefault_member_permissionsparameters to application command objects and decoratorsAdd
dm_permission,default_member_permissionsattributes toApplicationCommandandInvokableApplicationCommandAdd
ApplicationCommandPermissions.is_everyone()andApplicationCommandPermissions.is_all_channels()Add
AuditLogAction.application_command_permission_updateenum value andAuditLogDiff.command_permissions[ext.commands] Add
default_member_permissions()decorator, alternative to identically named parameter
- Add guild previews (#359)
- Add guild widget settings and widget url (#360, #365)
Change
Guild.edit_widget()return type
- Add guild welcome screens (#339)
Support
List[str]andDict[str, str]inoptionparameter ofdisnake.ui.Select(#326)Add
Guild.search_members()(#358, #388)Add
ModalInteraction.message(#363, #400)Support
InteractionResponse.edit_message()for modal interactions, if modal was sent in response to component interaction (#364, #400)Support
reasonparameter inMessage.create_thread()andThread.delete()(#366)Add
StageInstance.guild_scheduled_eventandStageInstance.guild_scheduled_event_id(#394)Add
SessionStartLimitandClient.session_start_limit(#402)Allow passing asset types for most image parameters, in addition to
bytes(#415)Update
GuildScheduledEvent.fetch_users()andGuild.bans()to be async iterators supporting pagination (#428, #442)Add
AuditLogDiff.imagefor scheduled event images (#432)Add
notify_everyoneparameter toStageChannel.create_instance()(#440)Add
to_file()method to assets, emojis, stickers (#443, #475)Add
on_thread_create()event (#445)Support
reasonparameter inThread.edit()(#454)Add
default_auto_archive_durationparameter toGuild.create_text_channel(), addnsfwparameter toGuild.create_voice_channel()(#456)Allow providing
attachments=Noneto clear attachments when editing a message (#457)Add
__repr__methods to interaction data types (#458)Add
VoiceChannel.delete_messages(),VoiceChannel.purge(),VoiceChannel.webhooks(),VoiceChannel.create_webhook(), and improveVoiceChannel.permissions_for()(#461)Add
AppInfo.tags,AppInfo.install_params,AppInfo.custom_install_url(#463)Add
TextChannel.last_pin_timestamp,DMChannel.last_pin_timestamp,Thread.last_pin_timestamp(#464)Add temporary workaround for setting API version to avoid message content intent requirement until deadline (#467)
Add
Interaction.expires_atandInteraction.is_expired, automatically fall back to message edit/delete if interaction expired (#469)Add
suppress_embedsparameter to message send methods (#474)Add
VoiceRegion(replacing voice region enum),Client.fetch_voice_regions(),Guild.fetch_voice_regions()(#477)Add
Member.role_iconproperty (#485)Add debug logging of webhook request/response data (#486)
Add
on_raw_thread_delete(),on_raw_thread_member_remove()andon_raw_thread_update()events (#495)Support creating news channels using
Guild.create_text_channel()(#497)Add
Guild.vanity_url_code, add option toGuild.vanity_invite()to use cached invite code (#502)Add
Message.application_id(#513)[ext.commands] Add
GuildScheduledEventConverterandGuildScheduledEventNotFound(#376)[ext.commands] Add
extrasto application commands (#483)[ext.commands] Add
slash_command_attrs,user_command_attrsandmessage_command_attrsCogparameters (#501)
Bug Fixes¶
Improve components exception message (#352)
Use proper HTTP method for joining threads, remove unused methods (#356)
Fix missing
create_public_threadspermission inPermissions.private_channel(#373)Improve
abc.Messageable.send()typing and fix annotations of HTTP methods (#378)Fix shadowed
disnake.messagemodule (#380)Fix missing/incorrect
__slots__(#381)Fix role icon/emoji editing (#403)
Remove cached scheduled events if associated channel was deleted (#406)
Update some types/parameters of roles, scheduled events and voice states (#407)
Allow
contentparameters in send/edit methods to be positional (#411)Fix gateway ratelimiter being too strict (#413)
Fix caching of stage instances and scheduled events (#416)
Improve
PartialMessageablechannel handling (#426)Use
asyncio.iscoroutinefunction()instead ofinspect.iscoroutinefunction()(#427)Don’t automatically enable logging if autoreload is enabled (#431)
Support embed images in
InteractionResponse.edit_message()(#466)Fix
afterparameter ofGuild.audit_logs()(#473)Add
__str__toApplicationCommand, improve sync debug output (#478)Don’t require a
topicwhen creating a stage channel (#480)Update and add missing overloads (#482)
Make
disnake.types.interactionsimportable at runtime (#493)Raise
TypeErrorinstead of silently returning when trying to defer an unsupported interaction type (#505)Fix delay of
aftercallback inAudioPlayerwhen stopping (#508)[ext.commands] Make conversion exceptions in slash commands propagate cleanly as documented (#362)
[ext.commands] Fix
clean_contentconverter (#396)[ext.commands] Fix usage of custom converters with
Param(#398)[ext.commands] Support interactions in
UserConverter,MemberConverter(#429)[ext.commands] Fix unloading of listeners with custom names (#444)
[ext.commands] Fix parameter name conflicts in slash commands (#503)
Documentation¶
Disable mathjax in documentation to improve loading times (#370)
Update return type of
Guild.create_template()(#372)Add documentation for
GuildCommandInteraction,UserCommandInteraction, andMessageCommandInteraction(#374)Fix several bugs of redesign (#377)
Update broken references (#419)
Fix duplicate search results, improve scoring (#423)
Add search hotkeys
ctrl+k,/,s(#434)Fix string escape warnings (#436)
Add several previously missing documentation entries (#446, #470)
Add autocomplete decorator example (#472)
Update docs of ABCs to mention subclasses (#506)
Update
on_member_update()documentation to include new and future attributes (#510)Fix miscellaneous issues, improve formatting (#511)
Miscellaneous¶
v2.4.1¶
This release is a bugfix release with backports from v2.5.0 up to v2.5.2.
Bug Fixes¶
Fix missing
create_public_threadspermission inPermissions.private_channel(#373)Fix role icon/emoji editing (#403)
Remove cached scheduled events if associated channel was deleted (#406)
Update some types/parameters of roles, scheduled events and voice states (#407)
Allow
contentparameters in send/edit methods to be positional (#411)Fix gateway ratelimiter being too strict (#413)
Fix caching of stage instances and scheduled events (#416)
Improve
PartialMessageablechannel handling (#426)Fix delay of
aftercallback inAudioPlayerwhen stopping (#508)Change the default guild
GuildStickerlimit to 5. (#531)Dispatch
disnake.on_reaction_remove()forThreadinstances. (#536)Update
Guild.bitrate_limitto use the correct value for theVIP_REGIONSfeature flag. (#538)Remove the
$prefix fromIDENTIFYpayload properties. (#572)Fix opus function calls on arm64 macOS. (#620)
Improve channel/guild fallback in resolved interaction data, using
PartialMessageablefor unhandled/unknown channels instead of usingNone. (#646)[ext.commands] Fix
clean_contentconverter (#396)[ext.commands] Support interactions in
UserConverter,MemberConverter(#429)[ext.commands] Fix unloading of listeners with custom names (#444)
[ext.commands] Handle
VoiceChannelincommands.is_nsfw(). (#536)
Documentation¶
Update the requests intersphinx url to the new url of the requests documentation. (#539)
Miscellaneous¶
Update dev dependencies and CI (#451)
v2.4.0¶
This version contains many new features, including attachment options, modals, and the ability to directly send message components without views, as well as several fixes and other general improvements.
Breaking Changes¶
- The constructor of
ApplicationCommandand its subtypes no longer accepts**kwargsfor setting internal values (#249) This shouldn’t affect anyone, as
**kwargswas only used for setting fields returned by the API and had no effect if the user set them
- The constructor of
Interaction.permissionsnow returns proper permission values in DMs (#321)The
reasonparameter for sticker endpoints inHTTPClientis now kwarg-only
Deprecations¶
New Features¶
Add
Interaction.localeandInteraction.guild_localeproperties to interactions (#225)Add
ui.ActionRowandcomponentskwarg to send methods (#224)- Add
ui.WrappedComponentas a base class for all UI components (#253) ui.Itemnow inherits fromui.WrappedComponent. It’s no longer a base class for all UI components.
- Add
- Implement modals and text inputs (#253)
Add
TextInputcomponent.Add
ui.Modalas a high-level implementation of modals.Add
ui.TextInputfor modals. It inherits fromui.WrappedComponentand adds more functionality on top ofTextInput.Add
InteractionResponse.send_modal()to support new interaction response type.Add
on_modal_submit()event.
Use logger for application command sync debug (#230)
[ext.commands] Improve application command sync algorithm (#240)
Use HTTP API v9 (#250)
[ext.commands] Add
commands.Range, see Number Ranges (#237, #276, #316)[ext.commands] Add
Bot.load_extensionsandutils.search_directory()(#245)[ext.commands] Add
commands.LargeInt(#264)Add
with_messageparameter toInteractionResponse.defer()to support deferring component interaction responses with messages (#248)Add
Widget.edit()(#266)Add the ability to specify a default color for embeds (#203)
Add
PartialInviteGuild.nsfw_levelandPartialInviteGuild.vanity_url_code(#297)Add
Thread.create_timestamp(#285)Add
Message.thread(#291)Add
Permissions.eventsandPermissions.private_channel, improve existing factory methods (#286, #321)Support images in
GuildScheduledEvent(#280)Add
PartyType.sketch_headsandPartyType.ocho(#306)Interaction.bot,Interaction.client,Interaction.channelandInteraction.channel_idare no longer optional (#279)Support timeouts in
abc.GuildChannel.permissions_for()and other channel types (#289)Support
disnake.Attachmentoptions in slash commands (#226)Add
attachmentsparameter toInteractionResponse.edit_message()(#335)Add
Guild.get_or_fetch_members()with an aliasGuild.getch_members()(#322).Add
abc.GuildChannel.jump_url,DMChannel.jump_urlandThread.jump_url(#319)
Bug Fixes¶
Fix missing support for
reasonparameter in some methods (#266)Improve validation of slash command and option names (#267)
[ext.commands] Fix typing of
ctxparameter inConverter(#292)Fix
Guild.get_command()never returning any commands (#333)Return list of members from
Guild.chunk()(#334)Fix handling of uppercase slash command names (#346)
Fix
permissionsannotation ofabc.GuildChannel.set_permissions()(#349)Fix
tasks.loopusage with fixed times (#337)
Documentation¶
Miscellaneous¶
Improve typing/annotations of several parts of the library (#249, #256, #263, #279, #292, #299, #308)
Add additional pre-commit hooks for development (#233)
Add taskipy for development (#234)
Improve member deserialization (#304)
Split application command objects into separate types for data returned by the API (#299)
Update README banner (#343)
v2.3.2¶
Bug Fixes¶
Fix invalid default value for application command option descriptions (#338)
v2.3.1¶
Bug Fixes¶
[ext.commands] Fix Python 3.10 union type annotations in slash commands (#231)
Fix double
@when mentioning default role (#244)Fix a command sync bug which prevented registering two application commands with the same name but different types (#254)
Fix bug when editing a
Viewwith URL buttons that resulted in therowattribute being reset (#252)[ext.commands] Fix
MessageConverternot defaulting to current channel if no channel ID specified (#284)Fix attachment descriptions not working after recent API change (#241)
Fix incorrect type check in
Guild.create_scheduled_event()usingStagePrivacyLevelinstead ofGuildScheduledEventPrivacyLevel(#263)[ext.commands] Fix exceptions that occurred when using a
Unionin a slash command parameter annotation[ext.commands] Fix dynamic command cooldowns (#320)
Fix type-checking of
guild_ids/test_guildsparameters which could break application command caching (#300, #325)Fix
Guild.create_sticker()not working when no description was provided (#328)
Documentation¶
Fix
guild_permissions()documentationFix missing dropdown icon (#235)
Miscellaneous¶
v2.3.0¶
This version contains several new features and fixes, notably support for guild scheduled events, guild timeouts, and a slash command rework with parameter injections, as well as several documentation fixes.
Note: the Version Guarantees have been updated to more accurately reflect the versioning scheme this library is following.
Breaking Changes¶
The supported aiohttp version range changed from
>=3.6.0,<3.8.0to>=3.7.0,<3.9.0Due to the upcoming text-in-voice feature (not yet released at the time of writing), many methods/properties that previously returned a
TextChannelcan now also return aVoiceChannel, which shares many but not all of its methods. Also see the details for text-in-voice under “New Features” below, which include a few important things to note.Slash command internals have undergone an extensive rework, and while existing code should still work as before, it is recommended that you do some testing using the new implementation first
Bot.get_slash_commandmay now also returnSubCommandGrouporSubCommandinstances, see documentationdisnake.types.ThreadArchiveDurationis nowThreadArchiveDurationLiteral, to avoid confusion with the newThreadArchiveDurationenum
Deprecations¶
The
role_idsanduser_idsparameters forguild_permissionsare nowrolesandusersrespectively; the old parameter names will be removed in a future version
New Features¶
- Add guild scheduled events (#151, #217)
New intent:
Intents.guild_scheduled_events(enabled by default)- Invite additions/changes
guild_scheduled_eventparameter onabc.GuildChannel.create_invite()guild_scheduled_event_idparameter onClient.fetch_invite()Include
eventURL parameter inInvite.urlif applicableSupport parsing scheduled event ID from invite URLs
- Add guild timeouts (#161, #221, #223)
timeoutparameter onMember.edit()New permission:
Permissions.moderate_members
- Add preliminary support for text-in-voice (#162, #177)
Many methods/properties that previously returned a
TextChannelcan now also return aVoiceChannel, which shares many but not all of its methods- Important notes:
This feature is only available in a very limited number of servers at the time of writing this, and the API is still being developed; therefore, expect changes in the future
Text-in-voice currently does not support these text channel features (note: this is not guaranteed to be an exhaustive list): threads, webhooks, nsfw flags, slowmode
The
nsfwandslowmode_delayvalues/parameters are currently not supported by the API and are still TBDPinned messages are currently not exposed in the client UI, and while the API for them works, their future is uncertain
VoiceChannelnow inherits fromabc.MessageableNew
VoiceChannelproperties:.nsfw,.slowmode_delay,.last_message_id,.last_messageNew
VoiceChannelmethods:.is_nsfw,.get_partial_messagensfwandslowmode_delayparameters forVoiceChannel.edit()
- [ext.commands] Add parameter injections (example) (#130)
Add attachment descriptions (see
File,Attachment) (#100)Add
on_raw_typing()event (#176)Add
Guild.approximate_member_countandGuild.approximate_presence_count(available on manually fetched guilds) (#139)Add
ThreadArchiveDurationenum, containing the currently valid values for the thread auto-archive feature (#187)[ext.commands] Add
PermissionsConverter, which allows the conversion of a value or a (list of) permission names to aPermissionsinstance (using aPermissionsannotation)Add
AppInfo.flags[ext.commands] Add
channel_typesparameter toParam/ParamInfo(#130)Add support for setting
slowmode_delayon thread creation (TextChannel.create_thread(),Message.create_thread()) (#132)Add
invitableparameter toTextChannel.create_thread()(#132)Add
fail_if_not_existsparameter toMessage.reply()(#199, #211)[ext.commands]
Bot.get_slash_commandnow works similar toBot.get_command, in that it can also return subcommands/groups for inputs like"foo bar"(#149)Add new aliases for
ApplicationCommandInteraction:CommandInteraction,CmdInteraction,CommandInter,CmdInter,AppCommandInteractionAdd a base class for warnings emitted by this library,
DiscordWarning(#118)Add new warnings (emitted instead of just using
printfor warnings):ConfigWarning,SyncWarning(#118)
Bug Fixes¶
Fix dispatch of typing events in DMs (#176)
Try to retrieve objects in received interactions from cache first (fixing properties like
Member.statuson member parameters for commands) (#182, #213)Fix return type annotation of
ui.button()andui.select()decorators (#163)Fix incorrect URL returned by
Template.urlFix sending local files in embeds with interactions/webhooks if only one embed was specified (#193)
Fix leftover uses of
json, which didn’t useorjsonif available (#184)Fix
Message.channeltype beingDMChannelfor ephemeral messages inon_message()(#197)Fix command/option name validation (#210)
Always close files after completing HTTP requests (#124)
[ext.commands] Fix unnecessary application command sync without changes
[ext.commands] Fix incorrect detection of deprecated guild commands in sync algorithm while sync is in progress (#205)
Documentation¶
Move documentation to https://docs.disnake.dev/
Update Version Guarantees (#200)
Clarify
Interaction.original_message()documentation regarding different response types (#140)Clarify
Interaction.send()documentation (#188)Redirect searches for
colortocolour(#153)Add documentation for new guild feature values (#148)
- Add documentation for several methods/properties: (#153)
Fix incorrect type for
Invite.channelin documentationAdd additional information about application command sync algorithm and syncing commands in sharded bots (#205)
Miscellaneous¶
v2.2.3¶
Bug Fixes¶
Fix invalid default value for application command option descriptions (#338)
v2.2.2¶
Bug Fixes¶
Fix channel conversion in audit log entries
Fix improper error handling in context menu commands
Supply
ApplicationCommandInteraction.application_commandin autocomplete callbacksFix
Select.append_optionnot raising an error if 25 options have already been addedImprove check for
optionsparameter on slash commands and subcommandsImprove parameter parsing for converters
Fix warning related to new option properties
Documentation¶
Update repository links to new organization
Fix duplicate entries in documentation
Fix incorrect
versionaddedtagsAdd documentation for
InteractionBotandAutoShardedInteractionBot
v2.2.1¶
Bug Fixes¶
Fixed error related to guild member count
v2.2.0¶
New Features¶
Add kwarg
attachmentsto edit methodsAdd kwargs
fileandfilestoInteractionResponse.edit_message(),PartialMessage.edit()andMessage.edit()Add kwarg
filetoEmbed.set_image()andEmbed.set_thumbnail()Add kwarg
delaytoInteraction.delete_original_message()andWebhookMessage.delete()Add kwarg
delete_aftertoInteractionResponse.send_message()andWebhookMessage.send()[ext.commands] Add
InvokableSlashCommand.autocomplete(alternative method of adding autocomplete functions)[ext.commands] Add
SubCommand.autocomplete(alternative method of adding autocomplete functions)[ext.commands] Add
Cog.cog_load[ext.commands] Error handlers now can cancel each other by returning
True
v2.1.5¶
New Features¶
Add
UnresolvedGuildApplicationCommandPermissionsAdd kwargs
min_valueandmax_valueinOption[ext.commands] Add kwarg
min_value(with aliasesge,gt) toParam[ext.commands] Add kwarg
max_value(with aliasesle,lt) toParam[ext.commands] Add kwarg
ownertoguild_permissions
Bug Fixes¶
Command deletions on reconnections
Pending sync tasks on loop termination
v2.1.4¶
Bug Fixes¶
Fixed some issues with application command permissions synchronisation
v2.1.3¶
New Features¶
Add
PartialGuildApplicationCommandPermissionsAdd
ApplicationCommandInteraction.filled_optionsproperty[ext.commands] Add
InteractionBot[ext.commands] Add
guild_permissions[ext.commands] Add kwargs
sync_commands_on_cog_unloadandsync_permissionstoInteractionBotBase
Bug Fixes¶
Music
default_permissionkwarg in user / message commandsCommands no longer sync during the loop termination
v2.1.2¶
This is the first stable version of this discord.py 2.0 fork.
New Features¶
Add interaction hierarchy.
Interactionis now the base class for other interaction types, such asApplicationCommandInteractionandMessageInteraction.Add interaction data wrappers:
ApplicationCommandInteractionDataandMessageInteractionData.Add interaction data option wrapper:
ApplicationCommandInteractionDataOptionAdd
Client.bulk_edit_command_permissions()Add
Client.edit_command_permissions()[ext.commands] Support for slash commands and context menus.
[ext.commands] Add
InvokableApplicationCommand- the base class for invocable slash commands and context menus.[ext.commands] Add
InvokableSlashCommandfor slash command management.[ext.commands] Add
SubCommandfor slash sub-command management.[ext.commands] Add
SubCommandGroupfor slash sub-command group management.[ext.commands] Add
InvokableUserCommandfor user command management (context menus).[ext.commands] Add
InvokableMessageCommandfor message command management (context menus).[ext.commands] Add
ParamInfofor wrapping annotations.[ext.commands] Add
slash_commandfor slash command definitions.[ext.commands] Add
user_commandfor user command definitions (context menus).[ext.commands] Add
message_commandfor message command definitions (context menus).[ext.commands] Add
Param(with an aliasparam) in caseParamInfocauses linter errors.[ext.commands] Add
Bot.slash_commandfor slash command definitions.[ext.commands] Add
Bot.user_commandfor user command definitions (context menus).[ext.commands] Add
Bot.message_commandfor message command definitions (context menus).[ext.commands] Add
Bot.after_slash_command_invoke- a decorator for post-invoke hooks for slash commands.[ext.commands] Add
Bot.after_user_command_invoke- a decorator for post-invoke hooks for user commands.[ext.commands] Add
Bot.after_message_command_invoke- a decorator for post-invoke hooks for message commands.[ext.commands] Add
Bot.before_slash_command_invoke- a decorator for pre-invoke hooks for slash commands.[ext.commands] Add
Bot.before_user_command_invoke- a decorator for pre-invoke hooks for user commands.[ext.commands] Add
Bot.before_message_command_invoke- a decorator for pre-invoke hooks for message commands.
Legacy Changelog¶
Changelogs for older versions (0.x, 1.x) can be found on the Legacy Changelog page.