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.9.3¶
This is a maintainance 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_rtpsize
encryption mode for voice connections, and remove deprecatedxsalsa20_poly1305*
modes. (#1228)
Bug Fixes¶
Attempt to handle abrupt websocket closures on
aiohttp >= 3.9.0
andpython < 3.11.0
gracefully. (#1241)
Documentation¶
Adding some clarifying documentation around the type of
AuditLogEntry.extra
when the action isoverwrite_create
. (#1180)
Miscellaneous¶
Raise PyNaCl version requirement to
v1.5.0
. (#1228)
v2.9.2¶
Bug Fixes¶
[ext.commands] Fix erroneous
LocalizationWarning
s when using localized slash command parameters in cogs. (#1133)Handle unexpected
RECONNECT
opcode whereHELLO
is expected during initial shard connection. (#1155)Reconnect gateway websocket on protocol errors. (#1159)
Avoid
AttributeError
inFFmpegAudio
when 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
StandardSticker
tostickers
parameter type annotation ofMessageable.send()
andForumChannel.create_thread()
. (#1134)
v2.9.1¶
Bug Fixes¶
Allow
cls
argument 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_link
is obsolete, it is now enabled Discord-wide. (#986)The
PartyType
enum is deprecated, as voice activity IDs are not officially documented and the enum regularly becomes outdated. (#1035)[ext.commands]
Range
andString
now 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 specificclone
method’s documentation for details. (#635)Implement new
AutoModTriggerMetadata.mention_raid_protection_enabled
parameter. (#898)- Add support for raid alerts. (#899)
Add
raid_alerts_disabled
andsafety_alerts_channel
parameters 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
RoleSubscriptionData
and attributeMessage.role_subscription_data
.New system channel flags:
role_subscription_purchase_notifications
androle_subscription_purchase_notification_replies
.
Add
oldest_first
parameter toGuild.audit_logs()
. (#919)- Implement Onboarding. (#928)
Add
Onboarding
,OnboardingPrompt
andOnboardingPromptOption
.Add
Guild.onboarding()
.
Add
flags
parameter to message send and edit methods. (#929)- Messages can now be sent within
StageChannel
instances. (#942) StageChannel
now inherits fromabc.Messageable
- New
StageChannel
properties:
- New
- New
StageChannel
methods: .is_nsfw
,.get_partial_message
,.delete_messages
,.purge
,.webhooks
,.create_webhook
- New
Add
nsfw
andslowmode_delay
parameters toGuild.create_stage_channel()
andCategoryChannel.create_stage_channel()
Add
nsfw
andslowmode_delay
parameters toStageChannel.edit()
Add text related permission support to
StageChannel.permissions_for()
.
- Messages can now be sent within
- New message types that are sent within
StageChannel
instances: (#942)
- New message types that are sent within
Add edit support for
user_limit
toStageChannel.edit()
. (#942)Add support for setting
user_limit
andvideo_quality_mode
when creating aStageChannel
withGuild.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
VoiceRegion
objects. (#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#0
discriminator of migrated users.Adjust
User.default_avatar
to account for new default avatar handling, also addingDefaultAvatar.fuchsia
.
Support
animated
emoji field in reaction removal events (e.g.on_raw_reaction_remove()
). (#1040)- Implement receiving voice messages. (#1041)
New flag:
MessageFlags.is_voice_message
New
Attachment
fields:duration
,waveform
[ext.commands] Add
Bot.get_listeners()
. (#976)[ext.commands]
UserConverter
andMemberConverter
, now mostly match the behavior ofGuild.get_member_named()
Bug Fixes¶
Fix a bug with
ForumChannel.clone()
not properly copying thedefault_auto_archive_duration
attribute into the newly-cloned channel. (#635)Fix
VoiceClient
not 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_webhooks
when the user cannot connect to the channel. (#942)RawTypingEvent.timestamp
is now a timezone-awaredatetime
instead of a naive one. (#945)Fix attribute error when attempting to access
DMChannel.flags
under 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
GuildSticker
deserialization, 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 themembers
intent 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_flags
if anapplication_id
was passed to the constructor. (#1027)Raise
TypeError
inGuild.create_automod_rule()
andAutoModRule.edit()
when an action has an invalid type, instead of a rather cryptic error. (#1030)Fix permission resolution for
Thread
s to usePermissions.send_messages_in_threads
instead ofPermissions.send_messages
for calculating implicit permissions. (#1047)Fix typing issue with
abc.User
protocol requirements, which previously resulted inUser
andMember
not conforming to the protocol. (#1051)[ext.commands] Allow referencing the same ParamInfo instance in multiple signatures. (#946)
[ext.commands] Fix type-checker support for
Range
andString
by requiring type argument (i.e.Range[int, 1, 5]
instead ofRange[1, 5]
). (#991)[ext.commands] Raise
TypeError
ifInteractionBot
orAutoShardedInteractionBot
has prefix commands related things in aCog
(#1018)[ext.commands] Fix member nickname not being used by
clean_content
converter when user wasn’t found in mentions. (#1029)
Documentation¶
- Split the monolithic API Reference pages into multiple sub-references. (#392)
Main
disnake
API reference can now be found at API Reference.disnake.ext.commands
API reference is now under Commands API Reference.Legacy
api.html
andext/commands/api.html
pages 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_invite
and 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
ruff
instead 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.activity
and internalTeam
payloads to match API documentation. (#996)Increase the default
Guild.filesize_limit
from 8MB to 25MB, matching the recent increase by Discord. (#1005)
v2.8.2¶
This maintainence release contains backports from v2.9.0.
Bug Fixes¶
Fix audit log parsing issue with new user profile automod actions. (#995)
Improve
GuildSticker
deserialization, 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.activity
and internalTeam
payloads to match API documentation. (#996)Increase the default
Guild.filesize_limit
from 8MB to 25MB, matching the recent increase by Discord. (#1005)
v2.8.1¶
Bug Fixes¶
Fix
VoiceClient
not 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.flags
under 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_sticker
and.banner
are now optional and may returnNone
. (#912)AuditLogEntry.user
may now be anObject
if the user cannot be found, particularly in entries from theon_audit_log_entry_create()
event. (#920)
New Features¶
Add
GuildBuilder
andClient.guild_builder()
for full coverage of the guild creation endpoint. (#578)Support regex within automod using
AutoModTriggerMetadata.regex_patterns
. (#794)Add
File.closed
andFile.bytes_length
properties. (#839)- Add support for NSFW application commands. (#865)
Add
nsfw
parameter to command constructors and decorators.
Add
UserFlags.active_developer
andPublicUserFlags.active_developer
. (#866)Adds reasons/descriptions to
ConnectionClosed
errors. (#873)Update
AutoModTriggerMetadata
overloads to allow passingallow_list
to keyword-based rules. (#877)The
PublicUserFlags.discord_certified_moderator
is now an alias ofPublicUserFlags.moderator_programs_alumni
. (#883)Add
ForumChannel.default_layout
, anddefault_layout
parameter to channel edit methods. (#885, #903)Adds
Event
enumeration to use inClient.wait_for()
,disnake.ext.commands.Bot.wait_for()
and indisnake.ext.commands.Bot.listen()
decorator. (#895)Add new
MessageType.interaction_premium_upsell
andMessageType.guild_application_premium_subscription
message types. (#905)- Add application role connection features. (#906)
Add
ApplicationRoleConnectionMetadata
andApplicationRoleConnectionMetadataType
types.Add
Client.fetch_role_connection_metadata
andClient.edit_role_connection_metadata
methods.Add
RoleTags.is_linked_role
andAppInfo.role_connections_verification_url
attributes.
Add
StickerFormatType.gif
. (#910)Add support for the
on_audit_log_entry_create()
gateway event, and addIntents.moderation
intent.Intents.bans
is now an alias ofIntents.moderation
. (#915)Add fallback to
Object
forAuditLogEntry.user
(#920)
Bug Fixes¶
[ext.commands] Fix
help_command
parameter annotations to allowNone
value. (#849)Fix user cache memory leak where unused objects weren’t being evicted (provided that
Intents.members
is enabled). (#858)Fix
Message.author.public_flags
always being0
when the member cache is disabled. (#870)Export missing
ThreadWithMessage
class. (#879)Add previously missing
applied_tags
parameter 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_sticker
and.banner
optional. (#912)Fix handling of
ECONNRESET
errors 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
AutoModTriggerMetadata
field limits. (#877)
Miscellaneous¶
v2.7.2¶
Bug Fixes¶
Fix
VoiceClient
not 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.flags
under certain circumstances. (#960)Fix voice connection discovery using incorrect packet sizes. (#967)
v2.7.1¶
Bug Fixes¶
Fix
Message.author.public_flags
always being0
when the member cache is disabled. (#870)Export missing
ThreadWithMessage
class. (#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_content
may returnNone
. While this is documented as a breaking change, this function always could returnNone
if the message type was not recognised. (#766)Rename
InteractionDataResolved.get()
toget_by_id()
. (#814)
Deprecations¶
Rename
ApplicationCommandInteractionDataResolved
toInteractionDataResolved
. (#814)[ext.commands] Deprecate the
sync_commands
,sync_commands_debug
, andsync_commands_on_cog_unload
parameters ofBot
andInteractionBot
. These have been replaced with thecommand_sync_flags
parameter which takes aCommandSyncFlags
instance. (#806)
New Features¶
- Update
Message.system_content
to 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()
,.end
and.cancel
shortcuts. (#781)Improve the cli, allowing the usage of
ext.commands.InteractionBot
,ext.commands.AutoShardedInteractionBot
. (#791)- Add new select menu components. (#800, #803)
Add new
ComponentType
values.Add
UserSelectMenu
,RoleSelectMenu
,MentionableSelectMenu
,ChannelSelectMenu
components.Add
ui.UserSelect
,ui.RoleSelect
,ui.MentionableSelect
,ui.ChannelSelect
UI 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
->StringSelectMenu
ui.Select
->ui.StringSelect
ui.select()
->ui.string_select()
ui.ActionRow.add_select()
->ui.ActionRow.add_string_select()
Add
MessageInteraction.resolved_values
andMessageInteractionData.resolved
.
Support
delete_after
parameter when sending ephemeral interaction responses. (#816)Allow
slowmode_delay
parameter ofForumChannel.create_thread()
to be optional. (#822)Add
suppress_embeds
parameter toInteraction.edit_original_response()
andInteractionMessage.edit()
. (#832)[ext.commands] Add
CommandSyncFlags
to provide sync configuration toBot
andInteractionBot
(and their autosharded variants) ascommand_sync_flags
. (#265, #433, #468, #806)
Bug Fixes¶
Add the missing attributes for
PermissionOverwrite
:use_application_commands
anduse_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_days
parameter 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
AutoModKeywordPresets
values. (#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.File
object as file kwarg makes adisnake.Embed
not 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 maintainence release contains backports from v2.8.0.
Bug Fixes¶
Fix
Message.author.public_flags
always being0
when the member cache is disabled. (#870)Export missing
ThreadWithMessage
class. (#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 maintainence 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
AutoModKeywordPresets
values. (#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 maintainence 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_days
parameter 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
Client
classes such that their initialization kwargs are explicitly stated and typehinted. (#371) Replaced
**kwargs
/**options
with 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
Embed
internals. (#435) Embed.set_footer()
now requires thetext
parameter.Embed.type
is now optional, although this could previously beEmbed.Empty
.EmptyEmbed
andEmbed.Empty
are deprecated in favor ofNone
, have been removed from the documentation, and will result in type-checking errors.
- Rework
- Refactor
ui.ActionRow
with complete typings. (#462) ui.ActionRow.children
now returns an immutableSequence
instead of alist
.
- Refactor
Remove
InvalidArgument
and replace it withTypeError
andValueError
. (#471)Rename
channel_id
parameter tochannel
onGuild.create_scheduled_event
andGuildScheduledEvent.edit()
. (#548, #590)Raise
TypeError
instead ofValueError
inGuildScheduledEvent
validation. (#560)Assume the local timezone instead of UTC when providing naive datetimes to scheduled event related methods. (#579)
- Update
ModalInteraction
typings. (#583) ModalInteraction.walk_components
is replaced byModalInteraction.walk_raw_components()
.
- Update
Change the default of the
ignore_timeout
parameter for allpermissions_for
methods toFalse
. (#672)- Update activity attributes to match API types. (#685)
Make
Spotify.start
,Spotify.end
,Spotify.duration
optional.Remove
Activity.timestamps
, values are accessible throughActivity.start
,Activity.end
.Change type of
Activity.buttons
to List[str
].
Remove
WidgetMember.nick
;WidgetMember.name
contains the member’s nickname, if set. (#736)[ext.commands] Change
has_permissions
andbot_has_permissions
checks to take timeouts into consideration. (#318, #672)[ext.commands] Change
commands.register_injection
to now return an instance ofInjection
. (#669)- [ext.commands] Changed parameters of
SubCommand
andSubCommandGroup
to 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.Loop
to use keyword-only parameters. (#655)
Deprecations¶
EmptyEmbed
andEmbed.Empty
are deprecated in favor ofNone
, have been removed from the documentation, and will result in type-checking errors. (#435, #768)The
delete_message_days
parameter ofGuild.ban()
andMember.ban()
is deprecated in favour ofclean_history_duration
. (#659)[ext.commands] Using
command_prefix=None
withBot
is now deprecated in favour ofInteractionBot
. (#689)
New Features¶
Add custom type support for
disnake.ui.button()
anddisnake.ui.select()
decorators usingcls
parameter. (#281)Add
disnake.on_gateway_error()
,Client.on_gateway_error()
andenable_gateway_error_handler
client parameter. (#401)- Update channel edit method annotations. (#418)
slowmode_delay
anddefault_auto_archive_duration
are now optional.category
may now be anyabc.Snowflake
, not necessarily aCategoryChannel
.
- Add new
ui.ActionRow
methods:insert_item()
,clear_items()
,remove_item()
,pop()
, as well as anindex
parameter foradd_button()
. (#462) Also support item access/deletion through
row[i]
.
- Add new
Expose the icon and recipient data for
Invite
s whose target is a channel of typeChannelType.group
. (#498)- Implement auto moderation. (#530, #698, #757)
New types:
AutoModAction
,AutoModTriggerMetadata
,AutoModRule
,AutoModActionExecution
New enums:
AutoModTriggerType
,AutoModEventType
,AutoModActionType
New flags:
AutoModKeywordPresets
New methods:
Guild.create_automod_rule()
,Guild.fetch_automod_rule()
,Guild.fetch_automod_rules()
New intents:
Intents.automod_configuration
,Intents.automod_execution
(+Intents.automod
shortcut for both)New events:
on_automod_rule_create()
,on_automod_rule_update()
,on_automod_rule_delete()
,on_automod_action_execution()
+ all the relevant
AuditLogEntry
andAuditLogChanges
fields.
- Expose additional provided objects by Discord in audit log handling. (#532)
Also adds
PartialIntegration
, and anintegration
attribute onAuditLogEntry.extra
when the type isAuditLogAction.application_command_permission_update
.
Add
Webhook.application_id
for accessing the ID of the app that created the webhook, if any. (#534)- Use
SessionStartLimit.remaining
when attempting to connect to Discord. (#537) Now raises
SessionStartLimitReached
if there are not enough remaining starts to start the client.
- Use
Add multiple converters for previously undocumented fields for audit logs. (#546)
AuditLogDiff
can now have the following attributes with the specified types:AuditLogDiff.unicode_emoji
, used for role icons, was renamed toAuditLogDiff.emoji
.Implement
ChannelFlags
on all channel types. (#547)Make all *InteractionData dataclasses dicts (
MessageInteractionData
,ApplicationCommandInteractionData
, and so on). (#549)Add support for
Webhook
inForumChannel
instances. (#550)Add
GuildScheduledEvent.created_at
andGuildScheduledEvent.url
properties. (#561)Add the
Embed.check_limits()
method to check if an Embed would be rejected from Discord. (#567)Add
bitrate
parameter toGuild.create_stage_channel()
. (#571)Add
Guild.edit_mfa_level()
for modifying the guild’s MFA level. (#574)Add the
slowmode_delay
parameter toGuild.create_voice_channel()
. (#582)Add the
Interaction.app_permissions
property, which shows the app permissions in the channel. (#586)Allow
entity_type
parameterGuild.create_scheduled_event
to be missing. (#590)Add
min_length
andmax_length
support toOption
andext.commands.Param
. (#593)Add
AllowedMentions.from_message
for constructing an allowed mentions object from aMessage
. (#603)- Add support of more operators to all
Flag
classes. This list includesIntents
andPermissions
. (#605, #615, #616) &
,|
,^
, and~
bitwise operator support.<
,<=
,>
, and>=
comparsion 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
Intents
constructor. (#613)Add
GuildScheduledEventStatus.cancelled
as an alias forcanceled
. (#630)Add
on_raw_member_remove()
andon_raw_member_update()
events, with theRawGuildMemberRemoveEvent
model. (#638)Add
Thread.message_count
,Thread.total_message_sent
andMessage.position
attributes. (#640)Add support for setting
ChannelFlags
directly when editing a channel or thread. (#642)Add
ApplicationFlags.application_command_badge
flag which shows whether an application has at least one globally registered application command. (#649)Add support for
Interaction.data
which guarantees that every subclass ofInteraction
has thedata
attribute. (#654)Add
clean_history_duration
parameter 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
GatewayParams
for configuring gateway connection parameters (e.g. disabling compression). (#709)Add
resume_gateway_url
handling to gateway/websocket resume flow. (#709, #769)Add support for modifying the
INVITES_DISABLED
guild feature usingGuild.edit()
. (#718)- Implement remaining forum channel features. (#724)
Add
ForumTag
dataclass.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.View
instance fromView.add_item
,View.remove_item
andView.clear_items
to 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_message
methods. (#738)
- Add aliases to the
- Change
ForumChannel.create_thread()
to not require thecontent
parameter to be provided. (#739) Like
TextChannel.send()
, at least one ofcontent
,embed
/embeds
,file
/files
,stickers
,components
, orview
must be provided.
- Change
- Return the
disnake.ui.ActionRow
instance 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.Embed
s. (#742)Add
Permissions.use_embedded_activities
as an alias forPermissions.start_embedded_activities
. (#754)Add
Permissions.use_application_commands
as an alias forPermissions.use_slash_commands
. (#755)Support setting
with_message
parameter ofInteractionResponse.defer
for modal interactions toFalse
. (#758)- [ext.commands] Add a way to get the parent or root commands of slash commands. (#277)
[ext.commands] Introduce
commands.String
for 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.autocomplete
decoratorAdd
autocompleters
keyword-only argument toInjection
,inject
, andregister_injection
[ext.tasks] Add support for subclassing
ext.tasks.Loop
and using subclasses inext.tasks.loop()
decorator. (#655)
Bug Fixes¶
- Update incorrect channel edit method annotations. (#418)
Fix
sync_permissions
parameter type.Remove
topic
parameter 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
GuildSticker
limit to 5. (#531)Handle optional
Locale
instances (no longer create an enum value). (#533)- Update the type field handling for audit logs. (#535)
AuditLogDiff.type
objects are no longer alwaysChannelType
instances.
Dispatch
disnake.on_reaction_remove()
forThread
instances. (#536)Update
Guild.bitrate_limit
to use the correct value for theVIP_REGIONS
feature flag. (#538)Handle
ThreadAutoArchiveDuration
instances fordefault_auto_archive_duration
when editing channels. (#568)Assume that
None
is an empty channel name and keepchannel.name
a string. (#569)Remove the
$
prefix fromIDENTIFY
payload 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
PartialMessageable
for 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.duration
raisingKeyError
instead 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
COMMUNITY
feature for aGuild
. (#705)- Fix invalid widget fields. (#736)
Widget.invite_url
andWidget.fetch_invite
are now optional.WidgetMember.avatar
andWidgetMember.activity
now 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_count
andThread.total_message_sent
. (#747)[ext.commands] Handle
VoiceChannel
incommands.is_nsfw()
. (#536)[ext.commands] Handle
Union[User, Member]
annotations on slash commands arguments when using the decorator interface. (#584)[ext.commands] Change
has_permissions
andbot_has_permissions
checks to work with interations in guilds that only added theapplications.commands
scope, 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
Member
or aUser
indisnake.on_member_ban()
events. (#623)Update
InteractionReference.name
description, now includes group and subcommand. (#625, #648)Note that
Interaction.channel
may be aPartialMessageable
in inaccessible threads, in addition to DMs. (#632)Fix the grammatical errors in
Guild
channel 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
strict
parameter 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
COMMUNITY
feature 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
i18n
attribute onext.commands.Bot
andext.commands.InteractionBot
classes. (#652)[ext.commands] Document
commands.Injection
. (#669)[ext.commands] Improve documentation around using
None
forBot.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
flake8
as 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 compatibilty 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
towncrier
andsphinxcontrib-towncrier
to manage changelogs. (#600) Use
towncrier
for changelog management.Use
sphinxcontrib-towncrier
to 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__.py
files.Don’t use ambigious variable names.
Don’t use setattr and getattr with constant variable names.
Add
flake8-pytest-style
for linting pytest specific features with flake8. (#608)Replace all
TypeVar
instances withtyping_extensions.Self
across the entire library where possible. (#610)Remove the internal
fill_with_flags
decorator for flags classes and use the built inobject.__init_subclass__()
method. (#616, #660)Add
slice
toui.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.flags
todisnake.ext.commands.flag_converter
. (#667)Improve parallel documentation build speed. (#690)
Limit installation of
cchardet
in the[speed]
extra to Python versions below 3.10 (see aiohttp#6857). (#702)Update annotation and description of
options
parameter ofui.ActionRow.add_select
to matchui.Select
. (#744)Update typings to explicitly specify optional types for parameters with a
None
default. (#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
cchardet
in 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
GuildSticker
limit to 5. (#531)Handle optional
Locale
instances (no longer create an enum value). (#533)[ext.commands] Handle
VoiceChannel
incommands.is_nsfw()
. (#536)Dispatch
disnake.on_reaction_remove()
forThread
instances. (#536)Update
Guild.bitrate_limit
to use the correct value for theVIP_REGIONS
feature flag. (#538)Make all *InteractionData dataclasses dicts (
MessageInteractionData
,ApplicationCommandInteractionData
, and so on). (#549)Handle
ThreadAutoArchiveDuration
instances fordefault_auto_archive_duration
when editing channels. (#568)Assume that
None
is an empty channel name and keepchannel.name
a string. (#569)Remove the
$
prefix fromIDENTIFY
payload 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
PartialMessageable
for 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.name
description, 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_content
intent 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_permission
andcommands.guild_permissions
in favor of new fields/methods - see below for all new changes (#405)TextChannel.create_thread()
now requires either amessage
or atype
parameter (#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_first
parameter (#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
VoiceRegion
data class (#477)locale
attributes are now of typeLocale
instead ofstr
(#439)Invite.revoked
andThread.archiver_id
have been removed (deprecated in 2.4) (#455)Slash command names and option names are no longer automatically converted to lowercase, an
InvalidArgument
exception is now raised instead (#422)The
interaction
parameter ofui.Item.callback()
can no longer be passed as a kwarg (#311)The
youtube
,awkword
andsketchy_artist
PartyType
s 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
LargeInt
now 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.summary
andIntegrationApplication.summary
are deprecated, use.description
instead (#369)The
suppress
parameter 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
ForumChannel
Add
CategoryChannel.create_forum_channel
,Guild.create_forum_channel
Add
pinned
parameter toThread.edit()
Add
Permissions.create_forum_threads
, alias ofsend_messages
- Add application command localizations, see Localizations (#269)
Most
name
anddescription
parameters now also accept aLocalized
objectUpdate docstring parsing to accommodate for localizations
Add
Client.i18n
Add
localization_provider
andstrict_localization
parameters toClient
Add
with_localizations
parameter toClient.fetch_global_commands()
,Client.fetch_guild_commands()
Add localization example
- Support permissions v2, see Permissions (#405)
- Breaking changes:
Remove support for
default_permission
Remove
GuildApplicationCommandPermissions.edit()
,PartialGuildApplicationCommandPermissions
,UnresolvedGuildApplicationCommandPermissions
Remove
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
GuildCommandInteraction
annotation to automatically setdm_permission=False
instead of adding a local check, remove support for subcommandsAdd
ApplicationCommandPermissionType
enum, change type ofApplicationCommandPermissions.type
to support channel targets[ext.commands] Remove
guild_permissions()
decorator[ext.commands] Remove
sync_permissions
parameter fromBot
- New features:
Add
dm_permission
anddefault_member_permissions
parameters to application command objects and decoratorsAdd
dm_permission
,default_member_permissions
attributes toApplicationCommand
andInvokableApplicationCommand
Add
ApplicationCommandPermissions.is_everyone()
andApplicationCommandPermissions.is_all_channels()
Add
AuditLogAction.application_command_permission_update
enum 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]
inoption
parameter 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
reason
parameter inMessage.create_thread()
andThread.delete()
(#366)Add
StageInstance.guild_scheduled_event
andStageInstance.guild_scheduled_event_id
(#394)Add
SessionStartLimit
andClient.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.image
for scheduled event images (#432)Add
notify_everyone
parameter toStageChannel.create_instance()
(#440)Add
to_file()
method to assets, emojis, stickers (#443, #475)Add
on_thread_create()
event (#445)Support
reason
parameter inThread.edit()
(#454)Add
default_auto_archive_duration
parameter toGuild.create_text_channel()
, addnsfw
parameter toGuild.create_voice_channel()
(#456)Allow providing
attachments=None
to 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_at
andInteraction.is_expired
, automatically fall back to message edit/delete if interaction expired (#469)Add
suppress_embeds
parameter to message send methods (#474)Add
VoiceRegion
(replacing voice region enum),Client.fetch_voice_regions()
,Guild.fetch_voice_regions()
(#477)Add
Member.role_icon
property (#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
GuildScheduledEventConverter
andGuildScheduledEventNotFound
(#376)[ext.commands] Add
extras
to application commands (#483)[ext.commands] Add
slash_command_attrs
,user_command_attrs
andmessage_command_attrs
Cog
parameters (#501)
Bug Fixes¶
Improve components exception message (#352)
Use proper HTTP method for joining threads, remove unused methods (#356)
Fix missing
create_public_threads
permission inPermissions.private_channel
(#373)Improve
abc.Messageable.send()
typing and fix annotations of HTTP methods (#378)Fix shadowed
disnake.message
module (#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
content
parameters in send/edit methods to be positional (#411)Fix gateway ratelimiter being too strict (#413)
Fix caching of stage instances andd scheduled events (#416)
Improve
PartialMessageable
channel 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
after
parameter ofGuild.audit_logs()
(#473)Add
__str__
toApplicationCommand
, improve sync debug output (#478)Don’t require a
topic
when creating a stage channel (#480)Update and add missing overloads (#482)
Make
disnake.types.interactions
importable at runtime (#493)Raise
TypeError
instead of silently returning when trying to defer an unsupported interaction type (#505)Fix delay of
after
callback inAudioPlayer
when stopping (#508)[ext.commands] Make conversion exceptions in slash commands propagate cleanly as documented (#362)
[ext.commands] Fix
clean_content
converter (#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_threads
permission 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
content
parameters in send/edit methods to be positional (#411)Fix gateway ratelimiter being too strict (#413)
Fix caching of stage instances andd scheduled events (#416)
Improve
PartialMessageable
channel handling (#426)Fix delay of
after
callback inAudioPlayer
when stopping (#508)Change the default guild
GuildSticker
limit to 5. (#531)Dispatch
disnake.on_reaction_remove()
forThread
instances. (#536)Update
Guild.bitrate_limit
to use the correct value for theVIP_REGIONS
feature flag. (#538)Remove the
$
prefix fromIDENTIFY
payload properties. (#572)Fix opus function calls on arm64 macOS. (#620)
Improve channel/guild fallback in resolved interaction data, using
PartialMessageable
for unhandled/unknown channels instead of usingNone
. (#646)[ext.commands] Fix
clean_content
converter (#396)[ext.commands] Support interactions in
UserConverter
,MemberConverter
(#429)[ext.commands] Fix unloading of listeners with custom names (#444)
[ext.commands] Handle
VoiceChannel
incommands.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
ApplicationCommand
and its subtypes no longer accepts**kwargs
for setting internal values (#249) This shouldn’t affect anyone, as
**kwargs
was only used for setting fields returned by the API and had no effect if the user set them
- The constructor of
Interaction.permissions
now returns proper permission values in DMs (#321)The
reason
parameter for sticker endpoints inHTTPClient
is now kwarg-only
Deprecations¶
New Features¶
Add
Interaction.locale
andInteraction.guild_locale
properties to interactions (#225)Add
ui.ActionRow
andcomponents
kwarg to send methods (#224)- Add
ui.WrappedComponent
as a base class for all UI components (#253) ui.Item
now inherits fromui.WrappedComponent
. It’s no longer a base class for all UI components.
- Add
- Implement modals and text inputs (#253)
Add
TextInput
component.Add
ui.Modal
as a high-level implementation of modals.Add
ui.TextInput
for modals. It inherits fromui.WrappedComponent
and 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_extensions
andutils.search_directory()
(#245)[ext.commands] Add
commands.LargeInt
(#264)Add
with_message
parameter 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_level
andPartialInviteGuild.vanity_url_code
(#297)Add
Thread.create_timestamp
(#285)Add
Message.thread
(#291)Add
Permissions.events
andPermissions.private_channel
, improve existing factory methods (#286, #321)Support images in
GuildScheduledEvent
(#280)Add
PartyType.sketch_heads
andPartyType.ocho
(#306)Interaction.bot
,Interaction.client
,Interaction.channel
andInteraction.channel_id
are no longer optional (#279)Support timeouts in
abc.GuildChannel.permissions_for()
and other channel types (#289)Support
disnake.Attachment
options in slash commands (#226)Add
attachments
parameter toInteractionResponse.edit_message()
(#335)Add
Guild.get_or_fetch_members()
with an aliasGuild.getch_members()
(#322).Add
abc.GuildChannel.jump_url
,DMChannel.jump_url
andThread.jump_url
(#319)
Bug Fixes¶
Fix missing support for
reason
parameter in some methods (#266)Improve validation of slash command and option names (#267)
[ext.commands] Fix typing of
ctx
parameter 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
permissions
annotation ofabc.GuildChannel.set_permissions()
(#349)Fix
tasks.loop
usage 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
View
with URL buttons that resulted in therow
attribute being reset (#252)[ext.commands] Fix
MessageConverter
not 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()
usingStagePrivacyLevel
instead ofGuildScheduledEventPrivacyLevel
(#263)[ext.commands] Fix exceptions that occurred when using a
Union
in a slash command parameter annotation[ext.commands] Fix dynamic command cooldowns (#320)
Fix type-checking of
guild_ids
/test_guilds
parameters 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.0
to>=3.7.0,<3.9.0
Due to the upcoming text-in-voice feature (not yet released at the time of writing), many methods/properties that previously returned a
TextChannel
can 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_command
may now also returnSubCommandGroup
orSubCommand
instances, see documentationdisnake.types.ThreadArchiveDuration
is nowThreadArchiveDurationLiteral
, to avoid confusion with the newThreadArchiveDuration
enum
Deprecations¶
The
role_ids
anduser_ids
parameters forguild_permissions
are nowroles
andusers
respectively; 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_event
parameter onabc.GuildChannel.create_invite()
guild_scheduled_event_id
parameter onClient.fetch_invite()
Include
event
URL parameter inInvite.url
if applicableSupport parsing scheduled event ID from invite URLs
- Add guild timeouts (#161, #221, #223)
timeout
parameter onMember.edit()
New permission:
Permissions.moderate_members
- Add preliminary support for text-in-voice (#162, #177)
Many methods/properties that previously returned a
TextChannel
can 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
nsfw
andslowmode_delay
values/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
VoiceChannel
now inherits fromabc.Messageable
New
VoiceChannel
properties:.nsfw
,.slowmode_delay
,.last_message_id
,.last_message
New
VoiceChannel
methods:.is_nsfw
,.get_partial_message
nsfw
andslowmode_delay
parameters 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_count
andGuild.approximate_presence_count
(available on manually fetched guilds) (#139)Add
ThreadArchiveDuration
enum, 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 aPermissions
instance (using aPermissions
annotation)Add
AppInfo.flags
[ext.commands] Add
channel_types
parameter toParam
/ParamInfo
(#130)Add support for setting
slowmode_delay
on thread creation (TextChannel.create_thread()
,Message.create_thread()
) (#132)Add
invitable
parameter toTextChannel.create_thread()
(#132)Add
fail_if_not_exists
parameter toMessage.reply()
(#199, #211)[ext.commands]
Bot.get_slash_command
now 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
,AppCommandInteraction
Add a base class for warnings emitted by this library,
DiscordWarning
(#118)Add new warnings (emitted instead of just using
print
for 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.status
on member parameters for commands) (#182, #213)Fix return type annotation of
ui.button()
andui.select()
decorators (#163)Fix incorrect URL returned by
Template.url
Fix sending local files in embeds with interactions/webhooks if only one embed was specified (#193)
Fix leftover uses of
json
, which didn’t useorjson
if available (#184)Fix
Message.channel
type beingDMChannel
for 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
color
tocolour
(#153)Add documentation for new guild feature values (#148)
- Add documentation for several methods/properties: (#153)
Fix incorrect type for
Invite.channel
in 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_command
in autocomplete callbacksFix
Select.append_option
not raising an error if 25 options have already been addedImprove check for
options
parameter 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
versionadded
tagsAdd documentation for
InteractionBot
andAutoShardedInteractionBot
v2.2.1¶
Bug Fixes¶
Fixed error related to guild member count
v2.2.0¶
New Features¶
Add kwarg
attachments
to edit methodsAdd kwargs
file
andfiles
toInteractionResponse.edit_message()
,PartialMessage.edit()
andMessage.edit()
Add kwarg
file
toEmbed.set_image()
andEmbed.set_thumbnail()
Add kwarg
delay
toInteraction.delete_original_message()
andWebhookMessage.delete()
Add kwarg
delete_after
toInteractionResponse.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
UnresolvedGuildApplicationCommandPermissions
Add kwargs
min_value
andmax_value
inOption
[ext.commands] Add kwarg
min_value
(with aliasesge
,gt
) toParam
[ext.commands] Add kwarg
max_value
(with aliasesle
,lt
) toParam
[ext.commands] Add kwarg
owner
toguild_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
PartialGuildApplicationCommandPermissions
Add
ApplicationCommandInteraction.filled_options
property[ext.commands] Add
InteractionBot
[ext.commands] Add
guild_permissions
[ext.commands] Add kwargs
sync_commands_on_cog_unload
andsync_permissions
toInteractionBotBase
Bug Fixes¶
Music
default_permission
kwarg 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.
Interaction
is now the base class for other interaction types, such asApplicationCommandInteraction
andMessageInteraction
.Add interaction data wrappers:
ApplicationCommandInteractionData
andMessageInteractionData
.Add interaction data option wrapper:
ApplicationCommandInteractionDataOption
Add
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 invokable slash commands and context menus.[ext.commands] Add
InvokableSlashCommand
for slash command management.[ext.commands] Add
SubCommand
for slash sub-command management.[ext.commands] Add
SubCommandGroup
for slash sub-command group management.[ext.commands] Add
InvokableUserCommand
for user command management (context menus).[ext.commands] Add
InvokableMessageCommand
for message command management (context menus).[ext.commands] Add
ParamInfo
for wrapping annotations.[ext.commands] Add
slash_command
for slash command definitions.[ext.commands] Add
user_command
for user command definitions (context menus).[ext.commands] Add
message_command
for message command definitions (context menus).[ext.commands] Add
Param
(with an aliasparam
) in caseParamInfo
causes linter errors.[ext.commands] Add
Bot.slash_command
for slash command definitions.[ext.commands] Add
Bot.user_command
for user command definitions (context menus).[ext.commands] Add
Bot.message_command
for 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.