From 216790f222ff50a8a28c9cd3150c21122677ce37 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Fri, 2 Jan 2026 21:21:08 +0100 Subject: [PATCH 01/10] =?UTF-8?q?=E2=9A=B0=EF=B8=8F=20Remove=20old=20code?= =?UTF-8?q?=20that=20only=20applies=20for=20bot=20guild=20owners=20(not=20?= =?UTF-8?q?possible=20anymore)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- discord/guild.py | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index 93598f9c9b..fbfdc69981 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -2097,28 +2097,6 @@ async def delete(self) -> None: """ await self._state.http.delete_guild(self.id) - async def set_mfa_required(self, required: bool, *, reason: str = None) -> None: - """|coro| - - Set whether it is required to have MFA enabled on your account - to perform moderation actions. You must be the guild owner to do this. - - Parameters - ---------- - required: :class:`bool` - Whether MFA should be required to perform moderation actions. - reason: :class:`str` - The reason to show up in the audit log. - - Raises - ------ - HTTPException - The operation failed. - Forbidden - You are not the owner of the guild. - """ - await self._state.http.edit_guild_mfa(self.id, required, reason=reason) - async def edit( self, *, @@ -2131,7 +2109,6 @@ async def edit( discovery_splash: bytes | None = MISSING, community: bool = MISSING, afk_channel: VoiceChannel | None = MISSING, - owner: Snowflake = MISSING, afk_timeout: int = MISSING, default_notifications: NotificationLevel = MISSING, verification_level: VerificationLevel = MISSING, @@ -2195,9 +2172,6 @@ async def edit( The new channel that is the AFK channel. Could be ``None`` for no AFK channel. afk_timeout: :class:`int` The number of seconds until someone is moved to the AFK channel. - owner: :class:`Member` - The new owner of the guild to transfer ownership to. Note that you must - be owner of the guild to do this. verification_level: :class:`VerificationLevel` The new verification level for the guild. default_notifications: :class:`NotificationLevel` @@ -2318,14 +2292,6 @@ async def edit( else: fields["public_updates_channel_id"] = public_updates_channel.id - if owner is not MISSING: - if self.owner_id != self._state.self_id: - raise InvalidArgument( - "To transfer ownership you must be the owner of the guild." - ) - - fields["owner_id"] = owner.id - if verification_level is not MISSING: if not isinstance(verification_level, VerificationLevel): raise InvalidArgument( From 425a568bed3d3482a5a4ce29b056b43988f15c4a Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Fri, 2 Jan 2026 21:23:47 +0100 Subject: [PATCH 02/10] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02431551e5..f035815d71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,11 @@ These changes are available on the `master` branch, but have not yet been releas ### Removed +- Removed `Guild.set_mfa_required` as this requires owner permissions + ([#3066](https://github.com/Pycord-Development/pycord/pull/3056)) +- Removed the `owner` keyword argument from `Guild.edit` as this requires owner permissions + ([#3066](https://github.com/Pycord-Development/pycord/pull/3056)) + ## [2.7.0] - 2025-12-24 ### Added From 03f257fdc3e2f88474e3917768232e0248c0d5e2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 2 Jan 2026 20:25:39 +0000 Subject: [PATCH 03/10] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f035815d71..267a1001f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,8 +34,8 @@ These changes are available on the `master` branch, but have not yet been releas - Removed `Guild.set_mfa_required` as this requires owner permissions ([#3066](https://github.com/Pycord-Development/pycord/pull/3056)) -- Removed the `owner` keyword argument from `Guild.edit` as this requires owner permissions - ([#3066](https://github.com/Pycord-Development/pycord/pull/3056)) +- Removed the `owner` keyword argument from `Guild.edit` as this requires owner + permissions ([#3066](https://github.com/Pycord-Development/pycord/pull/3056)) ## [2.7.0] - 2025-12-24 From 50832d5d5cd5cd61ab11150a50a6c666985b05db Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Fri, 2 Jan 2026 21:27:36 +0100 Subject: [PATCH 04/10] Fix PR number --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 267a1001f0..12ea110fe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,9 +33,9 @@ These changes are available on the `master` branch, but have not yet been releas ### Removed - Removed `Guild.set_mfa_required` as this requires owner permissions - ([#3066](https://github.com/Pycord-Development/pycord/pull/3056)) + ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) - Removed the `owner` keyword argument from `Guild.edit` as this requires owner - permissions ([#3066](https://github.com/Pycord-Development/pycord/pull/3056)) + permissions ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) ## [2.7.0] - 2025-12-24 From 0a4d14e98acd75b959a3516b687eb1ccff89856e Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sat, 3 Jan 2026 22:47:17 +0100 Subject: [PATCH 05/10] =?UTF-8?q?=E2=9A=B0=EF=B8=8F=20Remove=20`Guild.dele?= =?UTF-8?q?te`=20as=20well?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ discord/guild.py | 18 +----------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12ea110fe8..dcb617a1f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) - Removed the `owner` keyword argument from `Guild.edit` as this requires owner permissions ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) +- Removed `Guild.delete` as this requires owner permissions + ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) ## [2.7.0] - 2025-12-24 diff --git a/discord/guild.py b/discord/guild.py index fbfdc69981..dd6c91fdc1 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -2082,21 +2082,6 @@ async def leave(self) -> None: """ await self._state.http.leave_guild(self.id) - async def delete(self) -> None: - """|coro| - - Deletes the guild. You must be the guild owner to delete the - guild. - - Raises - ------ - HTTPException - Deleting the guild failed. - Forbidden - You do not have permissions to delete the guild. - """ - await self._state.http.delete_guild(self.id) - async def edit( self, *, @@ -2214,8 +2199,7 @@ async def edit( Editing the guild failed. InvalidArgument The image format passed in to ``icon`` is invalid. It must be - PNG or JPG. This is also raised if you are not the owner of the - guild and request an ownership transfer. + PNG or JPG. Returns -------- From 4a81784589e95b78fb3a83ca2fc6ebc70dd94a16 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sat, 3 Jan 2026 23:49:32 +0100 Subject: [PATCH 06/10] Remove final occurances of create_guild and delete_guild --- CHANGELOG.md | 5 +++-- discord/client.py | 49 --------------------------------------------- discord/http.py | 35 -------------------------------- discord/template.py | 34 ------------------------------- 4 files changed, 3 insertions(+), 120 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcb617a1f2..876ee65e84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,13 +32,14 @@ These changes are available on the `master` branch, but have not yet been releas ### Removed -- Removed `Guild.set_mfa_required` as this requires owner permissions +- Removed `Guild.set_mfa_required` and `Guild.delete` as this requires owner permissions ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) - Removed the `owner` keyword argument from `Guild.edit` as this requires owner permissions ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) -- Removed `Guild.delete` as this requires owner permissions +- Removed `Template.create_guild` `Client.create_guild` and as bots can no longer create guilds ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) + ## [2.7.0] - 2025-12-24 ### Added diff --git a/discord/client.py b/discord/client.py index f339cbfe92..749caedd55 100644 --- a/discord/client.py +++ b/discord/client.py @@ -1708,55 +1708,6 @@ async def fetch_guild(self, guild_id: int, /, *, with_counts=True) -> Guild: data = await self.http.get_guild(guild_id, with_counts=with_counts) return Guild(data=data, state=self._connection) - async def create_guild( - self, - *, - name: str, - icon: bytes = MISSING, - code: str = MISSING, - ) -> Guild: - """|coro| - - Creates a :class:`.Guild`. - - Bot accounts in more than 10 guilds are not allowed to create guilds. - - Parameters - ---------- - name: :class:`str` - The name of the guild. - icon: Optional[:class:`bytes`] - The :term:`py:bytes-like object` representing the icon. See :meth:`.ClientUser.edit` - for more details on what is expected. - code: :class:`str` - The code for a template to create the guild with. - - .. versionadded:: 1.4 - - Returns - ------- - :class:`.Guild` - The guild created. This is not the same guild that is - added to cache. - - Raises - ------ - :exc:`HTTPException` - Guild creation failed. - :exc:`InvalidArgument` - Invalid icon image format given. Must be PNG or JPG. - """ - if icon is not MISSING: - icon_base64 = utils._bytes_to_base64_data(icon) - else: - icon_base64 = None - - if code: - data = await self.http.create_from_template(code, name, icon_base64) - else: - data = await self.http.create_guild(name, icon_base64) - return Guild(data=data, state=self._connection) - async def fetch_stage_instance(self, channel_id: int, /) -> StageInstance: """|coro| diff --git a/discord/http.py b/discord/http.py index a131e598a7..2ea80b292b 100644 --- a/discord/http.py +++ b/discord/http.py @@ -1498,18 +1498,6 @@ def get_guild( Route("GET", "/guilds/{guild_id}", guild_id=guild_id), params=params ) - def delete_guild(self, guild_id: Snowflake) -> Response[None]: - return self.request(Route("DELETE", "/guilds/{guild_id}", guild_id=guild_id)) - - def create_guild(self, name: str, icon: str | None) -> Response[guild.Guild]: - payload = { - "name": name, - } - if icon: - payload["icon"] = icon - - return self.request(Route("POST", "/guilds"), json=payload) - def edit_guild( self, guild_id: Snowflake, *, reason: str | None = None, **fields: Any ) -> Response[guild.Guild]: @@ -1517,7 +1505,6 @@ def edit_guild( "name", "icon", "afk_timeout", - "owner_id", "afk_channel_id", "splash", "discovery_splash", @@ -1543,15 +1530,6 @@ def edit_guild( reason=reason, ) - def edit_guild_mfa( - self, guild_id: Snowflake, required: bool, *, reason: str | None - ) -> Response[guild.GuildMFAModify]: - return self.request( - Route("POST", "/guilds/{guild_id}/mfa", guild_id=guild_id), - json={"level": int(required)}, - reason=reason, - ) - def get_template(self, code: str) -> Response[template.Template]: return self.request(Route("GET", "/guilds/templates/{code}", code=code)) @@ -1608,19 +1586,6 @@ def delete_template(self, guild_id: Snowflake, code: str) -> Response[None]: ) ) - def create_from_template( - self, code: str, name: str, icon: str | None - ) -> Response[guild.Guild]: - payload = { - "name": name, - } - if icon: - payload["icon"] = icon - - return self.request( - Route("POST", "/guilds/templates/{code}", code=code), json=payload - ) - def get_bans( self, guild_id: Snowflake, diff --git a/discord/template.py b/discord/template.py index 74455a1727..d4cdffb568 100644 --- a/discord/template.py +++ b/discord/template.py @@ -168,40 +168,6 @@ def __repr__(self) -> str: f" creator={self.creator!r} source_guild={self.source_guild!r} is_dirty={self.is_dirty}>" ) - async def create_guild(self, name: str, icon: Any = None) -> Guild: - """|coro| - - Creates a :class:`.Guild` using the template. - - Bot accounts in more than 10 guilds are not allowed to create guilds. - - Parameters - ---------- - name: :class:`str` - The name of the guild. - icon: :class:`bytes` - The :term:`py:bytes-like object` representing the icon. See :meth:`.ClientUser.edit` - for more details on what is expected. - - Returns - ------- - :class:`.Guild` - The guild created. This is not the same guild that is - added to cache. - - Raises - ------ - HTTPException - Guild creation failed. - InvalidArgument - Invalid icon image format given. Must be PNG or JPG. - """ - if icon is not None: - icon = _bytes_to_base64_data(icon) - - data = await self._state.http.create_from_template(self.code, name, icon) - return Guild(data=data, state=self._state) - async def sync(self) -> Template: """|coro| From 833a57a8a3be55ed6052ee53f98f78e3a89d111d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 3 Jan 2026 22:50:08 +0000 Subject: [PATCH 07/10] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 876ee65e84..a32f095395 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,9 +36,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) - Removed the `owner` keyword argument from `Guild.edit` as this requires owner permissions ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) -- Removed `Template.create_guild` `Client.create_guild` and as bots can no longer create guilds - ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) - +- Removed `Template.create_guild` `Client.create_guild` and as bots can no longer create + guilds ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) ## [2.7.0] - 2025-12-24 From e63679953632afdb6a70d766206ef7e4bf6a961a Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sat, 3 Jan 2026 23:51:41 +0100 Subject: [PATCH 08/10] Changelog fixup --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a32f095395..8d1d4578c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,11 +32,11 @@ These changes are available on the `master` branch, but have not yet been releas ### Removed -- Removed `Guild.set_mfa_required` and `Guild.delete` as this requires owner permissions +- Removed `Guild.set_mfa_required` and `Guild.delete` as these require owner permissions ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) - Removed the `owner` keyword argument from `Guild.edit` as this requires owner permissions ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) -- Removed `Template.create_guild` `Client.create_guild` and as bots can no longer create +- Removed `Template.create_guild` and `Client.create_guild` as bots can no longer create guilds ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) ## [2.7.0] - 2025-12-24 From 43cdea20656fa3b1bc20b87df36de485a22b3181 Mon Sep 17 00:00:00 2001 From: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Date: Sat, 10 Jan 2026 13:49:25 +0300 Subject: [PATCH 09/10] update changelog Signed-off-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> --- CHANGELOG.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eda106dd72..f3430f807c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,12 +35,12 @@ These changes are available on the `master` branch, but have not yet been releas ### Removed -- Removed `Guild.set_mfa_required` and `Guild.delete` as these require owner permissions +- Removed guild creation and ownership related methods and arguments as they're + not allowed for bots anymore. ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) -- Removed the `owner` keyword argument from `Guild.edit` as this requires owner - permissions ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) -- Removed `Template.create_guild` and `Client.create_guild` as bots can no longer create - guilds ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) + - Removed `Guild.set_mfa_required`, `Guild.delete`, `Template.create_guild` + and `Client.create_guild`. + - Removed the `owner` keyword argument from `Guild.edit`. ## [2.7.0] - 2025-12-24 From 452e29d442e9a3442d309ce5f4787c5be356e295 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 10 Jan 2026 10:49:53 +0000 Subject: [PATCH 10/10] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3430f807c..bad2225448 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,11 +35,11 @@ These changes are available on the `master` branch, but have not yet been releas ### Removed -- Removed guild creation and ownership related methods and arguments as they're - not allowed for bots anymore. +- Removed guild creation and ownership related methods and arguments as they're not + allowed for bots anymore. ([#3056](https://github.com/Pycord-Development/pycord/pull/3056)) - - Removed `Guild.set_mfa_required`, `Guild.delete`, `Template.create_guild` - and `Client.create_guild`. + - Removed `Guild.set_mfa_required`, `Guild.delete`, `Template.create_guild` and + `Client.create_guild`. - Removed the `owner` keyword argument from `Guild.edit`. ## [2.7.0] - 2025-12-24