From f5f9667615719229f572c20a6253002a317143e7 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sat, 23 May 2026 15:24:44 +0200 Subject: [PATCH 1/7] Fix flags assignment when editing PartialMessages --- discord/message.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discord/message.py b/discord/message.py index 1781bf45f1..5dffbbe668 100644 --- a/discord/message.py +++ b/discord/message.py @@ -2549,7 +2549,6 @@ async def edit(self, **fields: Any) -> Message | None: suppress = fields.pop("suppress", False) flags = MessageFlags._from_value(0) flags.suppress_embeds = suppress - fields["flags"] = flags.value delete_after = fields.pop("delete_after", None) @@ -2573,7 +2572,10 @@ async def edit(self, **fields: Any) -> Message | None: if view is not MISSING: self._state.prevent_view_updates_for(self.id) fields["components"] = view.to_components() if view else [] + if view and view.is_components_v2(): + flags.is_components_v2 = True + fields["flags"] = flags.value if fields: data = await self._state.http.edit_message( self.channel.id, self.id, **fields From d1b7b85e22074789730be1d973615957dbc731be Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sat, 23 May 2026 15:29:40 +0200 Subject: [PATCH 2/7] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d5c51c220..6a4871ca65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ released. - Include `bypass_slowmode` in `Permissions.all`. ([#3231](https://github.com/Pycord-Development/pycord/pull/3231)) +- Fix `PartialMessage.edit` to work with `discord.ui.DesignerView`. + ([#3237](https://github.com/Pycord-Development/pycord/pull/3237)) ### Deprecated From 2cec2f49ff4d1fd346b1e92a9e5f4cd2e7494222 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 24 May 2026 12:37:22 +0200 Subject: [PATCH 3/7] Add similar fix for `Webhook.edit_message` as well Co-authored-by: NeloBlivion <41271523+neloblivion@users.noreply.github.com> --- CHANGELOG.md | 3 ++- discord/webhook/async_.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a4871ca65..faf2175f0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,8 @@ released. - Include `bypass_slowmode` in `Permissions.all`. ([#3231](https://github.com/Pycord-Development/pycord/pull/3231)) -- Fix `PartialMessage.edit` to work with `discord.ui.DesignerView`. +- Fix `PartialMessage.edit` and `Webhook.edit_message` to work with + `discord.ui.DesignerView`. ([#3237](https://github.com/Pycord-Development/pycord/pull/3237)) ### Deprecated diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index 5dcd8e4bd6..9347971f78 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -2115,8 +2115,8 @@ async def edit_message( raise InvalidArgument( "Dispatchable Webhook views require an associated state with the webhook" ) - - self._state.prevent_view_updates_for(message_id) + if self._state._parent: + self._state.prevent_view_updates_for(message_id) if self.type is not WebhookType.application: with_components = True From 46c7f0eb02611c96313479c632dfc02e2955e989 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 24 May 2026 12:45:48 +0200 Subject: [PATCH 4/7] Split changelog entries --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index faf2175f0a..608e0c8864 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,8 +19,9 @@ released. - Include `bypass_slowmode` in `Permissions.all`. ([#3231](https://github.com/Pycord-Development/pycord/pull/3231)) -- Fix `PartialMessage.edit` and `Webhook.edit_message` to work with - `discord.ui.DesignerView`. +- Fixed `PartialMessage.edit` to work with `discord.ui.DesignerView`. + ([#3237](https://github.com/Pycord-Development/pycord/pull/3237)) +- Fixed `AttributeError` when using `Webhook.edit_message` with views. ([#3237](https://github.com/Pycord-Development/pycord/pull/3237)) ### Deprecated From e0a32eebd95ad2daf93e0b35d68b4eeb7962f8ac Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 24 May 2026 23:37:50 +0200 Subject: [PATCH 5/7] Revert "Add similar fix for `Webhook.edit_message` as well" This reverts commit 2cec2f49 --- CHANGELOG.md | 4 +--- discord/webhook/async_.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 608e0c8864..431658809d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,9 +19,7 @@ released. - Include `bypass_slowmode` in `Permissions.all`. ([#3231](https://github.com/Pycord-Development/pycord/pull/3231)) -- Fixed `PartialMessage.edit` to work with `discord.ui.DesignerView`. - ([#3237](https://github.com/Pycord-Development/pycord/pull/3237)) -- Fixed `AttributeError` when using `Webhook.edit_message` with views. +- Fixed `PartialMessage.edit to work with `discord.ui.DesignerView`. ([#3237](https://github.com/Pycord-Development/pycord/pull/3237)) ### Deprecated diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index 9347971f78..5dcd8e4bd6 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -2115,8 +2115,8 @@ async def edit_message( raise InvalidArgument( "Dispatchable Webhook views require an associated state with the webhook" ) - if self._state._parent: - self._state.prevent_view_updates_for(message_id) + + self._state.prevent_view_updates_for(message_id) if self.type is not WebhookType.application: with_components = True From a30582384ebc65744b014e0097243a98c15fd693 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 24 May 2026 21:41:34 +0000 Subject: [PATCH 6/7] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 174 ++++++++++++++++++++------------------------------- 1 file changed, 69 insertions(+), 105 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c866ab0031..3c66fcc8e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,7 @@ possible (see our [Version Guarantees] for more info). ## [Unreleased] -These changes are available on the `master` branch, but have not yet been -released. +These changes are available on the `master` branch, but have not yet been released. ### Added @@ -113,8 +112,8 @@ released. - Removed the guild creation and ownership-related methods and arguments due to updated restrictions. ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) - - Removed the following methods: `Guild.set_mfa_required`, `Guild.delete`, - `Template.create_guild`, and `Client.create_guild`. + - Removed the following methods: `Guild.set_mfa_required`, `Guild.delete`, + `Template.create_guild`, and `Client.create_guild`. ## [2.8.0rc2] - 2026-04-14 @@ -195,8 +194,8 @@ released. - Removed the guild creation and ownership-related methods and arguments due to updated restrictions. ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) - - Removed the following methods: `Guild.set_mfa_required`, `Guild.delete`, - `Template.create_guild`, and `Client.create_guild`. + - Removed the following methods: `Guild.set_mfa_required`, `Guild.delete`, + `Template.create_guild`, and `Client.create_guild`. ## [2.7.2] - 2026-04-14 @@ -289,12 +288,12 @@ released. ([#2908](https://github.com/Pycord-Development/pycord/pull/2908)) - Added support for select default values. ([#2899](https://github.com/Pycord-Development/pycord/pull/2899)) - - Adds a new generic parameter to selects to type `ui.Select.values` return type. - - Adds `SelectDefaultValue` object to create select default values. - - Adds `SelectDefaultValueType` enum. - - Adds pre-typed and pre-constructed with select_type `ui.Select` aliases for the - different select types: `ui.StringSelect`, `ui.UserSelect`, `ui.RoleSelect`, - `ui.MentionableSelect`, and `ui.ChannelSelect`. + - Adds a new generic parameter to selects to type `ui.Select.values` return type. + - Adds `SelectDefaultValue` object to create select default values. + - Adds `SelectDefaultValueType` enum. + - Adds pre-typed and pre-constructed with select_type `ui.Select` aliases for the + different select types: `ui.StringSelect`, `ui.UserSelect`, `ui.RoleSelect`, + `ui.MentionableSelect`, and `ui.ChannelSelect`. - Added `store` parameter to `View` and `Modal` classes. ([#2904](https://github.com/Pycord-Development/pycord/pull/2904/)) - Added `Webhook.parent` and `Webhook.from_interaction` @@ -347,14 +346,14 @@ released. - Added `VoiceMessage` subclass of `File` to allow voice messages to be sent. ([#2579](https://github.com/Pycord-Development/pycord/pull/2579)) - Added the following soundboard-related features: - - Manage guild soundboard sounds with `Guild.fetch_sounds()`, `Guild.create_sound()`, - `SoundboardSound.edit()`, and `SoundboardSound.delete()`. - - Access Discord default sounds with `Client.fetch_default_sounds()`. - - Play sounds in voice channels with `VoiceChannel.send_soundboard_sound()`. - - New `on_voice_channel_effect_send` event for sound and emoji effects. - - Soundboard limits based on guild premium tier (8-48 slots) in - `Guild.soundboard_limit`. - ([#2623](https://github.com/Pycord-Development/pycord/pull/2623)) + - Manage guild soundboard sounds with `Guild.fetch_sounds()`, `Guild.create_sound()`, + `SoundboardSound.edit()`, and `SoundboardSound.delete()`. + - Access Discord default sounds with `Client.fetch_default_sounds()`. + - Play sounds in voice channels with `VoiceChannel.send_soundboard_sound()`. + - New `on_voice_channel_effect_send` event for sound and emoji effects. + - Soundboard limits based on guild premium tier (8-48 slots) in + `Guild.soundboard_limit`. + ([#2623](https://github.com/Pycord-Development/pycord/pull/2623)) - Added new `Subscription` object and related methods/events. ([#2564](https://github.com/Pycord-Development/pycord/pull/2564)) - Added `Message.forward_to`, `Message.snapshots`, and other related attributes. @@ -397,20 +396,20 @@ released. - Overhauled support for Components V2 and new Modal components ([#2904](https://github.com/Pycord-Development/pycord/pull/2904/)) - - Revert `discord.ui.View` and `discord.ui.Modal` to 2.6.1 behavior; not compatible - with new features. - - Implemented `discord.ui.DesignerView` and `discord.ui.DesignerModal` to support new - components. - - `DesignerView` and `Container` do not support `Button` and `Select` directly; use - `discord.ui.ActionRow` instead. - - `DesignerModal` does not support `InputText` and `Select` directly; use - `discord.ui.Label` instead. - - Removed `InputText.description`, `Select.label` and `Select.description`; these are - now attributes of `Label`. - - `discord.ui.Item` is now a base class for `ViewItem` and `ModalItem`; all items - inherit from these. - - All view and modal classes now inherit from a base `ItemInterface` class, split into - `BaseView` and `BaseModal` + - Revert `discord.ui.View` and `discord.ui.Modal` to 2.6.1 behavior; not compatible + with new features. + - Implemented `discord.ui.DesignerView` and `discord.ui.DesignerModal` to support new + components. + - `DesignerView` and `Container` do not support `Button` and `Select` directly; use + `discord.ui.ActionRow` instead. + - `DesignerModal` does not support `InputText` and `Select` directly; use + `discord.ui.Label` instead. + - Removed `InputText.description`, `Select.label` and `Select.description`; these are + now attributes of `Label`. + - `discord.ui.Item` is now a base class for `ViewItem` and `ModalItem`; all items + inherit from these. + - All view and modal classes now inherit from a base `ItemInterface` class, split into + `BaseView` and `BaseModal` - Renamed `cover` property of `ScheduledEvent` and `cover` argument of `ScheduledEvent.edit` to `image`. ([#2496](https://github.com/Pycord-Development/pycord/pull/2496)) @@ -591,12 +590,12 @@ released. ([#2908](https://github.com/Pycord-Development/pycord/pull/2908)) - Added support for select default values. ([#2899](https://github.com/Pycord-Development/pycord/pull/2899)) - - Adds a new generic parameter to selects to type `ui.Select.values` return type. - - Adds `SelectDefaultValue` object to create select default values. - - Adds `SelectDefaultValueType` enum. - - Adds pre-typed and pre-constructed with select_type `ui.Select` aliases for the - different select types: `ui.StringSelect`, `ui.UserSelect`, `ui.RoleSelect`, - `ui.MentionableSelect`, and `ui.ChannelSelect`. + - Adds a new generic parameter to selects to type `ui.Select.values` return type. + - Adds `SelectDefaultValue` object to create select default values. + - Adds `SelectDefaultValueType` enum. + - Adds pre-typed and pre-constructed with select_type `ui.Select` aliases for the + different select types: `ui.StringSelect`, `ui.UserSelect`, `ui.RoleSelect`, + `ui.MentionableSelect`, and `ui.ChannelSelect`. - Added `store` parameter to `View` and `Modal` classes. ([#2904](https://github.com/Pycord-Development/pycord/pull/2904/)) - Added `Webhook.parent` and `Webhook.from_interaction` @@ -618,20 +617,20 @@ released. - Overhauled support for Components V2 and new Modal components ([#2904](https://github.com/Pycord-Development/pycord/pull/2904/)) - - Revert `discord.ui.View` and `discord.ui.Modal` to 2.6.1 behavior; not compatible - with new features. - - Implemented `discord.ui.DesignerView` and `discord.ui.DesignerModal` to support new - components. - - `DesignerView` and `Container` do not support `Button` and `Select` directly; use - `discord.ui.ActionRow` instead. - - `DesignerModal` does not support `InputText` and `Select` directly; use - `discord.ui.Label` instead. - - Removed `InputText.description`, `Select.label` and `Select.description`; these are - now attributes of `Label`. - - `discord.ui.Item` is now a base class for `ViewItem` and `ModalItem`; all items - inherit from these. - - All view and modal classes now inherit from a base `ItemInterface` class, split into - `BaseView` and `BaseModal` + - Revert `discord.ui.View` and `discord.ui.Modal` to 2.6.1 behavior; not compatible + with new features. + - Implemented `discord.ui.DesignerView` and `discord.ui.DesignerModal` to support new + components. + - `DesignerView` and `Container` do not support `Button` and `Select` directly; use + `discord.ui.ActionRow` instead. + - `DesignerModal` does not support `InputText` and `Select` directly; use + `discord.ui.Label` instead. + - Removed `InputText.description`, `Select.label` and `Select.description`; these are + now attributes of `Label`. + - `discord.ui.Item` is now a base class for `ViewItem` and `ModalItem`; all items + inherit from these. + - All view and modal classes now inherit from a base `ItemInterface` class, split into + `BaseView` and `BaseModal` ### Fixed @@ -714,14 +713,14 @@ released. - Added `VoiceMessage` subclass of `File` to allow voice messages to be sent. ([#2579](https://github.com/Pycord-Development/pycord/pull/2579)) - Added the following soundboard-related features: - - Manage guild soundboard sounds with `Guild.fetch_sounds()`, `Guild.create_sound()`, - `SoundboardSound.edit()`, and `SoundboardSound.delete()`. - - Access Discord default sounds with `Client.fetch_default_sounds()`. - - Play sounds in voice channels with `VoiceChannel.send_soundboard_sound()`. - - New `on_voice_channel_effect_send` event for sound and emoji effects. - - Soundboard limits based on guild premium tier (8-48 slots) in - `Guild.soundboard_limit`. - ([#2623](https://github.com/Pycord-Development/pycord/pull/2623)) + - Manage guild soundboard sounds with `Guild.fetch_sounds()`, `Guild.create_sound()`, + `SoundboardSound.edit()`, and `SoundboardSound.delete()`. + - Access Discord default sounds with `Client.fetch_default_sounds()`. + - Play sounds in voice channels with `VoiceChannel.send_soundboard_sound()`. + - New `on_voice_channel_effect_send` event for sound and emoji effects. + - Soundboard limits based on guild premium tier (8-48 slots) in + `Guild.soundboard_limit`. + ([#2623](https://github.com/Pycord-Development/pycord/pull/2623)) - Added new `Subscription` object and related methods/events. ([#2564](https://github.com/Pycord-Development/pycord/pull/2564)) - Added `Message.forward_to`, `Message.snapshots`, and other related attributes. @@ -1784,81 +1783,46 @@ released. ([#1240](https://github.com/Pycord-Development/pycord/pull/1240)) [unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.8.0...HEAD - [2.8.0]: https://github.com/Pycord-Development/pycord/compare/v2.7.2...v2.8.0 - [2.8.0rc1]: https://github.com/Pycord-Development/pycord/compare/v2.8.0rc1...v2.8.0rc2 - [2.8.0rc1]: https://github.com/Pycord-Development/pycord/compare/v2.7.2...v2.8.0rc1 - [2.7.2]: https://github.com/Pycord-Development/pycord/compare/v2.7.1...v2.7.2 - [2.7.1]: https://github.com/Pycord-Development/pycord/compare/v2.7.0...v2.7.1 - [2.7.0]: https://github.com/Pycord-Development/pycord/compare/v2.7.0rc2...v2.7.0 - [2.7.0rc2]: https://github.com/Pycord-Development/pycord/compare/v2.7.0rc1...v2.7.0rc2 - [2.7.0rc1]: https://github.com/Pycord-Development/pycord/compare/v2.6.0...v2.7.0rc1 - [2.6.1]: https://github.com/Pycord-Development/pycord/compare/v2.6.0...v2.6.1 - [2.6.0]: https://github.com/Pycord-Development/pycord/compare/v2.5.0...v2.6.0 - [2.5.0]: https://github.com/Pycord-Development/pycord/compare/v2.4.1...v2.5.0 - [2.4.1]: https://github.com/Pycord-Development/pycord/compare/v2.4.0...v2.4.1 - [2.4.0]: https://github.com/Pycord-Development/pycord/compare/v2.3.3...v2.4.0 - [2.3.3]: https://github.com/Pycord-Development/pycord/compare/v2.3.2...v2.3.3 - [2.3.2]: https://github.com/Pycord-Development/pycord/compare/v2.3.1...v2.3.2 - [2.3.1]: https://github.com/Pycord-Development/pycord/compare/v2.3.0...v2.3.1 - [2.3.0]: https://github.com/Pycord-Development/pycord/compare/v2.2.2...v2.3.0 - [2.2.2]: https://github.com/Pycord-Development/pycord/compare/v2.2.1...v2.2.2 - [2.2.1]: https://github.com/Pycord-Development/pycord/compare/v2.2.0...v2.2.1 - [2.2.0]: https://github.com/Pycord-Development/pycord/compare/v2.1.3...v2.2.0 - [2.1.3]: https://github.com/Pycord-Development/pycord/compare/v2.1.2...v2.1.3 - [2.1.2]: https://github.com/Pycord-Development/pycord/compare/v2.1.1...v2.1.2 - [2.1.1]: https://github.com/Pycord-Development/pycord/compare/v2.1.0...v2.1.1 - [2.1.0]: https://github.com/Pycord-Development/pycord/compare/v2.0.1...v2.1.0 - [2.0.1]: https://github.com/Pycord-Development/pycord/compare/v2.0.0...v2.0.1 - [2.0.0]: https://github.com/Pycord-Development/pycord/compare/v2.0.0-rc.1...v2.0.0 - [2.0.0-rc.1]: -https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.7...v2.0.0-rc.1 - + https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.7...v2.0.0-rc.1 [2.0.0-beta.7]: -https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.6...v2.0.0-beta.7 - + https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.6...v2.0.0-beta.7 [2.0.0-beta.6]: -https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.5...v2.0.0-beta.6 - + https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.5...v2.0.0-beta.6 [2.0.0-beta.5]: -https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.4...v2.0.0-beta.5 - + https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.4...v2.0.0-beta.5 [2.0.0-beta.4]: -https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.3...v2.0.0-beta.4 - + https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.3...v2.0.0-beta.4 [2.0.0-beta.3]: -https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.2...v2.0.0-beta.3 - + https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.2...v2.0.0-beta.3 [2.0.0-beta.2]: -https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.1...v2.0.0-beta.2 - + https://github.com/Pycord-Development/pycord/compare/v2.0.0-beta.1...v2.0.0-beta.2 [2.0.0-beta.1]: -https://github.com/Pycord-Development/pycord/compare/v1.7.3...v2.0.0-beta.1 - + https://github.com/Pycord-Development/pycord/compare/v1.7.3...v2.0.0-beta.1 [version guarantees]: https://docs.pycord.dev/en/stable/version_guarantees.html From 815d5a52d7f2d457d0c9951b247a9ed3bcba9005 Mon Sep 17 00:00:00 2001 From: Paillat Date: Wed, 10 Jun 2026 19:13:04 +0200 Subject: [PATCH 7/7] Update CHANGELOG.md Signed-off-by: Paillat --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0be30953b7..0d96cc2dbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ These changes are available on the `master` branch, but have not yet been releas ([#3231](https://github.com/Pycord-Development/pycord/pull/3231)) - Allow `ForumTag` to be created without an emoji. ([#3245](https://github.com/Pycord-Development/pycord/pull/3245)) -- Fixed `PartialMessage.edit to work with `discord.ui.DesignerView`. +- Fixed `PartialMessage.edit` to work with `DesignerView`. ([#3237](https://github.com/Pycord-Development/pycord/pull/3237)) ### Deprecated