51 Commits

Author SHA1 Message Date
Rapptz
88b520b5ab Reformat code using black
Segments where readability was hampered were fixed by appropriate
format skipping directives. New code should hopefully be black
compatible. The moment they remove the -S option is probably the moment
I stop using black though.
2022-02-20 08:04:58 -05:00
Vaskel
19b10eecfe
Add message content to the Intents.default docstring 2022-02-19 00:15:23 -05:00
jack1142
de78a1071f
Add message content intent application flags 2022-02-18 21:20:00 -05:00
Josh
37f96e3473
Add message_content intent and move to api v10 2022-02-18 08:44:46 -05:00
Kowlin
bae0cdf2a7
Add SPAMMER user flag 2022-02-17 22:14:21 -05:00
jack1142
820bde99e1
Add BOT_HTTP_INTERACTIONS user flag
Adds UserFlags.bot_http_interactions and PublicUserFlags.bot_http_interactions
See: discord/discord-api-docs#3903
2022-02-17 11:26:09 -05:00
jack1142
423fd1bc26
Add SystemChannelFlags.join_notification_replies
Add SUPPRESS_JOIN_NOTIFICATION_REPLIES system channel flag
See: discord/discord-api-docs#3977
2022-02-17 11:19:32 -05:00
Imayhaveborkedit
f586f4dfbd
Clarify connect() requires Intents.voice_states 2021-08-24 00:02:21 -04:00
Bryan Forbes
79bae47992
flag_value should not be a generic class
Since there is no generic information in `flag_value.__init__()`, 
`flag_value` descriptors get stored as `flag_value[<nothing>]` in mypy
strict mode and then the `__get__` overloads never match. This leads to
errors when using things like `permissions_instance.embed_links` since
`<nothing>` never matches `Permissions`. 

The generic inheritance isn't needed at all since the type information
we care about comes from the call site of `__get__` and not the 
instantiation of the descriptor.
2021-08-18 01:05:08 -04:00
Rapptz
6beef898c6 Rename instances of nitro to premium 2021-07-30 23:10:36 -04:00
Nadir Chowdhury
60d82cf908
implement guild stickers 2021-07-30 21:25:41 -04:00
Nadir Chowdhury
262a50196d
fix typo in ephemeral function definition 2021-07-21 02:46:39 -04:00
apple502j
717e723a36
Update intents docs to reflect presence update changes 2021-07-07 20:16:17 -04:00
Rapptz
17268c3368 Add MessageFlags.ephemeral 2021-07-03 21:29:28 -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
68c7c538f5 First pass at preliminary thread support
This is missing a lot of functionality right now, such as two gateway
events and all the HTTP CRUD endpoints.
2021-06-08 07:23:40 -04:00
Nadir Chowdhury
ab6d592f8c
Add support for integration create/update/delete events 2021-06-07 03:28:26 -04:00
Stanisław Jelnicki
65439732b3
Add Discord Certified Moderator user flag 2021-05-23 05:07:33 -04:00
pikaninja
1d4e339141
Add get_user to the things intents.members affects 2021-05-03 22:15:28 -04:00
Nadir Chowdhury
631a0b1e13
Add support for ApplicationFlags 2021-04-18 20:32:52 -04:00
Rapptz
9eaf1e85e4 Rewrite Asset design
This is a breaking change.

This does the following transformations, assuming `asset` represents
an asset type.

Object.is_asset_animated() => Object.asset.is_animated()
Object.asset => Object.asset.key
Object.asset_url => Object.asset_url
Object.asset_url_as => Object.asset.replace(...)

Since the asset type now requires a key (or hash, if you will),
Emoji had to be flattened similar to how Attachment was done since
these assets are keyed solely ID.

Emoji.url (Asset) => Emoji.url (str)
Emoji.url_as => removed
Emoji.url.read => Emoji.read
Emoji.url.save => Emoji.save

This transformation was also done to PartialEmoji.
2021-04-16 11:27:23 -04:00
TheOneMusic
d21e65ce47
Add SystemChannelFlags.guild_reminder_notifications 2021-04-15 08:03:56 -04:00
Nadir Chowdhury
f1fac96e33
Remove private_channel_(delete/create) events 2021-04-11 15:13:23 -04:00
Rapptz
7afcacc9a1 Remove MemberCacheFlags.online
v8 no longer gives enough data for this to be possible
2021-04-11 00:39:13 -04:00
Nadir Chowdhury
83fe98c20d
Add typing for flags 2021-04-07 07:55:55 -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
Steve C
7836046621
Mark User.avatar_url as attribute in Intents.members docstring
The line currently comes out to 
`User.avatar (User.avatar_url() and User.avatar_url_as())` 
but `User.avatar_url` is not callable.
2021-03-13 01:47:06 -05:00
Nihaal Sangha
69bdc3a184
Change copyright year to present 2021-01-15 05:28:11 -05:00
Rapptz
7a3a571e0a Don't store a user cache if there's no member intent or cache is off
Without a cache or member intent the user cache can get out of date
with no events to update the underlying user in the member object.

Ref: #6034
2020-11-23 05:24:13 -05:00
Rapptz
b91ddc6f4e Mark intent alias flags as actual aliases to skip them in __iter__
Fix #5945
2020-10-17 18:50:56 -04:00
Rapptz
e4d7f44aa5 Make Intent class creation more intuitive 2020-09-24 09:00:54 -04:00
Rapptz
59d514fcdf More intent related documentation 2020-09-24 01:39:45 -04:00
Sebastian Law
2974663367
Fix typos in Intents documentation 2020-09-24 00:17:37 -04:00
apple502j
0ebf5b2fa7
Add support for flag alias 2020-09-24 00:16:37 -04:00
Rapptz
2e06239d3c Add documentation for gateway intents 2020-09-23 03:21:22 -04:00
Muhammad Hamza
11aaa03ec2 Fix presence intent docstring 2020-09-23 03:21:21 -04:00
Rapptz
213f55ffc7 Disable voice cache in weird intent configurations. 2020-09-23 03:21:21 -04:00
Rapptz
e644a5a060 Fix up wording in MemberCacheFlags exception 2020-09-23 03:21:21 -04:00
Rapptz
8d5c05ed20 Default MemberCacheFlags based on intents 2020-09-23 03:21:21 -04:00
Rapptz
23ae084b8c Allow finer grained control over the member cache. 2020-09-23 03:21:20 -04:00
Rapptz
e10942a9ee Add versionadded for intents enum 2020-09-23 03:21:19 -04:00
Rapptz
bec34c1110 Explicitly disable the members presence by default 2020-09-23 03:21:18 -04:00
Rapptz
a6381dcf77 Add support for guild intents 2020-09-23 03:21:15 -04:00
JohnyTheCarrot
ab5f995d78 Add support for public user flags 2020-05-29 22:40:14 -04:00
Io Mintz
a8baf0c9f0
flags: support accessing flag value instances on the class
Fixes #4023
2020-04-20 14:59:58 -05:00
Harmon
6f9793fe5e Fixes and improvements for v1.3 documentation
* Add missing versionadded strings for v1.3
* Add missing versionchanged string for Message.edit
* Consistently use versionadded for attributes
* Consistently use versionchanged for parameters
* Use versionchanged for Bot.is_owner
* Fix references in v1.3 changelog
* Improve grammar in v1.3 changelog
2020-01-22 23:55:05 -05:00
Rapptz
6071607176 Bump copyright year to 2020
Closes #2510
2020-01-19 20:03:00 -05:00
Rapptz
2de90fbecf Add User.system and MessageFlags.urgent 2019-12-21 07:39:33 -05:00
Rapptz
f7687e0a68 Clean up flag code significantly.
This also fixes the False setting bug.
2019-12-20 21:18:31 -05:00