Changelog¶
This page keeps a detailed human friendly rendering of what’s new and changed in specific versions.
v2.3.2¶
Bug Fixes¶
Fix the
name
parameter not being respected when sending aCustomActivity
.Fix
Intents.emoji
andIntents.emojis_and_stickers
having swapped alias values (GH-9471).Fix
NameError
when usingabc.GuildChannel.create_invite()
(GH-9505).Fix crash when disconnecting during the middle of a
HELLO
packet when usingAutoShardedClient
.Fix overly eager escape behaviour for lists and header markdown in
utils.escape_markdown()
(GH-9516).Fix voice websocket not being closed before being replaced by a new one (GH-9518).
[ext.commands] Fix the wrong
on_help_command_error()
being called when ejected from a cog.[ext.commands] Fix
=None
being displayed insignature
.
v2.3.1¶
Bug Fixes¶
Fix username lookup in
Guild.get_member_named()
(GH-9451).- Use cache data first for
Interaction.channel
instead of API data. This bug usually manifested in incomplete channel objects (e.g. no
overwrites
) because Discord does not provide this data.
- Use cache data first for
Fix false positives in
PartialEmoji.from_str()
inappropriately settinganimated
toTrue
(GH-9456, GH-9457).Fix certain select types not appearing in
Message.components
(GH-9462).[ext.commands] Change lookup order for
MemberConverter
andUserConverter
to prioritise usernames instead of nicknames.
v2.3.0¶
New Features¶
- Add support for the new username system (also known as “pomelo”).
Add
User.global_name
to get their global nickname or “display name”.Update
User.display_name
andMember.display_name
to understand global nicknames.Update
__str__
forUser
to drop discriminators if the user has been migrated.Update
Guild.get_member_named()
to work with migrated users.Update
User.default_avatar
to work with migrated users.[ext.commands] Update user and member converters to understand migrated users.
Add
DefaultAvatar.pink
for new pink default avatars.Add
Colour.pink()
to get the pink default avatar colour.- Add support for voice messages (GH-9358)
This does not support sending voice messages because this is currently unsupported by the API.
Add support for new
Interaction.channel
attribute from the API update (GH-9339).Add support for
TextChannel.default_thread_slowmode_delay
(GH-9291).Add support for
ForumChannel.default_sort_order
(GH-9290).Add support for
default_reaction_emoji
anddefault_forum_layout
inGuild.create_forum()
(GH-9300).Add support for
widget_channel
,widget_enabled
, andmfa_level
inGuild.edit()
(GH-9302, GH-9303).- Add various new
Permissions
and changes (GH-9312, GH-9325, GH-9358, GH-9378) Add new
manage_expressions
,use_external_sounds
,use_soundboard
,send_voice_messages
,create_expressions
permissions.Change
Permissions.manage_emojis
to be an alias ofmanage_expressions
.
- Add various new
Add various new properties to
PartialAppInfo
andAppInfo
(GH-9298).Add support for
with_counts
parameter toClient.fetch_guilds()
(GH-9369).Add new
Guild.get_emoji()
helper (GH-9296).Add
Guild.max_stage_video_users
andGuild.safety_alerts_channel
(GH-9318).Add support for
raid_alerts_disabled
andsafety_alerts_channel
inGuild.edit()
(GH-9318).[ext.commands] Add
BadLiteralArgument.argument
to get the failed argument’s value (GH-9283).[ext.commands] Add
Context.filesize_limit
property (GH-9416).[ext.commands] Add support for
Parameter.displayed_name
(GH-9427).
Bug Fixes¶
- Fix
FileHandler
handlers being written ANSI characters when the bot is executed inside PyCharm. This has the side effect of removing coloured logs from the PyCharm terminal due an upstream bug involving TTY detection. This issue is tracked under PY-43798.
- Fix
Fix channel edits with
Webhook.edit()
sending two requests instead of one.Fix
StageChannel.last_message_id
always beingNone
(GH-9422).Fix piped audio input ending prematurely (GH-9001, GH-9380).
Fix persistent detection for
ui.TextInput
being incorrect if thecustom_id
is set later (GH-9438).Fix custom attributes not being copied over when inheriting from
app_commands.Group
(GH-9383).Fix AutoMod audit log entry error due to empty channel_id (GH-9384).
Fix handling of
around
parameter inabc.Messageable.history()
(GH-9388).Fix occasional
AttributeError
when accessing theClientUser.mutual_guilds
property (GH-9387).Fix
utils.escape_markdown()
not escaping the new markdown (GH-9361).Fix webhook targets not being converted in audit logs (GH-9332).
Fix error when not passing
enabled
inGuild.create_automod_rule()
(GH-9292).Fix how various parameters are handled in
Guild.create_scheduled_event()
(GH-9275).Fix not sending the
ssrc
parameter when sending the SPEAKING payload (GH-9301).Fix
Message.guild
beingNone
sometimes when received via an interaction.Fix
Message.system_content
forMessageType.channel_icon_change
(GH-9410).
Miscellaneous¶
Update the base
Guild.filesize_limit
to 25MiB (GH-9353).Allow Interaction webhook URLs to be used in
Webhook.from_url()
.Set the socket family of internal connector to
AF_INET
to prevent IPv6 connections (GH-9442, GH-9443).
v2.2.3¶
Bug Fixes¶
Fix crash from Discord sending null
channel_id
for automod audit logs.Fix
channel
edits when usingWebhook.edit()
sending two requests.Fix
AuditLogEntry.target
beingNone
for invites (GH-9336).Fix
KeyError
when accessing data forGuildSticker
(GH-9324).
v2.2.2¶
Bug Fixes¶
v2.2.0¶
New Features¶
Add support for new
on_audit_log_entry_create()
event- Add support for silent messages via
silent
parameter inabc.Messageable.send()
This is queryable via
MessageFlags.suppress_notifications
- Add support for silent messages via
Implement
abc.Messageable
forStageChannel
(GH-9248)Add setter for
discord.ui.ChannelSelect.channel_types
(GH-9068)Add support for custom messages in automod via
AutoModRuleAction.custom_message
(GH-9267)Add
StageChannel.slowmode_delay
andVoiceChannel.slowmode_delay
(GH-9111)Add support for editing the slowmode for
StageChannel
andVoiceChannel
(GH-9111)Add
delete_after
keyword argument toInteraction.edit_message()
(GH-9415)Add
delete_after
keyword argument toInteractionMessage.edit()
(GH-9206)- Add support for member flags (GH-9204)
Accessible via
Member.flags
and has a type ofMemberFlags
Support
bypass_verification
withinMember.edit()
- Add support for passing a client to
Webhook.from_url()
andWebhook.partial()
This allows them to use views (assuming they are “bot owned” webhooks)
- Add support for passing a client to
Add
Colour.dark_embed()
andColour.light_embed()
(GH-9219)Add support for many more parameters within
Guild.create_stage_channel()
(GH-9245)Add support for
ForumChannel.default_layout
Add various new
MessageType
values such as ones related to stage channel and role subscriptions- Add support for role subscription related attributes
Add support for checking if a role is a linked role under
RoleTags.is_guild_connection()
Add support for GIF sticker type
Add support for
Message.application_id
andMessage.position
Add
utils.maybe_coroutine()
helperAdd
ScheduledEvent.creator_id
attribute[ext.commands] Add support for
interaction_check()
forGroupCog
(GH-9189)
Bug Fixes¶
Fix views not being removed from message store backing leading to a memory leak when used from an application command context
Fix async iterators requesting past their bounds when using
oldest_first
andafter
orbefore
(GH-9093)Fix
Guild.audit_logs()
pagination logic being buggy when usingafter
(GH-9269)Fix
Message.channel
sometimes beingObject
instead ofPartialMessageable
Fix
ui.View
not properly callingsuper().__init_subclass__
(GH-9231)Fix
available_tags
anddefault_thread_slowmode_delay
not being respected inGuild.create_forum()
Fix
AutoModTrigger
ignoringallow_list
with type keyword (GH-9107)Fix
AutoModRule.edit()
to work with actual snowflake types such asObject
(GH-9159)Fix
Webhook.send()
returningForumChannel
forWebhookMessage.channel
When a lookup for
AuditLogEntry.target
fails, it will fallback toObject
with the appropriateObject.type
(GH-9171)Fix
AuditLogDiff.type
for integrations returningChannelType
instead ofstr
(GH-9200)Fix
AuditLogDiff.type
for webhooks returningChannelType
instead ofWebhookType
(GH-9251)Fix webhooks and interactions not properly closing files after the request has completed
Fix
NameError
in audit log target for app commandsFix
ScheduledEvent.edit()
requiring some arguments to be passed in when unnecessary (GH-9261, GH-9268)[ext.commands] Explicit set a traceback for hybrid command invocations (GH-9205)
Miscellaneous¶
Add colour preview for the colours predefined in
Colour
Finished views are no longer stored by the library when sending them (GH-9235)
Force enable colour logging for the default logging handler when run under Docker.
Add various overloads for
Client.wait_for()
to aid in static analysis (GH-9184)Interaction
can now optionally take a generic parameter,ClientT
to represent the type forInteraction.client
[ext.commands] Respect
ignore_extra
forFlagConverter
keyword-only parameters[ext.commands] Change
Paginator.pages
to not prematurely close (GH-9257)
v2.1.1¶
Bug Fixes¶
Fix crash involving GIF stickers when looking up their filename extension.
v2.1.0¶
New Features¶
Add support for
delete_message_seconds
inGuild.ban()
(GH-8391)Add support for automod related audit log actions (GH-8389)
Add support for
ForumChannel
annotations in app commandsAdd support for
ForumChannel.default_thread_slowmode_delay
.Add support for
ForumChannel.default_reaction_emoji
.- Add support for forum tags under
ForumTag
. Tags can be obtained using
ForumChannel.available_tags
orForumChannel.get_tag()
.See
Thread.edit()
andForumChannel.edit()
for modifying tags and their usage.
- Add support for forum tags under
- Add support for new select types (GH-9013, GH-9003).
These are split into separate classes,
ChannelSelect
,RoleSelect
,UserSelect
,MentionableSelect
.The decorator still uses a single function,
select()
. Changing the select type is done by thecls
keyword parameter.
Add support for toggling discoverable and invites_disabled features in
Guild.edit()
(GH-8390).Add
Interaction.translate()
helper method (GH-8425).Add
Forum.archived_threads()
(GH-8476).Add
ApplicationFlags.active
,UserFlags.active_developer
, andPublicUserFlags.active_developer
.Add
delete_after
toInteractionResponse.send_message()
(GH-9022).Add support for
AutoModTrigger.regex_patterns
.[ext.commands] Add
GroupCog.group_extras
to setapp_commands.Group.extras
(GH-8405).[ext.commands] Add support for NumPy style docstrings for regular commands to set parameter descriptions.
[ext.commands] Allow
Greedy
to potentially maintain state between calls.[ext.commands] Add
Cog.has_app_command_error_handler
(GH-8991).[ext.commands] Allow
delete_after
inContext.send
on ephemeral messages (GH-9021).
Bug Fixes¶
Fix an
KeyError
being raised when constructingapp_commands.Group
with no module (GH-8411).Fix unescaped period in webhook URL regex (GH-8443).
Fix
app_commands.CommandSyncFailure
raising for other 400 status code errors.Fix potential formatting issues showing _errors in
app_commands.CommandSyncFailure
.Fix
Guild.stage_instances
andGuild.schedule_events
clearing onGUILD_UPDATE
.Fix detection of overriden
app_commands.Group.on_error()
Fix
app_commands.CommandTree.on_error()
still being called when a bound error handler is set.Fix thread permissions being set to
True
inDMChannel.permissions_for()
(GH-8965).Fix
on_scheduled_event_delete
occasionally dispatching with too many parameters (GH-9019).[ext.commands] Fix
Context.from_interaction
ignoringcommand_failed
.[ext.commands] Fix
Range
to allow 3.10 Union syntax (GH-8446).[ext.commands] Fix
before_invoke
not triggering for fallback commands in a hybrid group command (GH-8461, GH-8462).
Miscellaneous¶
Change error message for unbound callbacks in
app_commands.ContextMenu
to make it clearer that bound methods are not allowed.Normalize type formatting in TypeError exceptions (GH-8453).
Change
VoiceProtocol.on_voice_state_update()
andVoiceProtocol.on_voice_server_update()
parameters to be positional only (GH-8463).Add support for PyCharm when using the default coloured logger (GH-9015).
v2.0.1¶
Bug Fixes¶
Fix
cchardet
being installed on Python >=3.10 when using thespeed
extras.Fix
ui.View
timeout updating when theui.View.interaction_check()
failed.Fix
app_commands.CommandTree.on_error()
not triggering ifinteraction_check()
raises.Fix
__main__
script to useimportlib.metadata
instead of the deprecatedpkg_resources
.- Fix library callbacks triggering a type checking error if the parameter names were different.
This required a change in the Version Guarantees
[ext.commands] Fix Python 3.10 union types not working with
commands.Greedy
.
v2.0.0¶
The changeset for this version are too big to be listed here, for more information please see the migrating page.
v1.7.3¶
Bug Fixes¶
Fix a crash involving guild uploaded stickers
Fix
DMChannel.permissions_for()
not havingPermissions.read_messages
set.
v1.7.2¶
Bug Fixes¶
Fix
fail_if_not_exists
causing certain message references to not be usable withinabc.Messageable.send()
andMessage.reply()
(GH-6726)Fix
Guild.chunk()
hanging when the user left the guild. (GH-6730)Fix loop sleeping after final iteration rather than before (GH-6744)
v1.7.1¶
Bug Fixes¶
[ext.commands] Fix
Cog.has_error_handler
not working as intended.
v1.7.0¶
This version is mainly for improvements and bug fixes. This is more than likely the last major version in the 1.x series. Work after this will be spent on v2.0. As a result, this is the last version to support Python 3.5. Likewise, this is the last version to support user bots.
Development of v2.0 will have breaking changes and support for newer API features.
New Features¶
Add support for stage channels via
StageChannel
(GH-6602, GH-6608)- Add support for
MessageReference.fail_if_not_exists
(GH-6484) By default, if the message you’re replying to doesn’t exist then the API errors out. This attribute tells the Discord API that it’s okay for that message to be missing.
- Add support for
Add support for Discord’s new permission serialisation scheme.
Add an easier way to move channels using
abc.GuildChannel.move()
Add
Permissions.use_slash_commands
Add support for voice regions in voice channels via
VoiceChannel.rtc_region
(GH-6606)Add support for
PartialEmoji.url_as()
(GH-6341)Add
File.spoiler
(GH-6317)Add support for passing
roles
toGuild.estimate_pruned_members()
(GH-6538)Allow callable class factories to be used in
abc.Connectable.connect()
(GH-6478)Add a way to get mutual guilds from the client’s cache via
User.mutual_guilds
(GH-2539, GH-6444)PartialMessage.edit()
now returns a fullMessage
upon success (GH-6309)AuditLogEntry
is now hashable (GH-6495)Attachment
is now hashableAdd
Attachment.content_type
attribute (GH-6618)Add support for casting
Attachment
tostr
to get the URL.- Add
seed
parameter forColour.random
(GH-6562) This only seeds it for one call. If seeding for multiple calls is desirable, use
random.seed()
.
- Add
Add a
utils.remove_markdown()
helper function (GH-6573)Add support for passing scopes to
utils.oauth_url()
(GH-6568)[ext.commands] Add support for
rgb
CSS function as a parameter toColourConverter
(GH-6374)[ext.commands] Add support for converting
StoreChannel
viaStoreChannelConverter
(GH-6603)[ext.commands] Add support for stripping whitespace after the prefix is encountered using the
strip_after_prefix
Bot
constructor parameter.[ext.commands] Add
Context.invoked_parents
to get the aliases a command’s parent was invoked with (GH-1874, GH-6462)[ext.commands] Add a converter for
PartialMessage
underext.commands.PartialMessageConverter
(GH-6308)[ext.commands] Add a converter for
Guild
underext.commands.GuildConverter
(GH-6016, GH-6365)- [ext.commands] Add
Command.has_error_handler
This is also adds
Cog.has_error_handler
- [ext.commands] Add
[ext.commands] Allow callable types to act as a bucket key for cooldowns (GH-6563)
[ext.commands] Add
linesep
keyword argument toPaginator
(GH-5975)[ext.commands] Allow
None
to be passed toHelpCommand.verify_checks
to only verify in a guild context (GH-2008, GH-6446)[ext.commands] Allow relative paths when loading extensions via a
package
keyword argument (GH-2465, GH-6445)
Bug Fixes¶
Fix mentions not working if
mention_author
is passed inabc.Messageable.send()
withoutClient.allowed_mentions
set (GH-6192, GH-6458)- Fix user created instances of
CustomActivity
triggering an error (GH-4049) Note that currently, bot users still cannot set a custom activity due to a Discord limitation.
- Fix user created instances of
Fix
ZeroDivisionError
being raised fromVoiceClient.average_latency
(GH-6430, GH-6436)Fix
User.public_flags
not updating upon edit (GH-6315)Fix
Message.call
sometimes causing attribute errors (GH-6390)Fix issue resending a file during request retries on newer versions of
aiohttp
(GH-6531)Raise an error when
user_ids
is empty inGuild.query_members()
Fix
__str__
magic method raising when aGuild
is unavailable.Fix potential
AttributeError
when accessingVoiceChannel.members
(GH-6602)Embed
constructor parameters now implicitly convert tostr
(GH-6574)Ensure
discord
package is only run if executed as a script (GH-6483)[ext.commands] Fix irrelevant commands potentially being unloaded during cog unload due to failure.
[ext.commands] Fix attribute errors when setting a cog to
HelpCommand
(GH-5154)[ext.commands] Fix
Context.invoked_with
being improperly reassigned during areinvoke()
(GH-6451, GH-6462)[ext.commands] Remove duplicates from
HelpCommand.get_bot_mapping
(GH-6316)[ext.commands] Properly handle positional-only parameters in bot command signatures (GH-6431)
[ext.commands] Group signatures now properly show up in
Command.signature
(GH-6529, GH-6530)
Miscellaneous¶
User endpoints and all userbot related functionality has been deprecated and will be removed in the next major version of the library.
Permission
class methods were updated to match the UI of the Discord client (GH-6476)_
and-
characters are now stripped when making a new cog using thediscord
package (GH-6313)
v1.6.0¶
This version comes with support for replies and stickers.
New Features¶
- An entirely redesigned documentation. This was the cumulation of multiple months of effort.
There’s now a dark theme, feel free to navigate to the cog on the screen to change your setting, though this should be automatic.
Add support for
AppInfo.icon_url_as()
andAppInfo.cover_image_url_as()
(GH-5888)Add
Colour.random()
to get a random colour (GH-6067)- Add support for replying via
Message.reply()
(GH-6061) This also comes with the
AllowedMentions.replied_user
setting.abc.Messageable.send()
can now accept aMessageReference
.MessageReference
can now be constructed by users.Message.to_reference()
can now convert a message to aMessageReference
.
- Add support for replying via
Add support for getting the replied to resolved message through
MessageReference.resolved
.- Add support for role tags.
Guild.premium_subscriber_role
to get the “Nitro Booster” role (if available).Guild.self_role
to get the bot’s own role (if available).Role.tags
to get the role’s tags.Role.is_premium_subscriber()
to check if a role is the “Nitro Booster” role.Role.is_bot_managed()
to check if a role is a bot role (i.e. the automatically created role for bots).Role.is_integration()
to check if a role is role created by an integration.
- Add
Client.is_ws_ratelimited()
to check if the websocket is rate limited. ShardInfo.is_ws_ratelimited()
is the equivalent for checking a specific shard.
- Add
Add support for chunking an
AsyncIterator
throughAsyncIterator.chunk()
(GH-6100, GH-6082)- Add support for editing and deleting webhook sent messages (GH-6058)
This adds
WebhookMessage
as well to power this behaviour.
- Add
PartialMessage
to allow working with a message via channel objects and just a message_id (GH-5905) This is useful if you don’t want to incur an extra API call to fetch the message.
- Add
Add
Emoji.url_as()
(GH-6162)Add support for
Member.pending
for the membership gating feature.Allow
colour
parameter to takeint
inGuild.create_role()
(GH-6195)Add support for
presences
inGuild.query_members()
(GH-2354)[ext.commands] Add support for
description
keyword argument incommands.Cog
(GH-6028)[ext.tasks] Add support for calling the wrapped coroutine as a function via
__call__
.
Bug Fixes¶
Raise
DiscordServerError
when reaching 503s repeatedly (GH-6044)Fix
AttributeError
whenClient.fetch_template()
is called (GH-5986)Fix errors when playing audio and moving to another channel (GH-5953)
Fix
AttributeError
when voice channels disconnect too fast (GH-6039)Fix stale
User
references when the members intent is off.Fix
on_user_update()
not dispatching in certain cases when a member is not cached but the user somehow is.- Fix
Message.author
being overwritten in certain cases during message update. This would previously make it so
Message.author
is aUser
.
- Fix
Fix
UnboundLocalError
for editingpublic_updates_channel
inGuild.edit()
(GH-6093)Fix uninitialised
CustomActivity.created_at
(GH-6095)[ext.commands] Errors during cog unload no longer stops module cleanup (GH-6113)
[ext.commands] Properly cleanup lingering commands when a conflicting alias is found when adding commands (GH-6217)
Miscellaneous¶
ffmpeg
spawned processes no longer open a window in Windows (GH-6038)Update dependencies to allow the library to work on Python 3.9+ without requiring build tools. (GH-5984, GH-5970)
Fix docstring issue leading to a SyntaxError in 3.9 (GH-6153)
Update Windows opus binaries from 1.2.1 to 1.3.1 (GH-6161)
Allow
Guild.create_role()
to acceptint
as thecolour
parameter (GH-6195)[ext.commands]
MessageConverter
regex got updated to supportwww.
prefixes (GH-6002)[ext.commands]
UserConverter
now fetches the API if an ID is passed and the user is not cached.[ext.commands]
max_concurrency
is now called before cooldowns (GH-6172)
v1.5.1¶
Bug Fixes¶
Fix
utils.escape_markdown()
not escaping quotes properly (GH-5897)Fix moving channels to the end of the channel list (GH-5923)
Fix seemingly strange behaviour in
__eq__
forPermissionOverwrite
(GH-5929)Fix the bot disconnecting from voice when moving them to another channel (GH-5904)
Fix attribute errors when chunking times out sometimes during delayed on_ready dispatching.
Ensure that the bot’s own member is not evicted from the cache (GH-5949)
Miscellaneous¶
Members are now loaded during
GUILD_MEMBER_UPDATE
events ifMemberCacheFlags.joined
is set. (GH-5930)- [ext.commands]
MemberConverter
now properly lazily fetches members if not available from cache. This is the same as having
discord.Member
as the type-hint.
- [ext.commands]
Guild.chunk()
now allows concurrent calls without spamming the gateway with requests.
v1.5.0¶
This version came with forced breaking changes that Discord is requiring all bots to go through on October 7th. It is highly recommended to read the documentation on intents, A Primer to Gateway Intents.
API Changes¶
Members and presences will no longer be retrieved due to an API change. See Privileged Intents for more info.
As a consequence, fetching offline members is disabled if the members intent is not enabled.
New Features¶
Support for gateway intents, passed via
intents
inClient
usingIntents
.Add
VoiceRegion.south_korea
(GH-5233)Add
Colour.dark_theme()
factory method (GH-1584)Add
AllowedMentions.none()
andAllowedMentions.all()
(GH-5785)Add more concrete exceptions for 500 class errors under
DiscordServerError
(GH-5797)Implement
VoiceProtocol
to better intersect the voice flow.Add
Guild.chunk()
to fully chunk a guild.Add
MemberCacheFlags
to better control member cache. See Member Cache for more info.- Add support for
ActivityType.competing
(GH-5823) This seems currently unused API wise.
- Add support for
Add support for message references,
Message.reference
(GH-5754, GH-5832)Add alias for
ColourConverter
underColorConverter
(GH-5773)Add alias for
PublicUserFlags.verified_bot_developer
underPublicUserFlags.early_verified_bot_developer
(GH-5849)[ext.commands] Add support for
require_var_positional
forCommand
(GH-5793)
Bug Fixes¶
Fix issue with
Guild.by_category()
not showing certain channels.Fix
abc.GuildChannel.permissions_synced
always beingFalse
(GH-5772)Fix handling of cloudflare bans on webhook related requests (GH-5221)
Fix cases where a keep-alive thread would ack despite already dying (GH-5800)
Fix cases where a
Member
reference would be stale when cache is disabled in message events (GH-5819)Fix
allowed_mentions
not being sent when sending a single file (GH-5835)Fix
overwrites
being ignored inabc.GuildChannel.edit()
if{}
is passed (GH-5756, GH-5757)[ext.commands] Fix exceptions being raised improperly in command invoke hooks (GH-5799)
[ext.commands] Fix commands not being properly ejected during errors in a cog injection (GH-5804)
[ext.commands] Fix cooldown timing ignoring edited timestamps.
[ext.tasks] Fix tasks extending the next iteration on handled exceptions (GH-5762, GH-5763)
Miscellaneous¶
Webhook requests are now logged (GH-5798)
Remove caching layer from
AutoShardedClient.shards
. This was causing issues if queried before launching shards.Gateway rate limits are now handled.
Warnings logged due to missed caches are now changed to DEBUG log level.
Some strings are now explicitly interned to reduce memory usage.
Usage of namedtuples has been reduced to avoid potential breaking changes in the future (GH-5834)
[ext.commands] All
BadArgument
exceptions from the built-in converters now raise concrete exceptions to better tell them apart (GH-5748)[ext.tasks] Lazily fetch the event loop to prevent surprises when changing event loop policy (GH-5808)
v1.4.2¶
This is a maintenance release with backports from v1.5.0.
Bug Fixes¶
Fix issue with
Guild.by_category()
not showing certain channels.Fix
abc.GuildChannel.permissions_synced
always beingFalse
(GH-5772)Fix handling of cloudflare bans on webhook related requests (GH-5221)
Fix cases where a keep-alive thread would ack despite already dying (GH-5800)
Fix cases where a
Member
reference would be stale when cache is disabled in message events (GH-5819)Fix
allowed_mentions
not being sent when sending a single file (GH-5835)Fix
overwrites
being ignored inabc.GuildChannel.edit()
if{}
is passed (GH-5756, GH-5757)[ext.commands] Fix exceptions being raised improperly in command invoke hooks (GH-5799)
[ext.commands] Fix commands not being properly ejected during errors in a cog injection (GH-5804)
[ext.commands] Fix cooldown timing ignoring edited timestamps.
[ext.tasks] Fix tasks extending the next iteration on handled exceptions (GH-5762, GH-5763)
Miscellaneous¶
Remove caching layer from
AutoShardedClient.shards
. This was causing issues if queried before launching shards.[ext.tasks] Lazily fetch the event loop to prevent surprises when changing event loop policy (GH-5808)
v1.4.1¶
Bug Fixes¶
Properly terminate the connection when
Client.close()
is called (GH-5207)Fix error being raised when clearing embed author or image when it was already cleared (GH-5210, GH-5212)
Fix
__path__
to allow editable extensions (GH-5213)
v1.4.0¶
Another version with a long development time. Features like Intents are slated to be released in a v1.5 release. Thank you for your patience!
New Features¶
- Add support for
AllowedMentions
to have more control over what gets mentioned. This can be set globally through
Client.allowed_mentions
This can also be set on a per message basis via
abc.Messageable.send()
- Add support for
AutoShardedClient
has been completely redesigned from the ground up to better suit multi-process clusters (GH-2654)Add
ShardInfo
which allows fetching specific information about a shard.The
ShardInfo
allows for reconnecting and disconnecting of a specific shard as well.Add
AutoShardedClient.get_shard()
andAutoShardedClient.shards
to get information about shards.Rework the entire connection flow to better facilitate the
IDENTIFY
rate limits.Add a hook
Client.before_identify_hook()
to have better control over what happens before anIDENTIFY
is done.Add more shard related events such as
on_shard_connect()
,on_shard_disconnect()
andon_shard_resumed()
.
- Add support for guild templates (GH-2652)
This adds
Template
to read a template’s information.Client.fetch_template()
can be used to fetch a template’s information from the API.Client.create_guild()
can now take an optional template to base the creation from.Note that fetching a guild’s template is currently restricted for bot accounts.
- Add support for guild integrations (GH-2051, GH-1083)
Integration
is used to read integration information.IntegrationAccount
is used to read integration account information.Guild.integrations()
will fetch all integrations in a guild.Guild.create_integration()
will create an integration.Integration.edit()
will edit an existing integration.Integration.delete()
will delete an integration.Integration.sync()
will sync an integration.There is currently no support in the audit log for this.
Add an alias for
VerificationLevel.extreme
underVerificationLevel.very_high
(GH-2650)Added
VoiceClient.latency
andVoiceClient.average_latency
(GH-2535)Add
use_cached
andspoiler
parameters toAttachment.to_file()
(GH-2577, GH-4095)Add
position
parameter support toGuild.create_category()
(GH-2623)Allow passing
int
for the colour inRole.edit()
(GH-4057)Add
Embed.remove_author()
to clear author information from an embed (GH-4068)Add the ability to clear images and thumbnails in embeds using
Embed.Empty
(GH-4053)Add
guild_ready_timeout
parameter toClient
and subclasses to control timeouts when theGUILD_CREATE
stream takes too long (GH-4112)Add support for public user flags via
User.public_flags
andPublicUserFlags
(GH-3999)Allow changing of channel types via
TextChannel.edit()
to and from a news channel (GH-4121)Add
Guild.edit_role_positions()
to bulk edit role positions in a single API call (GH-2501, GH-2143)Add
Guild.change_voice_state()
to change your voice state in a guild (GH-5088)Add
PartialInviteGuild.is_icon_animated()
for checking if the invite guild has animated icon (GH-4180, GH-4181)Add
PartialInviteGuild.icon_url_as()
now supportsstatic_format
for consistency (GH-4180, GH-4181)Add support for
user_ids
inGuild.query_members()
Add support for pruning members by roles in
Guild.prune_members()
(GH-4043)[ext.commands] Implement
before_invoke()
andafter_invoke()
decorators (GH-1986, GH-2502)[ext.commands] Add a way to retrieve
retry_after
from a cooldown in a command viaCommand.get_cooldown_retry_after
(GH-5195)[ext.commands] Add a way to dynamically add and remove checks from a
HelpCommand
(GH-5197)[ext.tasks] Add
Loop.is_running
method to the task objects (GH-2540)[ext.tasks] Allow usage of custom error handlers similar to the command extensions to tasks using
Loop.error
decorator (GH-2621)
Bug Fixes¶
Fix issue with
PartialEmoji.url
reads leading to a failure (GH-4015, GH-4016)Allow
abc.Messageable.history()
to take a limit of1
even ifaround
is passed (GH-4019)Fix
Guild.member_count
not updating in certain cases when a member has left the guild (GH-4021)Fix the type of
Object.id
not being validated. For backwards compatibilitystr
is still allowed but is converted toint
(GH-4002)Fix
Guild.edit()
not allowing editing of notification settings (GH-4074, GH-4047)Fix crash when the guild widget contains channels that aren’t in the payload (GH-4114, GH-4115)
Close ffmpeg stdin handling from spawned processes with
FFmpegOpusAudio
andFFmpegPCMAudio
(GH-4036)Fix
utils.escape_markdown()
not escaping masked links (GH-4206, GH-4207)Fix reconnect loop due to failed handshake on region change (GH-4210, GH-3996)
Fix
Guild.by_category()
not returning empty categories (GH-4186)Fix certain JPEG images not being identified as JPEG (GH-5143)
Fix a crash when an incomplete guild object is used when fetching reaction information (GH-5181)
Fix a timeout issue when fetching members using
Guild.query_members()
Fix an issue with domain resolution in voice (GH-5188, GH-5191)
Fix an issue where
PartialEmoji.id
could be a string (GH-4153, GH-4152)Fix regression where
Member.activities
would not clear.[ext.commands] A
TypeError
is now raised whentyping.Optional
is used withincommands.Greedy
(GH-2253, GH-5068)[ext.commands]
Bot.walk_commands
no longer yields duplicate commands due to aliases (GH-2591)[ext.commands] Fix regex characters not being escaped in
HelpCommand.clean_prefix
(GH-4058, GH-4071)[ext.commands] Fix
Bot.get_command
from raising errors when a name only has whitespace (GH-5124)[ext.commands] Fix issue with
Context.subcommand_passed
not functioning as expected (GH-5198)[ext.tasks] Task objects are no longer stored globally so two class instances can now start two separate tasks (GH-2294)
[ext.tasks] Allow cancelling the loop within
before_loop
(GH-4082)
Miscellaneous¶
The
Member.roles
cache introduced in v1.3 was reverted due to issues caused (GH-4087, GH-4157)- Some more API requests got a
reason
parameter for audit logs (GH-5086)
- Some more API requests got a
For performance reasons
websockets
has been dropped in favour ofaiohttp.ws
.The blocking logging message now shows the stack trace of where the main thread was blocking
The domain name was changed from
discordapp.com
todiscord.com
to prepare for the required domain migrationReduce memory usage when reconnecting due to stale references being held by the message cache (GH-5133)
Optimize
abc.GuildChannel.permissions_for()
by not creating as many temporary objects (20-32% savings).[ext.commands] Raise
CommandRegistrationError
instead ofClientException
when a duplicate error is registered (GH-4217)[ext.tasks] No longer handle
HTTPException
by default in the task reconnect loop (GH-5193)
v1.3.4¶
Bug Fixes¶
Fix an issue with channel overwrites causing multiple issues including crashes (GH-5109)
v1.3.3¶
Bug Fixes¶
- Change default WS close to 4000 instead of 1000.
The previous close code caused sessions to be invalidated at a higher frequency than desired.
Fix
None
appearing inMember.activities
. (GH-2619)
v1.3.2¶
Another minor bug fix release.
Bug Fixes¶
Higher the wait time during the
GUILD_CREATE
stream beforeon_ready
is fired forAutoShardedClient
.on_voice_state_update()
now uses the innermember
payload which should make it more reliable.Fix crashes if
Message.guild
isObject
instead ofGuild
.Fix
Webhook.send()
returning an empty string instead ofNone
whenwait=False
.Fix invalid format specifier in webhook state (GH-2570)
[ext.commands] Passing invalid permissions to permission related checks now raises
TypeError
.
v1.3.1¶
Minor bug fix release.
Bug Fixes¶
Fix fetching invites in guilds that the user is not in.
Fix the channel returned from
Client.fetch_channel()
raising when sending messages. (GH-2531)
Miscellaneous¶
Fix compatibility warnings when using the Python 3.9 alpha.
Change the unknown event logging from WARNING to DEBUG to reduce noise.
v1.3.0¶
This version comes with a lot of bug fixes and new features. It’s been in development for a lot longer than was anticipated!
New Features¶
Add
Guild.fetch_members()
to fetch members from the HTTP API. (GH-2204)Add
Guild.fetch_roles()
to fetch roles from the HTTP API. (GH-2208)Add support for teams via
Team
when fetching withClient.application_info()
. (GH-2239)Add support for suppressing embeds via
Message.edit()
Add support for guild subscriptions. See the
Client
documentation for more details.Add
VoiceChannel.voice_states
to get voice states without relying on member cache.Add
Guild.query_members()
to request members from the gateway.Add
FFmpegOpusAudio
and other voice improvements. (GH-2258)Add
RawMessageUpdateEvent.channel_id
for retrieving channel IDs during raw message updates. (GH-2301)Add
RawReactionActionEvent.event_type
to disambiguate between reaction addition and removal in reaction events.Add
abc.GuildChannel.permissions_synced
to query whether permissions are synced with the category. (GH-2300, GH-2324)Add
MessageType.channel_follow_add
message type for announcement channels being followed. (GH-2314)Add
Message.is_system()
to allow for quickly filtering through system messages.Add
VoiceState.self_stream
to indicate whether someone is streaming via Go Live. (GH-2343)Add
Emoji.is_usable()
to check if the client user can use an emoji. (GH-2349)Add
VoiceRegion.europe
andVoiceRegion.dubai
. (GH-2358, GH-2490)Add
TextChannel.follow()
to follow a news channel. (GH-2367)Add
Permissions.view_guild_insights
permission. (GH-2415)- Add support for new audit log types. See Audit Log Data for more information. (GH-2427)
Note that integration support is not finalized.
Add
Webhook.type
to query the type of webhook (WebhookType
). (GH-2441)Allow bulk editing of channel overwrites through
abc.GuildChannel.edit()
. (GH-2198)Add
Activity.created_at
to see when an activity was started. (GH-2446)Add support for
xsalsa20_poly1305_lite
encryption mode for voice. (GH-2463)Add
RawReactionActionEvent.member
to get the member who did the reaction. (GH-2443)Add support for new YouTube streaming via
Streaming.platform
andStreaming.game
. (GH-2445)Add
Guild.discovery_splash_url
to get the discovery splash image asset. (GH-2482)- Add
Guild.rules_channel
to get the rules channel of public guilds. (GH-2482) It should be noted that this feature is restricted to those who are either in Server Discovery or planning to be there.
- Add
Add support for message flags via
Message.flags
andMessageFlags
. (GH-2433)Add
User.system
andProfile.system
to know whether a user is an official Discord Trust and Safety account.Add
Profile.team_user
to check whether a user is a member of a team.Add
Attachment.to_file()
to easily convert attachments toFile
for sending.- Add certain aliases to
Permissions
to match the UI better. (GH-2496)
- Add certain aliases to
Add support for passing keyword arguments when creating
Permissions
.- Add support for custom activities via
CustomActivity
. (GH-2400) Note that as of now, bots cannot send custom activities yet.
- Add support for custom activities via
Add support for
on_invite_create()
andon_invite_delete()
events.- Add support for clearing a specific reaction emoji from a message.
Message.clear_reaction()
andReaction.clear()
methods.on_raw_reaction_clear_emoji()
andon_reaction_clear_emoji()
events.
Add
utils.sleep_until()
helper to sleep until a specific datetime. (GH-2517, GH-2519)[ext.commands] Add support for teams and
Bot.owner_ids
to have multiple bot owners. (GH-2239)[ext.commands] Add new
BucketType.role
bucket type. (GH-2201)[ext.commands] Expose
Command.cog
property publicly. (GH-2360)[ext.commands] Add non-decorator interface for adding checks to commands via
Command.add_check
andCommand.remove_check
. (GH-2411)[ext.commands] Add
has_guild_permissions
check. (GH-2460)[ext.commands] Add
bot_has_guild_permissions
check. (GH-2460)[ext.commands] Add
predicate
attribute to checks decorated withcheck()
.[ext.commands] Add
check_any()
check to logical OR multiple checks.[ext.commands] Add
max_concurrency()
to allow only a certain amount of users to use a command concurrently before waiting or erroring.[ext.commands] Add support for calling a
Command
as a regular function.[ext.tasks]
Loop.add_exception_type
now allows multiple exceptions to be set. (GH-2333)[ext.tasks] Add
Loop.next_iteration
property. (GH-2305)
Bug Fixes¶
Fix issue with permission resolution sometimes failing for guilds with no owner.
Tokens are now stripped upon use. (GH-2135)
Passing in a
name
is no longer required forEmoji.edit()
. (GH-2368)Fix issue with webhooks not re-raising after retries have run out. (GH-2272, GH-2380)
Fix mismatch in URL handling in
utils.escape_markdown()
. (GH-2420)Fix issue with ports being read in little endian when they should be big endian in voice connections. (GH-2470)
Fix
Member.mentioned_in()
not taking into consideration the message’s guild.Fix bug with moving channels when there are gaps in positions due to channel deletion and creation.
Fix
on_shard_ready()
not triggering whenfetch_offline_members
is disabled. (GH-2504)Fix issue with large sharded bots taking too long to actually dispatch
on_ready()
.Fix issue with fetching group DM based invites in
Client.fetch_invite()
.Fix out of order files being sent in webhooks when there are 10 files.
[ext.commands] Extensions that fail internally due to ImportError will no longer raise
ExtensionNotFound
. (GH-2244, GH-2275, GH-2291)[ext.commands] Updating the
Paginator.suffix
will not cause out of date calculations. (GH-2251)[ext.commands] Allow converters from custom extension packages. (GH-2369, GH-2374)
[ext.commands] Fix issue with paginator prefix being
None
causing empty pages. (GH-2471)[ext.commands]
Greedy
now ignores parsing errors rather than propagating them.[ext.commands]
Command.can_run
now checks whether a command is disabled.[ext.commands]
HelpCommand.clean_prefix
now takes into consideration nickname mentions. (GH-2489)[ext.commands]
Context.send_help
now properly propagates to theHelpCommand.on_help_command_error
handler.
Miscellaneous¶
The library now fully supports Python 3.8 without warnings.
Bump the dependency of
websockets
to 8.0 for those who can use it. (GH-2453)Due to Discord providing
Member
data in mentions, users will now be upgraded toMember
more often if mentioned.utils.escape_markdown()
now properly escapes new quote markdown.The message cache can now be disabled by passing
None
tomax_messages
inClient
.The default message cache size has changed from 5000 to 1000 to accommodate small bots.
Lower memory usage by only creating certain objects as needed in
Role
.There is now a sleep of 5 seconds before re-IDENTIFYing during a reconnect to prevent long loops of session invalidation.
- The rate limiting code now uses millisecond precision to have more granular rate limit handling.
Along with that, the rate limiting code now uses Discord’s response to wait. If you need to use the system clock again for whatever reason, consider passing
assume_synced_clock
inClient
.
The performance of
Guild.default_role
has been improved from O(N) to O(1). (GH-2375)The performance of
Member.roles
has improved due to usage of caching to avoid surprising performance traps.The GC is manually triggered during things that cause large deallocations (such as guild removal) to prevent memory fragmentation.
There have been many changes to the documentation for fixes both for usability, correctness, and to fix some linter errors. Thanks to everyone who contributed to those.
The loading of the opus module has been delayed which would make the result of
opus.is_loaded()
somewhat surprising.[ext.commands] Usernames prefixed with @ inside DMs will properly convert using the
User
converter. (GH-2498)[ext.tasks] The task sleeping time will now take into consideration the amount of time the task body has taken before sleeping. (GH-2516)
v1.2.5¶
Bug Fixes¶
Fix a bug that caused crashes due to missing
animated
field in Emoji structures in reactions.
v1.2.4¶
Bug Fixes¶
Fix a regression when
Message.channel
would beNone
.Fix a regression where
Message.edited_at
would not update during edits.Fix a crash that would trigger during message updates (GH-2265, GH-2287).
Fix a bug when
VoiceChannel.connect()
would not return (GH-2274, GH-2372, GH-2373, GH-2377).Fix a crash relating to token-less webhooks (GH-2364).
Fix issue where
Guild.premium_subscription_count
would beNone
due to a Discord bug. (GH-2331, GH-2376).
v1.2.3¶
Bug Fixes¶
Fix an AttributeError when accessing
Member.premium_since
inon_member_update()
. (GH-2213)Handle
asyncio.CancelledError
inabc.Messageable.typing()
context manager. (GH-2218)Raise the max encoder bitrate to 512kbps to account for nitro boosting. (GH-2232)
Properly propagate exceptions in
Client.run()
. (GH-2237)[ext.commands] Ensure cooldowns are properly copied when used in cog level
command_attrs
.
v1.2.2¶
Bug Fixes¶
Audit log related attribute access have been fixed to not error out when they shouldn’t have.
v1.2.1¶
Bug Fixes¶
User.avatar_url
and related attributes no longer raise an error.More compatibility shims with the
enum.Enum
code.
v1.2.0¶
This update mainly brings performance improvements and various nitro boosting attributes (referred to in the API as “premium guilds”).
New Features¶
Add
Guild.premium_tier
to query the guild’s current nitro boost level.Add
Guild.emoji_limit
,Guild.bitrate_limit
,Guild.filesize_limit
to query the new limits of a guild when taking into consideration boosting.Add
Guild.premium_subscription_count
to query how many members are boosting a guild.Add
Member.premium_since
to query since when a member has boosted a guild.Add
Guild.premium_subscribers
to query all the members currently boosting the guild.- Add
Guild.system_channel_flags
to query the settings for a guild’sGuild.system_channel
. This includes a new type named
SystemChannelFlags
- Add
Add
Emoji.available
to query if an emoji can be used (within the guild or otherwise).Add support for animated icons in
Guild.icon_url_as()
andGuild.icon_url
.Add
Guild.is_icon_animated()
.Add support for the various new
MessageType
involving nitro boosting.Add
VoiceRegion.india
. (GH-2145)Add
Embed.insert_field_at()
. (GH-2178)Add a
type
attribute for all channels to their appropriateChannelType
. (GH-2185)Add
Client.fetch_channel()
to fetch a channel by ID via HTTP. (GH-2169)Add
Guild.fetch_channels()
to fetch all channels via HTTP. (GH-2169)[ext.tasks] Add
Loop.stop
to gracefully stop a task rather than cancelling.[ext.tasks] Add
Loop.failed
to query if a task had failed somehow.[ext.tasks] Add
Loop.change_interval
to change the sleep interval at runtime (GH-2158, GH-2162)
Bug Fixes¶
Fix internal error when using
Guild.prune_members()
.[ext.commands] Fix
Command.invoked_subcommand
being invalid in many cases.[ext.tasks] Reset iteration count when the loop terminates and is restarted.
[ext.tasks] The decorator interface now works as expected when stacking (GH-2154)
Miscellaneous¶
- Improve performance of all Enum related code significantly.
This was done by replacing the
enum.Enum
code with an API compatible one.This should not be a breaking change for most users due to duck-typing.
Improve performance of message creation by about 1.5x.
Improve performance of message editing by about 1.5-4x depending on payload size.
Improve performance of attribute access on
Member
about by 2x.Improve performance of
utils.get()
by around 4-6x depending on usage.Improve performance of event parsing lookup by around 2.5x.
Keyword arguments in
Client.start()
andClient.run()
are now validated (GH-953, GH-2170)The Discord error code is now shown in the exception message for
HTTPException
.Internal tasks launched by the library will now have their own custom
__repr__
.All public facing types should now have a proper and more detailed
__repr__
.[ext.tasks] Errors are now logged via the standard
logging
module.
v1.1.1¶
Bug Fixes¶
Webhooks do not overwrite data on retrying their HTTP requests (GH-2140)
Miscellaneous¶
Add back signal handling to
Client.run()
due to issues some users had with proper cleanup.
v1.1.0¶
New Features¶
- There is a new extension dedicated to making background tasks easier.
You can check the documentation here: API Reference.
Add
Permissions.stream
permission. (GH-2077)Add equality comparison and hash support to
Asset
Add
compute_prune_members
parameter toGuild.prune_members()
(GH-2085)Add
Client.cached_messages
attribute to fetch the message cache (GH-2086)Add
abc.GuildChannel.clone()
to clone a guild channel. (GH-2093)Add
delay
keyword-only argument toMessage.delete()
(GH-2094)Add support for
<:name:id>
when adding reactions (GH-2095)Add
Asset.read()
to fetch the bytes content of an asset (GH-2107)Add
Attachment.read()
to fetch the bytes content of an attachment (GH-2118)Add support for voice kicking by passing
None
toMember.move_to()
.
discord.ext.commands
¶
Add new
dm_only()
check.Support callable converters in
Greedy
- Add new
MessageConverter
. This allows you to use
Message
as a type hint in functions.
- Add new
Add
Command.parents
to fetch the parents of a command (GH-2104)
Bug Fixes¶
Fix
AttributeError
when using__repr__
onWidget
.Fix issue with
abc.GuildChannel.overwrites
returningNone
for keys.Remove incorrect legacy NSFW checks in e.g.
TextChannel.is_nsfw()
.Fix
UnboundLocalError
whenRequestsWebhookAdapter
raises an error.Fix bug where updating your own user did not update your member instances.
Tighten constraints of
__eq__
inSpotify
objects (GH-2113, GH-2117)
discord.ext.commands
¶
Fix lambda converters in a non-module context (e.g.
eval
).- Use message creation time for reference time when computing cooldowns.
This prevents cooldowns from triggering during e.g. a RESUME session.
Fix the default
on_command_error()
to work with new-style cogs (GH-2094)DM channels are now recognised as NSFW in
is_nsfw()
check.Fix race condition with help commands (GH-2123)
Fix cog descriptions not showing in
MinimalHelpCommand
(GH-2139)
Miscellaneous¶
Improve the performance of internal enum creation in the library by about 5x.
Make the output of
python -m discord --version
a bit more useful.The loop cleanup facility has been rewritten again.
The signal handling in
Client.run()
has been removed.
discord.ext.commands
¶
Custom exception classes are now used for all default checks in the library (GH-2101)
v1.0.1¶
Bug Fixes¶
v1.0.0¶
The changeset for this version are too big to be listed here, for more information please see the migrating page.
v0.16.6¶
Bug Fixes¶
Fix issue with
Client.create_server()
that made it stop working.Fix main thread being blocked upon calling
StreamPlayer.stop
.Handle HEARTBEAT_ACK and resume gracefully when it occurs.
Fix race condition when pre-emptively rate limiting that caused releasing an already released lock.
Fix invalid state errors when immediately cancelling a coroutine.
v0.16.1¶
This release is just a bug fix release with some better rate limit implementation.
Bug Fixes¶
Servers are now properly chunked for user bots.
The CDN URL is now used instead of the API URL for assets.
Rate limit implementation now tries to use header information if possible.
Event loop is now properly propagated (GH-420)
Allow falsey values in
Client.send_message()
andClient.send_file()
.
v0.16.0¶
New Features¶
Add
Channel.overwrites
to get all the permission overwrites of a channel.Add
Server.features
to get information about partnered servers.
Bug Fixes¶
Timeout when waiting for offline members while triggering
on_ready()
.The fact that we did not timeout caused a gigantic memory leak in the library that caused thousands of duplicate
Member
instances causing big memory spikes.
Discard null sequences in the gateway.
The fact these were not discarded meant that
on_ready()
kept being called instead ofon_resumed()
. Since this has been corrected, in most caseson_ready()
will be called once or twice withon_resumed()
being called much more often.
v0.15.1¶
Fix crash on duplicate or out of order reactions.
v0.15.0¶
New Features¶
Rich Embeds for messages are now supported.
To do so, create your own
Embed
and pass the instance to theembed
keyword argument toClient.send_message()
orClient.edit_message()
.
Add
Client.clear_reactions()
to remove all reactions from a message.Add support for MESSAGE_REACTION_REMOVE_ALL event, under
on_reaction_clear()
.Add
Permissions.update()
andPermissionOverwrite.update()
for bulk permission updates.This allows you to use e.g.
p.update(read_messages=True, send_messages=False)
in a single line.
Add
PermissionOverwrite.is_empty()
to check if the overwrite is empty (i.e. has no overwrites set explicitly as true or false).
For the command extension, the following changed:
Context
is no longer slotted to facilitate setting dynamic attributes.
v0.14.3¶
Bug Fixes¶
Fix crash when dealing with MESSAGE_REACTION_REMOVE
Fix incorrect buckets for reactions.
v0.14.2¶
New Features¶
Client.wait_for_reaction()
now returns a namedtuple withreaction
anduser
attributes.This is for better support in the case that
None
is returned since tuple unpacking can lead to issues.
Bug Fixes¶
Fix bug that disallowed
None
to be passed foremoji
parameter inClient.wait_for_reaction()
.
v0.14.1¶
Bug fixes¶
- Fix bug with
Reaction
not being visible at import. This was also breaking the documentation.
- Fix bug with
v0.14.0¶
This update adds new API features and a couple of bug fixes.
New Features¶
Add support for Manage Webhooks permission under
Permissions.manage_webhooks
Add support for
around
argument in 3.5+Client.logs_from()
.- Add support for reactions.
Client.add_reaction()
to add a reactionsClient.remove_reaction()
to remove a reaction.Client.get_reaction_users()
to get the users that reacted to a message.Permissions.add_reactions
permission bit support.Two new events,
on_reaction_add()
andon_reaction_remove()
.Message.reactions
to get reactions from a message.Client.wait_for_reaction()
to wait for a reaction from a user.
Bug Fixes¶
Fix bug with Paginator still allowing lines that are too long.
Fix the
Permissions.manage_emojis
bit being incorrect.
v0.13.0¶
This is a backwards compatible update with new features.
New Features¶
Add the ability to manage emojis.
Client.create_custom_emoji()
to create new emoji.Client.edit_custom_emoji()
to edit an old emoji.Client.delete_custom_emoji()
to delete a custom emoji.
Add new
Permissions.manage_emojis
toggle.This applies for
PermissionOverwrite
as well.
Add new statuses for
Status
.Status.dnd
(aliased withStatus.do_not_disturb
) for Do Not Disturb.Status.invisible
for setting your status to invisible (please see the docs for a caveat).
Deprecate
Client.change_status()
Use
Client.change_presence()
instead for better more up to date functionality.This method is subject for removal in a future API version.
Add
Client.change_presence()
for changing your status with the new Discord API change.This is the only method that allows changing your status to invisible or do not disturb.
Bug Fixes¶
v0.12.0¶
This is a bug fix update that also comes with new features.
New Features¶
Add custom emoji support.
Adds a new class to represent a custom Emoji named
Emoji
Adds a utility generator function,
Client.get_all_emojis()
.Adds a list of emojis on a server,
Server.emojis
.Adds a new event,
on_server_emojis_update()
.
Add new server regions to
ServerRegion
ServerRegion.eu_central
andServerRegion.eu_west
.
Add support for new pinned system message under
MessageType.pins_add
.Add order comparisons for
Role
to allow it to be compared with regards to hierarchy.This means that you can now do
role_a > role_b
etc to check ifrole_b
is lower in the hierarchy.
Add
Server.role_hierarchy
to get the server’s role hierarchy.Add
Member.server_permissions
to get a member’s server permissions without their channel specific overwrites.Add
Client.get_user_info()
to retrieve a user’s info from their ID.Add a new
Player
property,Player.error
to fetch the error that stopped the player.To help with this change, a player’s
after
function can now take a single parameter denoting the current player.
Add support for server verification levels.
Adds a new enum called
VerificationLevel
.This enum can be used in
Client.edit_server()
under theverification_level
keyword argument.Adds a new attribute in the server,
Server.verification_level
.
Add
Server.voice_client
shortcut property forClient.voice_client_in()
.This is technically old (was added in v0.10.0) but was undocumented until v0.12.0.
For the command extension, the following are new:
Add custom emoji converter.
All default converters that can take IDs can now convert via ID.
Add coroutine support for
Bot.command_prefix
.Add a method to reset command cooldown.
Bug Fixes¶
Fix bug that caused the library to not work with the latest
websockets
library.Fix bug that leaked keep alive threads (GH-309)
Fix bug that disallowed
ServerRegion
from being used inClient.edit_server()
.Fix bug in
Channel.permissions_for()
that caused permission resolution to happen out of order.Fix bug in
Member.top_role
that did not account for same-position roles.
v0.11.0¶
This is a minor bug fix update that comes with a gateway update (v5 -> v6).
Breaking Changes¶
Permissions.change_nicknames
has been renamed toPermissions.change_nickname
to match the UI.
New Features¶
Add the ability to prune members via
Client.prune_members()
.Switch the websocket gateway version to v6 from v5. This allows the library to work with group DMs and 1-on-1 calls.
Add
AppInfo.owner
attribute.Add
CallMessage
for group voice call messages.Add
GroupCall
for group voice call information.Add
Message.system_content
to get the system message.Add the remaining VIP servers and the Brazil servers into
ServerRegion
enum.Add
stderr
argument toVoiceClient.create_ffmpeg_player()
to redirect stderr.The library now handles implicit permission resolution in
Channel.permissions_for()
.Add
Server.mfa_level
to query a server’s 2FA requirement.Add
Permissions.external_emojis
permission.Add
Member.voice
attribute that refers to aVoiceState
.For backwards compatibility, the member object will have properties mirroring the old behaviour.
For the command extension, the following are new:
Command cooldown system with the
cooldown
decorator.UserInputError
exception for the hierarchy for user input related errors.
Bug Fixes¶
Client.email
is now saved when using a token for user accounts.Fix issue when removing roles out of order.
Fix bug where discriminators would not update.
Handle cases where
HEARTBEAT
opcode is received. This caused bots to disconnect seemingly randomly.
For the command extension, the following bug fixes apply:
Bot.check
decorator is actually a decorator not requiring parentheses.Bot.remove_command
andGroup.remove_command
no longer throw if the command doesn’t exist.Command names are no longer forced to be
lower()
.Fix a bug where Member and User converters failed to work in private message contexts.
HelpFormatter
now ignores hidden commands when deciding the maximum width.
v0.10.0¶
For breaking changes, see Migrating to v0.10.0. The breaking changes listed there will not be enumerated below. Since this version is rather a big departure from v0.9.2, this change log will be non-exhaustive.
New Features¶
The library is now fully
asyncio
compatible, allowing you to write non-blocking code a lot more easily.The library now fully handles 429s and unconditionally retries on 502s.
A new command extension module was added but is currently undocumented. Figuring it out is left as an exercise to the reader.
Two new exception types,
Forbidden
andNotFound
to denote permission errors or 404 errors.Added
Client.delete_invite()
to revoke invites.Added support for sending voice. Check
VoiceClient
for more details.Added
Client.wait_for_message()
coroutine to aid with follow up commands.Added
version_info
named tuple to check version info of the library.Login credentials are now cached to have a faster login experience. You can disable this by passing in
cache_auth=False
when constructing aClient
.New utility function,
discord.utils.get()
to simplify retrieval of items based on attributes.All data classes now support
!=
,==
,hash(obj)
andstr(obj)
.Added
Client.get_bans()
to get banned members from a server.Added
Client.invites_from()
to get currently active invites in a server.Added
Server.me
attribute to get theMember
version ofClient.user
.Most data classes now support a
hash(obj)
function to allow you to use them inset
ordict
classes or subclasses.Add
Message.clean_content()
to get a text version of the content with the user and channel mentioned changed into their names.Added a way to remove the messages of the user that just got banned in
Client.ban()
.Added
Client.wait_until_ready()
to facilitate easy creation of tasks that require the client cache to be ready.Added
Client.wait_until_login()
to facilitate easy creation of tasks that require the client to be logged in.Add
discord.Game
to represent any game with custom text to send toClient.change_status()
.Add
Message.nonce
attribute.Add
Member.permissions_in()
as another way of doingChannel.permissions_for()
.Add
Client.move_member()
to move a member to another voice channel.You can now create a server via
Client.create_server()
.Added
Client.edit_server()
to edit existing servers.Added
Client.server_voice_state()
to server mute or server deafen a member.If you are being rate limited, the library will now handle it for you.
Add
on_member_ban()
andon_member_unban()
events that trigger when a member is banned/unbanned.
Performance Improvements¶
All data classes now use
__slots__
which greatly reduce the memory usage of things kept in cache.Due to the usage of
asyncio
, the CPU usage of the library has gone down significantly.A lot of the internal cache lists were changed into dictionaries to change the
O(n)
lookup intoO(1)
.Compressed READY is now on by default. This means if you’re on a lot of servers (or maybe even a few) you would receive performance improvements by having to download and process less data.
While minor, change regex from
\d+
to[0-9]+
to avoid unnecessary unicode character lookups.
Bug Fixes¶
Fix bug where guilds being updated did not edit the items in cache.
Fix bug where
member.roles
were empty upon joining instead of having the@everyone
role.Fix bug where
Role.is_everyone()
was not being set properly when the role was being edited.Client.logs_from()
now handles cases where limit > 100 to sidestep the discord API limitation.Fix bug where a role being deleted would trigger a
ValueError
.Fix bug where
Permissions.kick_members()
andPermissions.ban_members()
were flipped.Mentions are now triggered normally. This was changed due to the way discord handles it internally.
Fix issue when a
Message
would attempt to upgrade aMessage.server
when the channel is aObject
.Unavailable servers were not being added into cache, this has been corrected.