Copy in messages from Danny, verbatim

This commit is contained in:
Arthur Jovart 2021-08-28 21:32:55 +02:00
parent 6bcc717e63
commit c44fb552d6
No known key found for this signature in database
GPG Key ID: DE4444AAAAAAAAAA

View File

@ -11,6 +11,131 @@ Changelog
This page keeps a detailed human friendly rendering of what's new and changed
in specific versions.
.. _vp2p0p0:
v2.0.0
--------
This version was partly developed by Danny, and partly by the enhanced-discord.py contributors.
The library has been updated with breaking changes, and as suck the major version was changed.
- Performance of the library has improved significantly (all times with 1 process and 1 AutoShardedBot):
- 735 guilds boot up time (with chunking): 57s/1.7 GiB RAM -> 42s/1.4 GiB RAM
- 27k guilds boot up time (with chunking): 477s/8 GiB RAM -> 303s/7.2 GiB RAM
- 48k guilds boot up time (without chunking): 109s -> 67s
- 106k guilds boot up time (without chunking): 3300s -> 3090s
- The entire public API of the library is now completely type hinted.
- There may still be bugs however.
- For best type hinting experience consider using Pyright.
- Almost all edit methods now return their updated counterpart rather than doing an in-place edit.
Breaking Changes
~~~~~~~~~~~~~~~~~
- Asset.replace now only accepts keyword arguments
- Asset.with_ functions now only accept positional only arguments
- TextChannel.get_partial_message is now pos-only
- TextChannel.get_thread is now pos-only
- permissions_for is now pos-only
- GroupChannel.owner is now Optional
- edit methods now only accept None if it actually means something (e.g. clearing it)
- timeout parameter for ui.View.__init__ is now keyword only
- When an interaction has already been responded and another one is sent, InteractionResponded is now raised.
- Discord's API only allows a single interaction.response.
- Separate on_member_update and on_presence_update
- The new event on_presence_update is now called when status/activity is changed.
- on_member_update will now no longer have status/activity changes.
- afk parameter in Client.change_presence is removed
- The undocumented private on_socket_response event got removed.
- Consider using the newer documented on_socket_event_type event instead.
- Using on_socket_raw_receive and on_socket_raw_send are now opt-in via enable_debug_events toggle.
- on_socket_raw_receive is now only dispatched after decompressing the payload.
- Persistent View dispatch mechanism now uses the message_id key if provided.
- Message.start_thread was renamed to Message.create_thread
- TextChannel.start_thread was renamed to TextChannel.create_thread
- All get_ lookup functions now use positional-only parameters for the id parameter.
- Remove TextChannel.active_threads due to the endpoint being deprecated and slated for removal.
- Use Guild.active_threads instead.
- User.avatar now returns None if the user did not upload an avatar.
- Use User.display_avatar to get the avatar and fallback to the default avatar to go back to the old behaviour.
New Features
~~~~~~~~~~~~~~
- Channel types are now typed
- Member is now typed
- Client is now typed
- Permissions are now typed
- Core library errors are now typed
- Add various examples showing how to use views. There are more to come.
- GroupChannel.owner_id now gets the owner ID
- edit methods now don't rely on previous state
- View.from_message converts a Message.components to a View
- Thread.type to get the thread channel type
- ButtonStyle.url alias for ButtonStyle.link
- Add default style for ui.Button constructor
- This makes it so creating a URL button is as simple as ui.Button(url='...', label='...')
- Thread.mention to get the mention string for a thread
- Thread.is_nsfw() to check whether the parent channel of the thread is NSFW
- CommandOnCooldown.type to get back the type of the cooldown since it was removed from Cooldown
- Add support for fetching the original interaction response message.
- Interaction.original_message will retrieve it and returns an InteractionMessage
- InteractionMessage.edit or Interaction.edit_original_message will edit it
- InteractionMessage.delete or Interaction.delete_original_message will delete it
- MessageFlags.ephemeral to get whether a message is ephemeral
- Client.fetch_channel now fetches threads as well
- SelectOption now has a __str__ that matches the client representation.
- This might change in the future to remove the description from it.
- Add a converter for discord.Thread
- Allow clean_content converter to work stand-alone
- Add User.banner to get a user's banner and User.accent_colour to get the set banner colour.
- Due to an API limitation this requires using Client.fetch_user.
- Add reason keyword argument to more methods
- Add audit log events for threads
- Allow public threads to be created without a starter message
- Add Guild.get_channel_or_thread helper method
- Add full support for the new sticker API
- Add on_socket_event_type event to get the event type of an event
- Add TextChannel.default_auto_archive_duration
- Add PartialMessageable type to allow for sending messages to a channel using only its channel_id.
- This is constructed with Client.get_partial_messageable.
- Add Guild.active_threads to get all of a guild's active threads.
- Add Thread.members to get all cached ThreadMember instances of a thread.
- Add Thread.fetch_members to fetch all ThreadMember instances of a thread.
- These two require Intents.members to be useful.
- Add support for guild avatars for members under Member.guild_avatar
- Add User.display_avatar and Member.display_avatar to get the user's displayed avatar.
- Add Colour.brand_green and Colour.brand_red
Bug Fixes
~~~~~~~~~~~
- Channel converters now work in DMs again
- Fix Interaction.channel being None in threads
- Change timeouts in ui.View to work as documented
- Message.__repr__ now shows the proper type, e.g. WebhookMessage and InteractionMessage
- Change Cooldown handling to not reset token window when the number of tokens reaches 0
- Fix audit log permission construction breaking due to unexpected type errors.
- Fix on_thread_join not dispatching when a thread is unarchived
- Fix Message.guild being None when a thread is unarchived due to a new message
- MessageConverter now works with threads
- Retry requests when a 504 is hit
- Fix Thread.slowmode_delay not updating on edit
- Fix permissions_for for roles
- Update Message.system_content for newer message types
- Fix PartialMessage not working with threads
- Fix crash with stage instances not having the documented discoverable_enabled key
- Fix some built-in checks not working with threads
- Fix SyncWebhook not working in a multi-threaded context
- Fix on_thread_member_remove not dispatching properly
- Fix on_typing not dispatching for threads
- Update Message.is_system to work with newer message types
- Fix some enums like VerificationLevel not being comparable.
- Fix io.BytesIO sources not working with ffmpeg players
- Fix Client.fetch_channel and Guild.fetch_channel not returning threads
.. _vp1p7p3:
v1.7.3