Commit Graph

87 Commits

Author SHA1 Message Date
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
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
851dfc3c75 Fix permissions.py typing 2021-08-23 01:57:58 -04:00
4a6670c062 Add missing typehint for PermissionOverwrite.pair
Technically inferred but better to be explicit
2021-08-22 07:29:30 -04:00
27debe18ca Update Permissions classmethods to include thread/stage/sticker 2021-08-18 00:46:30 -04:00
60d82cf908 implement guild stickers 2021-07-30 21:25:41 -04:00
be5603141e Remove slots from flags
Fix #7159
2021-07-03 10:52:35 -04:00
88620d052a Typehint permissions 2021-07-03 08:30:27 -04:00
5a72391b72 Add thread related permissions 2021-06-08 07:26:22 -04:00
598057ee79 Add Permissions.manage_events 2021-05-05 14:16:39 -04:00
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
1b2688518e Implement StageChannel and related methods 2021-04-03 22:43:41 -04:00
3576e2ee01 Add support for Permissions.request_to_speak 2021-04-01 00:53:07 -04:00
7d345e8e4e remove trailing whitespace 2021-03-13 00:42:25 -05:00
259c3909a8 Fix Permissions.all_channel documentation to link attributes 2021-03-01 08:57:28 -05:00
9c52432274 Update permission class methods to match Discord UI 2021-02-28 23:30:08 -05:00
a8f44174ba Add Permissions.use_slash_commands 2021-02-18 07:28:37 -05:00
69bdc3a184 Change copyright year to present 2021-01-15 05:28:11 -05:00
1c03a4aac9 Evict keys when they're set to None in PermissionOverwrite
Fixes #5929
2020-10-17 01:59:00 -04:00
0ebf5b2fa7 Add support for flag alias 2020-09-24 00:16:37 -04:00
93fa46713a Fix and add documentation 2020-09-23 03:19:35 -04:00
c3bca7ec73 Documentation formatting 2020-06-30 23:32:00 -04:00
b4b953bfc6 Fix various inconsistencies within the documentation (#5067) 2020-06-28 03:45:58 -04:00
215fed831c Mention that you can create Permissions via kwargs now 2020-01-23 00:04:45 -05:00
02397306b2 Drop superfluous zero in version related changes in the documentation 2020-01-21 03:47:56 -05:00
6071607176 Bump copyright year to 2020
Closes #2510
2020-01-19 20:03:00 -05:00
650beee53d Add instance check to PermissionOvewrite.__eq__ 2020-01-19 02:41:50 -05:00
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
46246a2844 Add view_guild_insights permission 2019-11-15 04:23:26 -05:00
3c9bcc2851 Improve documentation 2019-06-07 19:27:46 -04:00
84e86ff666 Add Permissions.stream
Add stream to Permissions classmethods
2019-04-12 20:58:11 -04:00
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
9656a21ebe Bumped copyright years to 2019. 2019-01-28 22:22:50 -05:00
eab0a4f38d Fix typo in Permissions.all_channel 2019-01-28 21:41:56 -05:00
dd884a6afe Update Message.mention_everyone docs to include @here 2018-12-14 19:05:34 -05:00
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
a4d1599ce9 Change docstrings to raw-strings 2018-09-14 22:55:27 -04:00
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
e6f1a7e93a Add Permissions.priority_speaker. 2018-07-31 19:58:45 -07:00
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
0e945915b7 Fixes various documentation errors/inconsistencies
Mostly dealing with permissions, also fixes Raw Events inclusion.
2018-05-18 20:25:54 -04:00
5e2d915375 Add pinning to manage_messages doc 2017-08-27 16:08:06 -04:00
ecdd21212c Disallow setting non-permission attributes 2017-08-08 22:19:59 -04:00
34815a43f4 Permissions.view_audit_logs -> Permissions.view_audit_log 2017-05-28 22:00:43 -04:00
d672f84932 Raise when an invalid permission is passed to PermissionOverwrite. 2017-05-20 15:34:41 -04:00
bd7b2e2d35 Oversight in Permissions still having a table. 2017-05-20 08:47:08 -04:00
c54a6a927d Implement audit logs. 2017-04-30 02:58:27 -04:00
580b4baef9 Fix view_audit_log incorrect pluralisation. 2017-04-08 18:05:46 -04:00
8a34c412ed Add Permissions.view_audit_log 2017-03-21 19:39:06 -04:00
702d596af9 Check that the type in Colour and Permissions are int. 2017-02-21 08:19:32 -05:00