2495 Commits

Author SHA1 Message Date
Kreusada
af5964358d
[commands] Strip text to remove spaces before ellipsis 2021-04-11 15:19:45 -04:00
Nadir Chowdhury
7cbe942a64
Use v8 overwrite type when creating a channel 2021-04-11 15:16:52 -04:00
Nadir Chowdhury
f1fac96e33
Remove private_channel_(delete/create) events 2021-04-11 15:13:23 -04:00
Rapptz
74d8ad2013 [commands] Add support for Python 3.10 Union typing 2021-04-11 02:11:24 -04:00
Rapptz
1ecadf057e [commands] Fix errors with cooldown mappings 2021-04-11 01:00:04 -04:00
Rapptz
7d79b4ba55 Remove Member related handling in PRESENCE_UPDATE 2021-04-11 00:57:59 -04:00
Rapptz
217c2a1cc5 Fix stray AttributeError in Guild._from_data with member cache 2021-04-11 00:44:27 -04:00
Rapptz
40cf397ce6 Permission related fixes for v8 2021-04-11 00:39:13 -04:00
NCPlayz
4c565e5299 add reply and application_command types 2021-04-11 00:39:13 -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
Rapptz
d85805ab6d First pass at supporting v8 API 2021-04-11 00:39:13 -04:00
Josh
7f91ae8b67
[commands] use __args__ and __origin__ where applicable 2021-04-11 00:38:17 -04:00
Josh
c54c4cb215
[commands] Fix repr for Greedy 2021-04-10 22:34:24 -04:00
Rapptz
3151672cfe [commands] Refactor typing evaluation to not use get_type_hints
get_type_hints had a few issues:

1. It would convert = None default parameters to Optional
2. It would not allow values as type annotations
3. It would not implicitly convert some string literals as ForwardRef

In Python 3.9 `list['Foo']` does not convert into
`list[ForwardRef('Foo')]` even though `typing.List` does this
behaviour. In order to streamline it, evaluation had to be rewritten
manually to support our usecases.

This patch also flattens nested typing.Literal which was not done
until Python 3.9.2.
2021-04-10 20:56:08 -04:00
Rapptz
27886e5aa4 [commands] Remove legacy ExtensionNotFound.original attribute 2021-04-10 15:52:53 -04:00
Rapptz
d5ad269b35 Fix Intents resolution in the docs 2021-04-10 15:50:46 -04:00
Nadir Chowdhury
353737239a
[commands] Minimise code duplication in channel converters 2021-04-10 14:01:26 -04:00
TheOneMusic
ec71eb2fcb
Added discord.StageChannel in documentation 2021-04-10 13:49:46 -04:00
James
bcd3a00eaf
[commands] Make commands.Greedy a typing.Generic 2021-04-10 07:27:32 -04:00
Dan Hess
f2d5ab6f80
[commands] Provide a dynamic cooldown system 2021-04-10 03:30:01 -04:00
Rapptz
d58edd10a7 Add missing future annotations import 2021-04-10 03:23:47 -04:00
Nadir Chowdhury
1efdef3ac3
Add typings for invites, templates, and bans 2021-04-10 02:55:10 -04:00
Nadir Chowdhury
3e92196a2b
Add typings for audit logs, integrations, and webhooks 2021-04-10 02:53:24 -04:00
Sigmath Bits
68aef92b37
[commands]Add typing.Literal converter 2021-04-10 02:50:59 -04:00
Cryptex
eb5356cc47
Remove user token warning in login 2021-04-08 23:49:40 -04:00
Rapptz
ca84d4e2b6 [types] Snowflake can be either str or int. 2021-04-08 22:17:26 -04:00
Sebastian Law
4134a17a29
[commands] Raise error when a cog name is already registered 2021-04-08 22:04:10 -04:00
Rapptz
9da2f349e7 Use Any instead of str for Embed typings for accuracy 2021-04-08 20:12:08 -04:00
Nadir Chowdhury
d4df44375b
Add typings for models for guilds, activities, and voice 2021-04-08 09:32:26 -04:00
Rapptz
99fc950510 Use f-strings in more places that were missed. 2021-04-08 06:02:47 -04:00
Rapptz
e405bd5f1f Add discord.types.Message.interaction attribute 2021-04-08 02:29:14 -04:00
Rapptz
a31c19563f Add interaction related typings 2021-04-08 02:12:55 -04:00
Rapptz
249d94a011 Add AllowedMentions typings 2021-04-08 02:06:19 -04:00
Rapptz
d299bfef26 Fix up typings for attachment and message 2021-04-08 01:56:23 -04:00
Nadir Chowdhury
0903ea949f
Add typings for Message, Emoji, and Member 2021-04-08 01:51:42 -04:00
pikaninja
1c553f51fb
[commands] Use has_error_handler instead in command_error 2021-04-07 23:42:52 -04:00
Kallum
cc6edccc0c
Make the bot template use f-strings over str.format 2021-04-07 21:38:01 -04:00
Nadir Chowdhury
f8bea3bb05
Fix inaccuracies with AsyncIterator typings 2021-04-07 20:28:12 -04:00
Nadir Chowdhury
87e64dff06
Add typings for channels and PartialUser 2021-04-07 07:56:56 -04:00
Nadir Chowdhury
83fe98c20d
Add typing for flags 2021-04-07 07:55:55 -04:00
Sebastian Law
4c72137e43
[docs] add note for possible Embed.type strings 2021-04-07 07:17:57 -04:00
Nadir Chowdhury
a43ea5c550
Fix regression in Activity relying on try_enum 2021-04-07 07:17:04 -04:00
Rapptz
f49d565d51 Rename discord.types file based on relevant core module file 2021-04-07 05:50:54 -04:00
Rapptz
23fe6b46dd Typehint discord.Embed and introduce discord.types subpackage
The discord.types subpackage is currently only used to do type hinting
of API payloads, it's very much incomplete right now and it'll be a
rather long process.

discord.Embed was typehinted and formatted using black.
2021-04-07 05:39:58 -04:00
Rapptz
f80b8d3f5d [commands] Only replace annotation if one was given 2021-04-07 03:17:36 -04:00
Nadir Chowdhury
89456022cf
Add __all__ to remaining modules 2021-04-07 02:30:32 -04:00
Rapptz
ed1341012b Add Embed.__bool__
Fixes #6661
2021-04-07 00:01:57 -04:00
Rapptz
1d5805ebcb Revert "Remove unused group functionality"
This reverts commit d69b2f0af563993bdae425f4bb92fb555a238933.
2021-04-07 00:01:57 -04:00
Steve C
3c9aed9102
Fix AttributeError on HTTPClient.send_file to be send_files 2021-04-07 00:01:48 -04:00
Nadir Chowdhury
7f0a398c1e
Use format_map instead of format for Route.url 2021-04-06 23:44:44 -04:00