mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-07 10:22:59 +00:00
Account for user installations in Channel.permissions_for
Co-authored-by: owocado <24418520+owocado@users.noreply.github.com>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user