diff --git a/docs/whats_new.rst b/docs/whats_new.rst index 50b12053..156592a7 100644 --- a/docs/whats_new.rst +++ b/docs/whats_new.rst @@ -34,32 +34,32 @@ The library has been updated with breaking changes, and as suck the major versio 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. +- :meth:`Asset.replace` now only accepts keyword arguments +- ``Asset.with_`` functions now only accept positional only arguments +- :meth:`TextChannel.get_partial_message` is now pos-only +- :meth:`TextChannel.get_thread` is now pos-only +- ``permissions_for`` is now pos-only +- :attr:`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, :exc:`InteractionResponded`is now raised. + - Discord's API only allows a single :attr:`interaction.response`. +- Separate :func:`on_member_update` and :func:`on_presence_update` + - The new event :func:`on_presence_update` is now called when status/activity is changed. + - :func:`on_member_update` will now no longer have status/activity changes. +- afk parameter in :meth:`Client.change_presence` is removed +- The undocumented private :func:`on_socket_response` event got removed. + - Consider using the newer documented :func:`on_socket_event_type` event instead. +- Using :func:`on_socket_raw_receive` and :func:`on_socket_raw_send` are now opt-in via :attr:`enable_debug_events` toggle. +- :func:`on_socket_raw_receive` is now only dispatched after decompressing the payload. +- Persistent View dispatch mechanism now uses the ``message_id`` key if provided. +- :meth:`Message.start_thread` was renamed to :meth:`Message.create_thread` +- :meth:`TextChannel.start_thread` was renamed to :meth:`TextChannel.create_thread` +- All ``get_`` lookup functions now use positional-only parameters for the id parameter. +- Remove :meth:`TextChannel.active_threads` due to the endpoint being deprecated and slated for removal. + - Use :meth:`Guild.active_threads` instead. +- :attr:`User.avatar` now returns None if the user did not upload an avatar. + - Use :attr:`User.display_avatar` to get the avatar and fallback to the default avatar to go back to the old behaviour. New Features ~~~~~~~~~~~~~~ @@ -70,71 +70,71 @@ New Features - 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 +- :attr:`GroupChannel.owner_id` now gets the owner ID +- ``edit`` methods now don't rely on previous state +- :meth:`View.from_message` converts a Message.components to a View +- :attr:`Thread.type` to get the thread channel type +- :attr:`ButtonStyle.url` alias for :attr:`ButtonStyle.link` +- Add default style for :class:`ui.Button` constructor + - This makes it so creating a URL button is as simple as ``ui.Button(url='...', label='...')`` +- :attr:`Thread.mention` to get the mention string for a thread +- :meth:`Thread.is_nsfw` to check whether the parent channel of the thread is NSFW - 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. + - :meth:`Interaction.original_message` will retrieve it and returns an InteractionMessage + - :meth:`InteractionMessage.edit` or :meth:`Interaction.edit_original_message` will edit it + - :meth:`InteractionMessage.delete` or :meth:`Interaction.delete_original_message` will delete it +- :attr:`MessageFlags.ephemeral` to get whether a message is ephemeral +- :meth:`Client.fetch_channel` now fetches threads as well +- :class:`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 a converter for :class:`discord.Thread` +- Allow ``clean_content`` converter to work stand-alone +- Add :meth:`User.banner` to get a user's banner and :meth:`User.accent_colour` to get the set banner colour. + - Due to an API limitation this requires using :meth:`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 :meth:`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 +- Add :func:`on_socket_event_type` event to get the event type of an event +- Add :attr:`TextChannel.default_auto_archive_duration` +- Add :class:`PartialMessageable` type to allow for sending messages to a channel using only its ``channel_id``. + - This is constructed with :meth:`Client.get_partial_messageable`. +- Add :meth:`Guild.active_threads` to get all of a guild's active threads. +- Add :attr:`Thread.members` to get all cached :class:`ThreadMember` instances of a thread. +- Add :meth:`Thread.fetch_members` to fetch all :class:`ThreadMember` instances of a thread. + - These two require :attr:`Intents.members` to be useful. +- Add support for guild avatars for members under :attr:`Member.guild_avatar` +- Add :attr:`User.display_avatar` and :attr:`Member.display_avatar` to get the user's displayed avatar. +- Add :attr:`Colour.brand_green` and :attr:`Colour.brand_red` +- |commands| :attr:`CommandOnCooldown.type` to get back the type of the cooldown since it was removed from :class:`Cooldown` 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 +- :class:`Channel` converters now work in DMs again +- Fix :attr:`Interaction.channel` being None in threads +- Change timeouts in :class:`ui.View` to work as documented +- :attr:`Message.__repr__` now shows the proper type, e.g. :class:`WebhookMessage` and :class:`InteractionMessage` +- Change :class:`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 +- Fix :func:`on_thread_join` not dispatching when a thread is unarchived +- Fix :attr:`Message.guild` being None when a thread is unarchived due to a new message +- :class:`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 :attr:`Thread.slowmode_delay` not updating on edit +- Fix ``permissions_for`` for roles +- Update :attr:`Message.system_content` for newer message types +- Fix :class:`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 +- Fix :class:`SyncWebhook` not working in a multi-threaded context +- Fix :func:`on_thread_member_remove` not dispatching properly +- Fix :func:`on_typing` not dispatching for threads +- Update :attr:`Message.is_system` to work with newer message types +- Fix some enums like :class:`VerificationLevel` not being comparable. +- Fix ``io.BytesIO`` sources not working with ffmpeg players +- Fix :meth:`Client.fetch_channel` and :meth:`Guild.fetch_channel` not returning threads .. _vp1p7p3: