286 Commits

Author SHA1 Message Date
Josh
6af6f82411
Fix audit log pagination logic 2023-02-27 06:15:28 -05:00
Rapptz
cbc46e0973 Add support for ForumChannel.default_layout 2023-01-10 16:43:18 -05:00
Rapptz
a098867a4d Fix certain parameters not being respected in Guild.create_forum 2022-11-27 23:51:52 -05:00
Ionite
6981eb69c4
Normalize type formatting in TypeError
Normalize most mixed usages of `__class__`, `__class__!r`, 
`__class__.__name__!r` to the standard form of 
`__class__.__name__`
2022-09-12 15:25:55 -04:00
Rapptz
ab265dcb7c Add support for newest ForumChannel changes
This adds the following:

- Forum tag support
- Default reaction support
- Default slowmode for newly created threads
2022-08-31 11:09:56 -04:00
Josh
e57617e157
Add support for delete_message_seconds ban argument 2022-08-28 02:06:57 -04:00
Rapptz
8dd186cf1e Fix cache eviction for ratelimit objects 2022-08-17 08:39:39 -04:00
Rapptz
f1ec0919f6 Remove stack info from ratelimit logs 2022-08-10 22:55:27 -04:00
Rapptz
87c9c95bb8 Use persistent dictionary for ratelimit information
This should prevent ratelimit information from being cleared too early.
In order to prevent the dictionary from growing to large expired keys
are deleted once they've been deleted.

At present I'm unsure if this change would cause too much CPU pressure.
2022-08-05 23:19:16 -04:00
Rapptz
a01dad283f Add extraneous debug logging to sub ratelimits being detected 2022-07-19 01:36:18 -04:00
Rapptz
76402b00f9 Allow configuring the maximum ratelimit timeout before erroring
This is useful for cases where a rate limit is known to be
extraordinarily high, but you still want to handle the error.
This is common with routes such as emoji creation.
2022-07-19 01:36:18 -04:00
Rapptz
85ea418776 Special case message deletion sub rate limits 2022-07-19 00:07:28 -04:00
Rapptz
c17eb31328 Rewrite rate limit handling to use X-Ratelimit-Bucket and a semaphore
This should increase throughput of the number of requests that can be
made at once, while simultaneously following the new standard practice
of using the rate limit bucket header.

This is an accumulation of a lot of months of work between a few people
and it has been tested extensively. From the testing it seems to work
fine, but I'm not sure if it's the best way to do it.

This changeset does not currently take into consideration sub
rate limits yet, but the foundation is there via Route.metadata. In the
future, this metadata will be filled in with the known sub rate limit
implementation to allow them to have separate keys in the rate limit
mapping.

Co-authored-by: Josh <josh.ja.butt@gmail.com>
2022-07-19 00:07:28 -04:00
Rapptz
2067819b75 Fix some minor typing errors 2022-07-17 21:40:05 -04:00
Alex Nørgaard
5426d19dc7
Implement AutoMod 2022-06-27 00:47:52 -04:00
Nadir Chowdhury
85495a910c
Add extra details to rate limit logs
- Include the rate limit bucket for webhooks
- Enable `stack_info` for the 429 warning.
2022-06-16 18:52:37 -04:00
Soheab
3aa55ba1ed
Implement Application Command Permissions models 2022-06-07 01:35:33 -04:00
Rapptz
e543abd950 Add support for new thread_name parameter in Webhook.send 2022-05-31 18:25:26 -04:00
Sebastian Law
f24f34e3f1
Remove unused internal bot_token attribute 2022-05-28 23:48:02 -04:00
Nadir Chowdhury
e2d0193531
Implement WelcomeScreen 2022-05-21 21:26:06 -04:00
Nanashi
2bb7ed2092
Retry on 524 status code 2022-05-21 21:22:20 -04:00
Rapptz
93e1ff5f07 Change aiohttp object construction to no longer take loop objects 2022-05-20 15:08:38 -04:00
Rapptz
1df3ed861c Fix broken HTTPClient.recreate code to actually clear session 2022-05-05 11:42:50 -04:00
Rapptz
7f210c90f4 Return a named tuple with message from ForumChannel.create_thread 2022-05-01 19:32:11 -04:00
Rapptz
06df0d7931 Address latest breaking change in creating forum posts 2022-04-29 12:39:12 -04:00
I. Ahmad
6265723a35
Add support for archive duration in Guild.create_text_channel 2022-04-11 17:21:08 -04:00
Rapptz
a8b26b9257 Allow pinning a thread using Thread.edit 2022-04-06 23:21:17 -04:00
Rapptz
23f6876492 Add initial support for forum channels
Closes #7652
2022-04-06 23:02:58 -04:00
Josh
d600436378
[types] Use PEP-655 style Required/NotRequired types 2022-04-02 01:46:10 -04:00
Rapptz
9acf1db076 Support ban endpoint pagination 2022-04-01 00:09:02 -04:00
Kellen
4fd2d5fdfd
Remove redundant imports and variables 2022-03-29 02:50:34 -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
z03h
8d86ee3fe3
Fix mention_author suppressing all mentions 2022-03-18 01:52:11 -04:00
Josh
e01d4a31eb
Replace invariant container types with wider types where applicable 2022-03-17 07:26:01 -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
Han Seung Min - 한승민
93af158b0c
Refactor loop code to allow usage of asyncio.run 2022-03-13 04:54:14 -04:00
Rapptz
ba2763a4a1 Add private hook for changing the API version
This is mainly a temporary, undocumented, stop gap for bots that are
screwed over from waiting for Discord to grant them the message content
intent.
2022-03-07 18:23:12 -05:00
Rapptz
0330282c5f Create a default TCPConnector with no limit
The default implementation only allows for 100 concurrent connections
and during heavy sharding (>=100 shards) this can end up freezing
shards.
2022-03-07 01:19:37 -05:00
Stocker
e15415413b
Add missing parameters to certain methods
- slowmode_delay and reason in Message.create_thread
- slowmode_delay in TextChannel.create_thread
- reason in Guild.edit_widget
2022-03-06 23:00:50 -05:00
I. Ahmad
8360e4af8d
Add premium_progress_bar_enabled attribute on Guild 2022-03-06 03:17:28 -05:00
Rapptz
fa901afa3a Add replied_user key when no allowed_mentions is passed in 2022-03-05 23:39:06 -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
Josh
147948af9b
Use typing.Self throughout library 2022-03-01 07:53:24 -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
e13997f35e Remove region parameters from HTTPClient 2022-02-25 10:44:37 -05:00
Josh
285069de08 Fix types in guild.py 2022-02-22 04:00:46 -05:00
Josh
c8064ba6f2 Type-hint gateway 2022-02-22 03:59:58 -05:00