diff --git a/changelog/1595.doc.rst b/changelog/1595.doc.rst new file mode 100644 index 0000000000..b4a9beee6c --- /dev/null +++ b/changelog/1595.doc.rst @@ -0,0 +1 @@ +Update list of guild :attr:`~Guild.features`, and add administrator permission requirement to :meth:`Guild.prune_members` if the guild has the ``PRUNE_REQUIRES_ADMIN`` feature. diff --git a/disnake/guild.py b/disnake/guild.py index e1eb40d9a0..1596b720fb 100644 --- a/disnake/guild.py +++ b/disnake/guild.py @@ -312,7 +312,10 @@ class Guild(Hashable): - ``DEVELOPER_SUPPORT_SERVER``: Guild is set as a support server in the app directory. - ``DISCOVERABLE``: Guild shows up in Server Discovery. - ``ENABLED_DISCOVERABLE_BEFORE``: Guild had Server Discovery enabled at least once. + - ``ENHANCED_ROLE_COLORS``: Guild can use gradient role colours. - ``FEATURABLE``: Guild is able to be featured in Server Discovery. + - ``GUESTS_ENABLED``: Guild has access to guest invites. + - ``GUILD_TAGS``: Guild can set guild tags. - ``HAS_DIRECTORY_ENTRY``: Guild is listed in a student hub. - ``HUB``: Guild is a student hub. - ``INVITE_SPLASH``: Guild's invite page can have a special splash. @@ -327,6 +330,7 @@ class Guild(Hashable): - ``PARTNERED``: Guild is a partnered server. - ``PREVIEW_ENABLED``: Guild can be viewed before being accepted via Membership Screening. - ``PRIVATE_THREADS``: Guild has access to create private threads (no longer has any effect). + - ``PRUNE_REQUIRES_ADMIN``: Guild requires administrator permissions to prune members. - ``RAID_ALERTS_DISABLED``: Guild has disabled alerts for join raids in the configured safety alerts channel. - ``ROLE_ICONS``: Guild has access to role icons. - ``ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE``: Guild has role subscriptions that can be purchased. @@ -3150,7 +3154,9 @@ async def prune_members( ``days`` number of days and they have no roles. You must have the :attr:`~Permissions.manage_guild` and - :attr:`~Permissions.kick_members` permissions to use this. + :attr:`~Permissions.kick_members` permissions to use this; + if :attr:`Guild.features` contains ``PRUNE_REQUIRES_ADMIN``, + you must have :attr:`~Permissions.administrator` permission instead. To check how many members you would prune without actually pruning, see the :meth:`estimate_pruned_members` function. @@ -3262,6 +3268,11 @@ async def estimate_pruned_members(self, *, days: int, roles: list[Snowflake] = M pruning members, it returns how many members it would prune from the guild had it been called. + You must have the :attr:`~Permissions.manage_guild` and + :attr:`~Permissions.kick_members` permissions to use this; + if :attr:`Guild.features` contains ``PRUNE_REQUIRES_ADMIN``, + you must have :attr:`~Permissions.administrator` permission instead. + .. versionchanged:: 2.6 Raises :exc:`TypeError` instead of ``InvalidArgument``. diff --git a/disnake/types/guild.py b/disnake/types/guild.py index 6ed99a4012..5094826c57 100644 --- a/disnake/types/guild.py +++ b/disnake/types/guild.py @@ -53,14 +53,15 @@ class UnavailableGuild(TypedDict): "DEVELOPER_SUPPORT_SERVER", "DISCOVERABLE", "ENABLED_DISCOVERABLE_BEFORE", + "ENHANCED_ROLE_COLORS", "FEATURABLE", - "GUILD_HOME_TEST", # not yet documented/finalised + "GUESTS_ENABLED", + "GUILD_TAGS", "HAS_DIRECTORY_ENTRY", "HUB", "INVITE_SPLASH", "INVITES_DISABLED", "LINKED_TO_HUB", - "MEMBER_PROFILES", # not sure what this does, if anything "MEMBER_VERIFICATION_GATE_ENABLED", "MORE_EMOJI", "MORE_SOUNDBOARD", @@ -70,6 +71,7 @@ class UnavailableGuild(TypedDict): "PARTNERED", "PREVIEW_ENABLED", "PRIVATE_THREADS", # deprecated + "PRUNE_REQUIRES_ADMIN", "RAID_ALERTS_DISABLED", "RELAY_ENABLED", "ROLE_ICONS",