2523 Commits

Author SHA1 Message Date
iDutchy
d28f0ff35b add hex() support to Color 2020-09-18 00:44:40 +00:00
iDutchy
b2540ee312 Lets add some color! 2020-09-18 00:34:29 +00:00
iDutchy
a67bb723b4 competing type added 2020-09-15 20:34:43 +00:00
iDutchy
5756548a6a Merge branch 'Rapptz-feature/intents' 2020-09-15 00:37:04 +00:00
iDutchy
571ddb5a3e merge conflict fix 2020-09-15 00:36:19 +00:00
Rapptz
6546f63ad7 Add a special exception for required privileged intents 2020-09-14 03:49:21 -04:00
Rapptz
4c56e6da9c Pass default intents if not explicitly given 2020-09-14 03:20:41 -04:00
Rapptz
27b224778b Intern status and overwrite strings 2020-09-14 03:20:41 -04:00
Rapptz
ab049e3eb0 Allow finer grained control over the member cache. 2020-09-14 03:20:36 -04:00
Rapptz
6f22ba8ad0 Raise if member intent is not enabled 2020-09-14 03:20:17 -04:00
Rapptz
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
Rapptz
141511471e Add Guild.chunk and deprecated Client.request_offline_members 2020-09-14 03:20:16 -04:00
Rapptz
27558ec71a Fix Client.request_offline_members no longer working 2020-09-14 03:20:16 -04:00
Rapptz
a6edb66742 Add versionadded for intents enum 2020-09-14 03:20:16 -04:00
Rapptz
b1de57f299 Explicitly disable the members presence by default 2020-09-14 03:20:16 -04:00
Rapptz
0fc8ac6f80 Fix timeouts due to hitting the gateway rate limit 2020-09-14 03:20:16 -04:00
Rapptz
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
Rapptz
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
Rapptz
9492cb1242 Speed up chunking for guilds with presence intent enabled 2020-09-14 03:20:16 -04:00
Rapptz
a76f9ce8ef Maximize concurrency when chunking on AutoSharded clients 2020-09-14 03:20:16 -04:00
Rapptz
faf1db1583 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-14 03:20:15 -04:00
Rapptz
d6defbc6b2 Heartbeats bypass the rate limits for gateway 2020-09-14 03:20:15 -04:00
Rapptz
5db9a3551f All guilds require chunking if opting into it 2020-09-14 03:20:15 -04:00
Rapptz
e8e4886fd8 Handle user updates within GUILD_MEMBER_UPDATE 2020-09-14 03:20:15 -04:00
Rapptz
95bec0dcee 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-14 03:20:15 -04:00
Rapptz
f46257faa6 Add more close codes that can't be handled for reconnecting. 2020-09-14 03:20:15 -04:00
Rapptz
c0a3aaa98c Change unknown cache log warnings from WARNING -> DEBUG 2020-09-14 03:20:15 -04:00
Rapptz
75c24bde16 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-14 03:20:15 -04:00
Rapptz
a9cb851a3c Add support for guild intents 2020-09-14 03:20:15 -04:00
Rapptz
986adae108 Revert "Add fetch_message_fast using history endpoint"
This reverts commit a309088ae4be7c2e837e5d180822c0f9060fe86d.

A rate limited was added to this method after 5 years defeating the
purpose of it.
2020-09-14 01:18:09 -04:00
iDutchy
43c4d33a4a avatar urls in stead of assets 2020-09-13 23:57:18 +00:00
iDutchy
4b612aeece
Merge pull request #1 from Rapptz/feature/intents
Feature/intents
2020-09-13 05:44:24 +02:00
iDutchy
1791b72f45 Add support for Guild.bots and Guild.humans 2020-09-13 01:17:35 +00:00
Duck
ddc4ad24f4
Add missing permission in clone documentation 2020-09-11 04:55:26 -04:00
Rapptz
77b0ddca7c Raise if member intent is not enabled 2020-09-10 06:46:16 -04:00
Rapptz
61ec62da11 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-10 05:58:24 -04:00
Rapptz
009a961006 Add Guild.chunk and deprecated Client.request_offline_members 2020-09-10 05:56:48 -04:00
Rapptz
cb211c36bd Fix Client.request_offline_members no longer working 2020-09-10 05:26:35 -04:00
Rapptz
a293d87c77 Add versionadded for intents enum 2020-09-10 05:17:52 -04:00
Rapptz
41fd2740cb Explicitly disable the members presence by default 2020-09-10 05:17:52 -04:00
Rapptz
65f591705d Fix timeouts due to hitting the gateway rate limit 2020-09-10 05:17:52 -04:00
Rapptz
81bfdea9df 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-10 05:17:52 -04:00
Rapptz
2129ae29be 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-10 05:17:52 -04:00
Rapptz
82fa967f3c Speed up chunking for guilds with presence intent enabled 2020-09-10 05:17:51 -04:00
Rapptz
fdbe0c4f57 Maximize concurrency when chunking on AutoSharded clients 2020-09-10 05:17:51 -04:00
Rapptz
5837ad0804 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-10 05:17:51 -04:00
Rapptz
e6fddbdbe7 Heartbeats bypass the rate limits for gateway 2020-09-10 05:17:51 -04:00
Rapptz
37760e16dd All guilds require chunking if opting into it 2020-09-10 05:17:51 -04:00
Rapptz
fd5faac42b Handle user updates within GUILD_MEMBER_UPDATE 2020-09-10 05:17:50 -04:00
Rapptz
eb641569f7 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-10 05:17:50 -04:00