Although rare, sometimes an extension needs to clean-up or know when it's being unloaded. For cases like these, there is another entry point named ``teardown`` which is similar to ``setup`` except called when the extension is unloaded.
Exceptions raised in the ``teardown`` function are ignored, and the extension is still unloaded.
This page keeps a detailed human friendly rendering of what's new and changed
in specific versions.
.._vp2p3p1:
v2.3.1
-------
Bug Fixes
~~~~~~~~~~
- Fix username lookup in :meth:`Guild.get_member_named` (:issue:`9451`).
- Use cache data first for :attr:`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.
- Fix false positives in :meth:`PartialEmoji.from_str` inappropriately setting ``animated`` to ``True`` (:issue:`9456`, :issue:`9457`).
- Fix certain select types not appearing in :attr:`Message.components` (:issue:`9462`).
- |commands| Change lookup order for :class:`~ext.commands.MemberConverter` and :class:`~ext.commands.UserConverter` to prioritise usernames instead of nicknames.
.._vp2p3p0:
v2.3.0
--------
New Features
~~~~~~~~~~~~~
- Add support for the new username system (also known as "pomelo").
- Add :attr:`User.global_name` to get their global nickname or "display name".
- Update :attr:`User.display_name` and :attr:`Member.display_name` to understand global nicknames.
- Update ``__str__`` for :class:`User` to drop discriminators if the user has been migrated.
- Update :meth:`Guild.get_member_named` to work with migrated users.
- Update :attr:`User.default_avatar` to work with migrated users.
- |commands| Update user and member converters to understand migrated users.
- Add :attr:`DefaultAvatar.pink` for new pink default avatars.
- Add :meth:`Colour.pink` to get the pink default avatar colour.
- Add support for voice messages (:issue:`9358`)
- Add :attr:`MessageFlags.voice`
- Add :attr:`Attachment.duration` and :attr:`Attachment.waveform`
- Add :meth:`Attachment.is_voice_message`
- This does not support *sending* voice messages because this is currently unsupported by the API.
- Add support for new :attr:`Interaction.channel` attribute from the API update (:issue:`9339`).
- Add support for :attr:`TextChannel.default_thread_slowmode_delay` (:issue:`9291`).
- Add support for :attr:`ForumChannel.default_sort_order` (:issue:`9290`).
- Add support for ``default_reaction_emoji`` and ``default_forum_layout`` in :meth:`Guild.create_forum` (:issue:`9300`).
- Add support for ``widget_channel``, ``widget_enabled``, and ``mfa_level`` in :meth:`Guild.edit` (:issue:`9302`, :issue:`9303`).
- Add various new :class:`Permissions` and changes (:issue:`9312`, :issue:`9325`, :issue:`9358`, :issue:`9378`)
- Add new :attr:`~Permissions.manage_expressions`, :attr:`~Permissions.use_external_sounds`, :attr:`~Permissions.use_soundboard`, :attr:`~Permissions.send_voice_messages`, :attr:`~Permissions.create_expressions` permissions.
- Change :attr:`Permissions.manage_emojis` to be an alias of :attr:`~Permissions.manage_expressions`.
- Add various new properties to :class:`PartialAppInfo` and :class:`AppInfo` (:issue:`9298`).
- Add support for ``with_counts`` parameter to :meth:`Client.fetch_guilds` (:issue:`9369`).
- Add new :meth:`Guild.get_emoji` helper (:issue:`9296`).
- |commands| Add support for :attr:`Parameter.displayed_name <ext.commands.Parameter.displayed_name>` (:issue:`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 <https://youtrack.jetbrains.com/issue/PY-43798>`_.
- Fix channel edits with :meth:`Webhook.edit` sending two requests instead of one.
- Fix :attr:`StageChannel.last_message_id` always being ``None`` (:issue:`9422`).