diff options
| author | Rapptz <[email protected]> | 2015-10-17 07:17:40 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2015-10-17 07:17:40 -0400 |
| commit | 8fbaa29e9c6ed402f68a7036f324d46c4cc28732 (patch) | |
| tree | c9a0fdaa494f8d8a5ee8acaef2a5af86c5d29a19 | |
| parent | Add Channel.permissions_for and PrivateChannel.permissions_for. (diff) | |
| download | discord.py-8fbaa29e9c6ed402f68a7036f324d46c4cc28732.tar.xz discord.py-8fbaa29e9c6ed402f68a7036f324d46c4cc28732.zip | |
Document Permissions constants and set default permissions to 0.
| -rw-r--r-- | discord/permissions.py | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/discord/permissions.py b/discord/permissions.py index 1b58bf54..44ecd853 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -37,6 +37,34 @@ def create_permission_masks(cls): class Permissions(object): """Wraps up the Discord permission value. + Class attributes: + + .. attribute:: NONE + + A :class:`Permission` with all permissions set to False. + .. attribute:: ALL + + A :class:`Permission` with all permissions set to True. + .. attribute:: ALL_CHANNEL + + A :class:`Permission` with all channel-specific permissions set to True + and the server-specific ones set to False. The server-specific permissions + are currently: + + - can_manager_server + - can_kick_members + - can_ban_members + + .. attribute:: GENERAL + + A :class:`Permission` with all "General" permissions set to True. + .. attribute:: TEXT + + A :class:`Permission` with all "Text" permissions set to True. + .. attribute:: VOICE + + A :class:`Permission` with all "Voice" permissions set to True. + Instance attributes: .. attribute:: value @@ -49,7 +77,7 @@ class Permissions(object): were regular bools. This allows you to edit permissions. """ - def __init__(self, permissions, **kwargs): + def __init__(self, permissions=0, **kwargs): self.value = permissions def _bit(self, index): |