Commit Graph

3124 Commits

Author SHA1 Message Date
7db0008190 Maximize the amount of concurrency while chunking.
In order to reduce our amount of backpressure we need to limit the
amount of concurrent chunk requests we can have so the gateway buffer
has some time to breathe.
2020-09-23 03:21:18 -04:00
6bae52f4bb Check for zombie connections through last received payload
The previous code would check zombie connections depending on whether
HEARTBEAT_ACK was received. Unfortunately when there's exceeding
backpressure the connection can terminate since the HEARTBEAT_ACK is
buffered very far away despite it being there, just not received yet.
2020-09-23 03:21:18 -04:00
0ec72660cf Speed up chunking for guilds with presence intent enabled 2020-09-23 03:21:18 -04:00
92e1816114 Maximize concurrency when chunking on AutoSharded clients 2020-09-23 03:21:17 -04:00
af8fc32329 Use a lock for the gateway rate limiter.
This will allow for higher concurrency in AutoSharded situations where
I can mostly "fire and forget" the chunk requests.
2020-09-23 03:21:17 -04:00
5fe998ac19 Heartbeats bypass the rate limits for gateway 2020-09-23 03:21:17 -04:00
3df269daa3 All guilds require chunking if opting into it 2020-09-23 03:21:17 -04:00
c261f7c4a3 Handle user updates within GUILD_MEMBER_UPDATE 2020-09-23 03:21:16 -04:00
930761e058 Rewrite chunking to work with intents.
This slows down chunking significantly for bots in a large number of
guilds since it goes down from 75 guilds/request to 1 guild/request.
However the logic was rewritten to fire the chunking request
immediately after receiving the GUILD_CREATE rather than waiting for
all the guilds in the ready stream before doing it.
2020-09-23 03:21:16 -04:00
ec7b8edcc2 Add more close codes that can't be handled for reconnecting. 2020-09-23 03:21:16 -04:00
11d8a6fa3c Change unknown cache log warnings from WARNING -> DEBUG 2020-09-23 03:21:15 -04:00
e7db9cfdf7 Handle gateway rate limits by using a rate limiter.
With the new chunking changes this will become necessary and we don't
want to disconnect from having too many outwards requests.
2020-09-23 03:21:15 -04:00
a6381dcf77 Add support for guild intents 2020-09-23 03:21:15 -04:00
9036b9651b Properly handle disconnects in voice when force disconnected 2020-09-23 03:20:35 -04:00
9830e0ed8a Fix issues with VoiceProtocol docstrsings. 2020-09-23 03:20:35 -04:00
e3922e24d9 Correct some protocol errors in v4 of voice gateway 2020-09-23 03:20:35 -04:00
0b93fa3a82 Implement VoiceProtocol lower level hooks.
This allows changing the connect flow and taking control of it without
relying on internal events or tricks.
2020-09-23 03:20:35 -04:00
93fa46713a Fix and add documentation 2020-09-23 03:19:35 -04:00
37c5c583f2 Add support for message_reference on Message object 2020-09-23 02:29:03 -04:00
3cc5e23392 Set maximimum sidebar width 2020-09-23 02:28:17 -04:00
ba7482921b [matrix] Style "View Documentation For" dropdown 2020-09-22 20:29:04 -04:00
ab5e175b25 Use quotes when installing in the README
Other shells have a hard time with square brackets.

Closes #5821
2020-09-21 03:39:19 -04:00
7f17dc79a6 Remove namedtuples to better future guard the library 2020-09-21 03:36:58 -04:00
e7b4bbe2f6 Add bot.listen() suggestion to on_message faq 2020-09-20 00:15:10 -04:00
Xua
6ae615baae Fix allowed_mentions when sending files 2020-09-20 00:14:00 -04:00
cc26499237 Add competing activity type 2020-09-20 00:05:18 -04:00
8f105a441d issue/PR templates: use h2 instead of h3
`h2` is the semantically correct heading here, as `h1` is for 
document titles and `h2` is for the top level headings within
a document. `h3` should be used for subheadings of `h2` headings.
2020-09-18 07:40:27 -04:00
9978288346 Update issue template to redirect to discussions 2020-09-18 04:21:32 -04:00
aa258073dc Add labels to the issue templates 2020-09-17 22:16:20 -04:00
2774cfd3e9 welp, wasnt aware __hex__ got removed in py3 2020-09-18 01:04:04 +00:00
bbaf3375a8 a fix I think? 2020-09-18 00:54:26 +00:00
d28f0ff35b add hex() support to Color 2020-09-18 00:44:40 +00:00
b2540ee312 Lets add some color! 2020-09-18 00:34:29 +00:00
a183c4f752 Completely update member references from message inner members.
Fixes #5819
2020-09-17 02:45:53 -04:00
a67bb723b4 competing type added 2020-09-15 20:34:43 +00:00
5756548a6a Merge branch 'Rapptz-feature/intents' 2020-09-15 00:37:04 +00:00
571ddb5a3e merge conflict fix 2020-09-15 00:36:19 +00:00
6546f63ad7 Add a special exception for required privileged intents 2020-09-14 03:49:21 -04:00
4c56e6da9c Pass default intents if not explicitly given 2020-09-14 03:20:41 -04:00
27b224778b Intern status and overwrite strings 2020-09-14 03:20:41 -04:00
ab049e3eb0 Allow finer grained control over the member cache. 2020-09-14 03:20:36 -04:00
6f22ba8ad0 Raise if member intent is not enabled 2020-09-14 03:20:17 -04:00
f3514a4d53 Don't cache members during guild start up if cache is disabled.
This is mainly a half-implemented commit. There are a few more places
where cache consistency is necessary. In the future there will
probably be a member cache policy enum that will be used and cache
consistency will be tackled in part of that larger refactoring.
2020-09-14 03:20:17 -04:00
141511471e Add Guild.chunk and deprecated Client.request_offline_members 2020-09-14 03:20:16 -04:00
27558ec71a Fix Client.request_offline_members no longer working 2020-09-14 03:20:16 -04:00
a6edb66742 Add versionadded for intents enum 2020-09-14 03:20:16 -04:00
b1de57f299 Explicitly disable the members presence by default 2020-09-14 03:20:16 -04:00
0fc8ac6f80 Fix timeouts due to hitting the gateway rate limit 2020-09-14 03:20:16 -04:00
18141c0cf9 Maximize the amount of concurrency while chunking.
In order to reduce our amount of backpressure we need to limit the
amount of concurrent chunk requests we can have so the gateway buffer
has some time to breathe.
2020-09-14 03:20:16 -04:00
022ec9af1d Check for zombie connections through last received payload
The previous code would check zombie connections depending on whether
HEARTBEAT_ACK was received. Unfortunately when there's exceeding
backpressure the connection can terminate since the HEARTBEAT_ACK is
buffered very far away despite it being there, just not received yet.
2020-09-14 03:20:16 -04:00