651 Commits

Author SHA1 Message Date
Lilly Rose Berner
2dbf14bb72
Separately delay ready event for each shard 2022-04-25 02:01:46 -04:00
Lilly Rose Berner
08844985cc
Fix Client.fetch_guilds not working correctly, increase default limit 2022-04-22 22:31:33 -04:00
Rapptz
987235d564 Only call async setup if the loop sentinel hasn't been changed 2022-04-19 04:27:52 -04:00
Rapptz
76cc2c2272 Require passing intents to Client and its subclasses 2022-04-05 22:32:14 -04:00
Puncher
18050aecd7
Fix broken code blocks in docstrings 2022-04-02 17:57:33 -04:00
jack1142
5ffa3e85de
Update comments after # type: ignore to be compatible with PEP 484 2022-03-27 22:26:34 -04:00
Bryan Forbes
062f4d6f87
Change some methods to use positional-only marker
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-03-22 18:52:25 -04:00
will
13d19dc5ce
Fix typo in http_trace parameter documentation 2022-03-18 10:49:24 -04:00
Rapptz
77ec49782a Add http_trace option in Client to trace the library's HTTP requests 2022-03-18 08:02:53 -04:00
Rapptz
f5341a1cfa Document cases where setup_hook can deadlock rather than raising 2022-03-17 09:56:25 -04:00
apple502j
3e77a7b29e
Forbid wait_until_ready inside setup_hook 2022-03-17 07:25:10 -04:00
Rapptz
c77bbc4dcf Move with_counts parameter documentation where it belongs 2022-03-16 07:43:31 -04:00
Rapptz
7c0a9e901d Fully initialise asyncio state in __aenter__ 2022-03-16 05:51:25 -04:00
Rapptz
575eacb1bf Change loop sentinel error to not use a tuple
This was an unintentional error
2022-03-16 05:50:28 -04:00
Rapptz
2bf612cd67 Fix Client.close erroring if done before proper async initialisation 2022-03-15 06:51:19 -04:00
Rapptz
9b77331603 Change loop sentinel to provide a more descriptive error message
This way people don't think it's a bug. I imagine some people won't
read it, but at least when you point it out they might get it.
2022-03-14 05:52:35 -04:00
Stocker
5aa696ccfa
Fix typing issues and improve typing completeness across the library
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
Co-authored-by: Josh <josh.ja.butt@gmail.com>
2022-03-13 23:52:10 -04:00
Rapptz
9c61e10a55 Move all async object creation to a proper initialisation point
This should make it so no object is created with another loop
2022-03-13 08:33:25 -04:00
Rapptz
8d4f08a5e7 Fix AutoShardedClient to work with the new asyncio loop machinery
Fix #7675
2022-03-13 08:05:44 -04:00
Rapptz
c02a3c0bb2 Add asynchronous context manager support for Client 2022-03-13 05:04:55 -04:00
Han Seung Min - 한승민
93af158b0c
Refactor loop code to allow usage of asyncio.run 2022-03-13 04:54:14 -04:00
Gnome!
68b7ee6b99
Add Client.setup_hook 2022-03-12 09:39:43 -05:00
chromacoat dreamkey
095aaa9ad1
Change wording of InvalidArgument removal in docs 2022-03-11 23:25:43 -05:00
Sebastian Law
483ffeacd4
Inject state into PartialEmoji in Activity 2022-03-10 20:56:20 -05:00
daima3629
0ea6fdac5a
Fix typo in Client.get_stage_instance 2022-03-10 18:53:20 -05:00
James Hilton-Balfe
8072e294a8
Fix type-o in the docstring for Client.fetch_guild 2022-03-06 18:36:19 -05:00
JDJG Inc. Official
e69428a841
Add with_counts support for Client.fetch_guild
Co-authored-by: Stocker <44980366+StockerMC@users.noreply.github.com>
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-03-05 22:09:19 -05:00
Rapptz
f7315573aa Remove generic from Interaction and ConnectionState
This results in poor ergonomics due to the lack of default generics
for the common case. For most users this ends up in a degraded
experience since the type will resolve to Unknown rather than at the
very least a Client.
2022-03-05 05:03:23 -05:00
Rapptz
f435d160dd Add Interaction.client property 2022-03-01 08:11:22 -05:00
Rapptz
d44328d3ea Remove region from Guild.__slots__
This also fixes up some docstrings
2022-03-01 05:54:26 -05:00
Nadir Chowdhury
3c6279b947
Implement Guild Scheduled Events 2022-03-01 01:00:04 -05:00
Josh
2b69b5d545
Remove discord.InvalidArgument
This uses TypeError and ValueError instead.
2022-02-26 01:44:49 -05:00
Rapptz
0eb2f32399 Remove VoiceRegion enum and Guild.region attribute
This has been marked deprecated by Discord and it was more or less
usually out of date due to the pace they added them anyway.
2022-02-23 10:03:13 -05:00
Josh
39c5a4fdc3
Fix type-errors in commands extension 2022-02-23 08:04:49 -05:00
Rapptz
51b79411e3 Fix and document type ignores in client 2022-02-21 22:52:24 -05:00
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
Josh
4dbe1af32f
Update sphinx and fix documentation issues 2022-02-19 22:35:32 -05:00
Kaylynn Morgan
588cda0996
Refactor AsyncIter to use 3.6+ asynchronous generators 2022-02-19 21:58:13 -05:00
jack1142
dc19c6c7d5
Add positional-only arguments in more places 2022-02-19 20:28:01 -05:00
Abhinav Singh
f485f1b612
Fix a typo in docstrings of Client class 2021-08-27 16:01:44 -04:00
Chrovo
932efa1edc
Change a few parameters to be positional only
This makes parameters positional only in the methods 
fetch_sticker, fetch_webhook, fetch_channel, fetch_user, fetch_widget, 
fetch_stage_instance, fetch_guild, get_sticker, and get_channel.
2021-08-26 20:47:24 -04:00
pyxiis
2f2c39ed22
Add Client.status attribute 2021-08-26 15:50:21 -04:00
MrKomodoDragon
5ef37923de
Make getters in Client positional only 2021-08-23 05:28:52 -04:00
Josh
9727b56503
Fix references in docs 2021-08-22 05:50:28 -04:00
Rapptz
ea2d972666 Make global log variable in modules private 2021-08-22 02:33:51 -04:00
Stocker
f4d5fcc8f9
Add Thread to the return type of Client.get_channel
Also explains some type ignores.
2021-08-19 20:18:27 -04:00
AkshuAgarwal
6b6bcb92e6
Fix missing or broken versionadded in docstrings
This also documents BadFlagArgument.flag
2021-08-18 00:45:02 -04:00
Rapptz
08a4db3961 Revert "Refactor Client.run to use asyncio.run"
This reverts commit 6e6c8a7b2810747222a938c7fe3e466c2994b23f.
2021-08-11 02:16:22 -04:00
Rapptz
6e6c8a7b28 Refactor Client.run to use asyncio.run
This also adds asynchronous context manager support to allow for
idiomatic asyncio usage for the lower-level counterpart. At first
I wanted to remove Client.run but I figured that a lot of beginners
would have been confused or not enjoyed the verbosity of the newer
approach of using async-with.
2021-08-10 23:00:24 -04:00
Rapptz
1279510194 Add support for PartialMessageable instances
This allows library users to send messages to channels without fetching
it first.
2021-08-10 09:24:49 -04:00