244 Commits

Author SHA1 Message Date
iDutchy
571ddb5a3e merge conflict fix 2020-09-15 00:36:19 +00:00
Rapptz
4c56e6da9c Pass default intents if not explicitly given 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
141511471e Add Guild.chunk and deprecated Client.request_offline_members 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
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
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
c0a3aaa98c Change unknown cache log warnings from WARNING -> DEBUG 2020-09-14 03:20:15 -04:00
Rapptz
a9cb851a3c Add support for guild intents 2020-09-14 03:20:15 -04:00
Rapptz
009a961006 Add Guild.chunk and deprecated Client.request_offline_members 2020-09-10 05:56:48 -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
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
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
Rapptz
50a951e3ec Change unknown cache log warnings from WARNING -> DEBUG 2020-09-10 05:17:50 -04:00
Rapptz
f588834b0c Add support for guild intents 2020-09-10 05:17:50 -04:00
Rapptz
ec3c3eb4c6 Update message references in AutoShardedConnectionState
Fixes #5133
2020-07-25 09:59:40 -04:00
Rapptz
d37b91dfc6 Add guild_ready_timeout to control the timeout of GUILD_CREATE stream
This also fixes a timing issue where READY would take far too long to
load for big bot authors.

Closes #4112
2020-07-25 09:59:40 -04:00
Rapptz
8070d39a23 Add shard related connection and resume events.
These include:
* on_shard_resumed
* on_shard_connect
* on_shard_disconnect
2020-07-25 09:59:39 -04:00
Rapptz
394b514cc9 Add before_identify_hook to have finer control over IDENTIFY syncing 2020-07-25 09:59:39 -04:00
Rapptz
09ecb16680 Rewrite of AutoShardedClient to prevent overlapping identify
This is experimental and I'm unsure if it actually works
2020-07-25 09:59:37 -04:00
Anurag
421d8bf8ca
Fix TypeError on missing shard_id kwarg 2020-06-07 03:41:21 -04:00
Tarek
a972c95f12 Add user_ids fields for query_members 2020-05-29 23:24:07 -04:00
apple502j
cb43e19bea Fix TypeError in chunker 2020-05-23 21:56:27 -04:00
iomintz
755ab28311
state: use bytes.hex() instead of binascii.hexlify().decode() 2020-05-10 20:07:22 -05:00
Rapptz
13a3f760e6 Fix timeout issues with fetching members via query_members
This uses the nonce field to properly disambiguate queries. There's
also some redesigning going on behind the scenes and minor clean-up.
Originally I planned on working on this more to account for the more
widespread chunking changes planned for gateway v7 but I realized that
this would indiscriminately slow down everyone else who isn't planning
on working with intents for now.

I will work on the larger chunking changes in the future, should time
allow for it.
2020-05-10 19:35:45 -04:00
Rapptz
0d5e6e213c Decrement Guild.member_count even if member is not cached
Fix #4021
2020-04-19 18:22:41 -04:00
apple502j
14f80fce45 Fix PartialEmoji.url.read for reactions 2020-04-18 19:34:41 +09:00
Rapptz
8874aa3dd2 Move log levels around to make INFO a little less noisy 2020-04-06 05:22:57 -04:00
NCPlayz
c8f32f3151 animated key is never given to reaction_remove(_emoji) 2020-04-06 04:58:27 -04:00
Rapptz
d853a57e86 Rename allowed mention parameters to allowed_mentions 2020-04-04 13:22:51 -04:00
Rapptz
041785937e Add support for configuring allowed mentions per message or bot wide. 2020-04-04 07:40:51 -04:00
Rapptz
5c7df3d943 Bump waiting time of GUILD_CREATE stream by number of shards waited.
2 seconds might be too short and cause it to finish waiting while other
shards are still IDENTIFYing.
2020-01-28 23:56:46 -05:00
Rapptz
6071607176 Bump copyright year to 2020
Closes #2510
2020-01-19 20:03:00 -05:00
Rapptz
87f9dcff9c Add support for clearing a specific reaction.
Closes #2440
2020-01-17 19:53:28 -05:00
Rapptz
7b2c01c48a Add support for on_invite_create and on_invite_delete 2020-01-17 19:20:53 -05:00
Rapptz
42a084028c Expose _ActivityTag as BaseActivity to easily refer to. 2020-01-14 20:56:00 -05:00
Rapptz
cd9135b082 Rewrite on_ready delay to actually make sense and prevent heavy sleep 2020-01-14 19:52:06 -05:00
NCPlayz
f95ccf53e0 Fix issue with shard_ready not dispatching when not fetching offline 2020-01-14 19:39:34 -05:00
NCPlayz
bb71f14ce3 Add RawReactionActionEvent.member 2019-12-17 23:59:59 -05:00
Rapptz
a6f61dcbde Fix all deprecation warnings for 3.8 2019-11-20 02:30:19 -05:00
Rapptz
45f342ff79 Fix regression with references being overwritten from the cache.
A proper fix for this would be to just request presence information
as well since the chunk request would probably be more up to date than
the current cache. However this delta requires a little bit more work
and will be done later.
2019-11-20 01:41:23 -05:00
Rapptz
15f0b000e1 Move PartialEmoji over to a new namespace to avoid circular imports 2019-11-20 00:50:19 -05:00