From 723584ca19e34604798043d6fa265785af794ebd Mon Sep 17 00:00:00 2001 From: Narmy <67862800+NarmyOnDiscord@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:42:57 +0200 Subject: [PATCH] Add Permissions.elevated() --- discord/permissions.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/discord/permissions.py b/discord/permissions.py index df5e5ce13..d018e9ab9 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -252,6 +252,27 @@ class Permissions(BaseFlags): """ return cls(0b1010000000000000000010000) + @classmethod + def elevated(cls) -> Self: + """A factory method that creates a :class:`Permissions` with all permissions + that require 2FA set to ``True``. These permissions are currently: + + - :attr:`kick_members` + - :attr:`ban_members` + - :attr:`administrator` + - :attr:`manage_channels` + - :attr:`manage_guild` + - :attr:`manage_messages` + - :attr:`manage_roles` + - :attr:`manage_webhooks` + - :attr:`manage_emojis_and_stickers` + - :attr:`manage_threads` + - :attr:`moderate_members` + + .. versionadded:: 2.0 + """ + return cls(0b10000010001110000000000000010000000111110) + @classmethod def advanced(cls) -> Self: """A factory method that creates a :class:`Permissions` with all