Account for user installations in Channel.permissions_for

Co-authored-by: owocado <24418520+owocado@users.noreply.github.com>
This commit is contained in:
Kile
2024-06-12 20:25:49 +02:00
committed by GitHub
parent 895d6c37df
commit bb1d09a13f
2 changed files with 30 additions and 0 deletions

View File

@ -208,6 +208,22 @@ class Permissions(BaseFlags):
base.send_messages_in_threads = False
return base
@classmethod
def _user_installed_permissions(cls, *, in_guild: bool) -> Self:
base = cls.none()
base.send_messages = True
base.attach_files = True
base.embed_links = True
base.external_emojis = True
base.send_voice_messages = True
if in_guild:
# Logically this is False but if not set to True,
# permissions just become 0.
base.read_messages = True
base.send_tts_messages = True
base.send_messages_in_threads = True
return base
@classmethod
def all_channel(cls) -> Self:
"""A :class:`Permissions` with all channel-specific permissions set to