From 5a72391b7261dd876dc0fbdb1f3c92cccd0cf0c6 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 4 May 2021 10:42:13 -0400 Subject: [PATCH] Add thread related permissions --- discord/permissions.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/discord/permissions.py b/discord/permissions.py index ad78f3b9a..442f93fc5 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -140,7 +140,7 @@ class Permissions(BaseFlags): """A factory method that creates a :class:`Permissions` with all permissions set to ``True``. """ - return cls(0b111111111111111111111111111111111) + return cls(0b111111111111111111111111111111111111) @classmethod def all_channel(cls): @@ -479,6 +479,31 @@ class Permissions(BaseFlags): """ return 1 << 33 + @flag_value + def manage_threads(self): + """:class:`bool`: Returns ``True`` if a user can manage threads. + + .. versionadded:: 2.0 + """ + return 1 << 34 + + @flag_value + def use_threads(self): + """:class:`bool`: Returns ``True`` if a user can create and participate in public threads. + + .. versionadded:: 2.0 + """ + return 1 << 35 + + @flag_value + def use_private_threads(self): + """:class:`bool`: Returns ``True`` if a user can create and participate in private threads. + + .. versionadded:: 2.0 + """ + return 1 << 36 + + def augment_from_permissions(cls): cls.VALID_NAMES = set(Permissions.VALID_FLAGS) aliases = set()