90 Commits

Author SHA1 Message Date
Lint Action
7513c2138f Fix code style issues with Black 2021-09-05 21:34:20 +00:00
iDutchy
b75be64044
Update permissions.py
A better implementation :)
2021-09-02 03:05:49 +02:00
Arthur Jovart
8cdc1f4ad9
Alias admin to administrators in permissions. This needs to be tested, but should be working. 2021-08-29 00:26:26 +02:00
James Gayfer
41d22f4312
Fix all_channel permissions
When the new permission for send_messages_in_threads was added, we added
the wrong bit. Instead of adding the bit as the most significant (37),
we added it as the last significant, which invalidated most of the
permissions defined by this method.
2021-08-27 20:04:18 -04:00
James Gayfer
4aafa39e8c
Update thread permissions
Discord has renamed / repurposed "Use Public Threads" and "Use Private
Threads", as well as added a new permission "Send Messages in Threads".

For more information, see:
  https://github.com/discord/discord-api-docs/pull/3672
2021-08-26 15:53:21 -04:00
apple502j
851dfc3c75
Fix permissions.py typing 2021-08-23 01:57:58 -04:00
Rapptz
4a6670c062 Add missing typehint for PermissionOverwrite.pair
Technically inferred but better to be explicit
2021-08-22 07:29:30 -04:00
z03h
27debe18ca
Update Permissions classmethods to include thread/stage/sticker 2021-08-18 00:46:30 -04:00
Nadir Chowdhury
60d82cf908
implement guild stickers 2021-07-30 21:25:41 -04:00
Rapptz
be5603141e Remove slots from flags
Fix #7159
2021-07-03 10:52:35 -04:00
Rapptz
88620d052a Typehint permissions 2021-07-03 08:30:27 -04:00
Rapptz
5a72391b72 Add thread related permissions 2021-06-08 07:26:22 -04:00
Rapptz
598057ee79 Add Permissions.manage_events 2021-05-05 14:16:39 -04:00
Rapptz
9d39b135f4 Modernize code to use f-strings
This also removes the encoding on the top, since Python 3 does it by
default. It also changes some methods to use `yield from`.
2021-04-04 07:03:53 -04:00
Nadir Chowdhury
1b2688518e
Implement StageChannel and related methods 2021-04-03 22:43:41 -04:00
Rapptz
3576e2ee01 Add support for Permissions.request_to_speak 2021-04-01 00:53:07 -04:00
Nadir Chowdhury
7d345e8e4e
remove trailing whitespace 2021-03-13 00:42:25 -05:00
TheOneMusic
259c3909a8
Fix Permissions.all_channel documentation to link attributes 2021-03-01 08:57:28 -05:00
TheOneMusic
9c52432274
Update permission class methods to match Discord UI 2021-02-28 23:30:08 -05:00
Rapptz
a8f44174ba Add Permissions.use_slash_commands 2021-02-18 07:28:37 -05:00
Nihaal Sangha
69bdc3a184
Change copyright year to present 2021-01-15 05:28:11 -05:00
Rapptz
1c03a4aac9 Evict keys when they're set to None in PermissionOverwrite
Fixes #5929
2020-10-17 01:59:00 -04:00
apple502j
0ebf5b2fa7
Add support for flag alias 2020-09-24 00:16:37 -04:00
Michael
93fa46713a
Fix and add documentation 2020-09-23 03:19:35 -04:00
Skezza
c3bca7ec73
Documentation formatting 2020-06-30 23:32:00 -04:00
Sebastian Law
b4b953bfc6
Fix various inconsistencies within the documentation (#5067) 2020-06-28 03:45:58 -04:00
Rapptz
215fed831c Mention that you can create Permissions via kwargs now 2020-01-23 00:04:45 -05:00
Rapptz
02397306b2 Drop superfluous zero in version related changes in the documentation 2020-01-21 03:47:56 -05:00
Rapptz
6071607176 Bump copyright year to 2020
Closes #2510
2020-01-19 20:03:00 -05:00
Rapptz
650beee53d Add instance check to PermissionOvewrite.__eq__ 2020-01-19 02:41:50 -05:00
Rapptz
2770137bd6 Redesign permissions to allow aliases to be used.
This adds manage_permissions, view_channel, and use_external_emojis
aliases to Permissions. It should be noted that to prevent breaking
changes and for sake of usefulness, aliases are not included in
the `__iter__` for either Permissions or PermissionOverwrite.

Fixes #2496
2020-01-11 19:52:25 -05:00
Josh B
46246a2844 Add view_guild_insights permission 2019-11-15 04:23:26 -05:00
NCPlayz
3c9bcc2851 Improve documentation 2019-06-07 19:27:46 -04:00
NCPlayz
84e86ff666 Add Permissions.stream
Add stream to Permissions classmethods
2019-04-12 20:58:11 -04:00
DevilXD
9d92939fbe Added support for comparing PermissionOverwrites
When trying to check if a specific permission overwrite is already set on a channel, it can be done by fetching the already existing overwrite and comparing it with a one you want to set. Comparing them directly wasn't possible before, and this small change allows for that.
Could be expanded for other comparison operators, not sure how it would work though.
2019-01-28 22:22:54 -05:00
Dante Dam
9656a21ebe Bumped copyright years to 2019. 2019-01-28 22:22:50 -05:00
StarrFox
eab0a4f38d Fix typo in Permissions.all_channel 2019-01-28 21:41:56 -05:00
Laurenz
dd884a6afe Update Message.mention_everyone docs to include @here 2018-12-14 19:05:34 -05:00
Hornwitser
633192b3cd [lint] Replace equality comparisons to singletons
Restrict the values accepted by comparisons with booleans to be actual
booleans.

Minor breaking of undocumented behaviour in permissions; the value to
set bits to must be booleans (as indicated by the type error thrown).
2018-11-24 22:17:57 -05:00
BeatButton
a4d1599ce9 Change docstrings to raw-strings 2018-09-14 22:55:27 -04:00
Hornwitser
c8b49d37be [lint] Fix incorrect and inconsistent whitespace
Adjust whitespace to be consistent with the rest of the library.
2018-08-22 21:43:53 -04:00
slice
e6f1a7e93a
Add Permissions.priority_speaker. 2018-07-31 19:58:45 -07:00
Hornwitser
96baabcaa2 Fix typo in Permissions.is_subset/is_superset
Fix the name for the other's type when raising TypeError being
incorrectly written as __class__name instead of __class__.__name__ in
the is_subset and is_superset methods of the Permissions class.  This
was introduced at the creation of these methods in 21c88cf.
2018-06-21 07:44:00 -04:00
Steve C
0e945915b7 Fixes various documentation errors/inconsistencies
Mostly dealing with permissions, also fixes Raw Events inclusion.
2018-05-18 20:25:54 -04:00
Steve C
5e2d915375 Add pinning to manage_messages doc 2017-08-27 16:08:06 -04:00
Mitchell Ferree
ecdd21212c Disallow setting non-permission attributes 2017-08-08 22:19:59 -04:00
Rapptz
34815a43f4 Permissions.view_audit_logs -> Permissions.view_audit_log 2017-05-28 22:00:43 -04:00
Rapptz
d672f84932 Raise when an invalid permission is passed to PermissionOverwrite. 2017-05-20 15:34:41 -04:00
Rapptz
bd7b2e2d35 Oversight in Permissions still having a table. 2017-05-20 08:47:08 -04:00
Rapptz
c54a6a927d Implement audit logs. 2017-04-30 02:58:27 -04:00