diff options
| author | Rapptz <[email protected]> | 2018-09-24 23:22:49 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2018-09-24 23:22:49 -0400 |
| commit | 27216892547bb073777056379d549a6dc42872cb (patch) | |
| tree | 18d1eded01727f64c93e31d23cb68201de16c832 /discord/shard.py | |
| parent | Optimise some member and user related routines. (diff) | |
| download | discord.py-27216892547bb073777056379d549a6dc42872cb.tar.xz discord.py-27216892547bb073777056379d549a6dc42872cb.zip | |
Optimise tight loops in DiscordGateway.received_message
* type(x) is y is faster than isinstance(x, y)
* Re-arrange if-statements for common statements
* Drop handler getattr for most events that don't use it
Diffstat (limited to 'discord/shard.py')
| -rw-r--r-- | discord/shard.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/discord/shard.py b/discord/shard.py index 55600e56..d0da4151 100644 --- a/discord/shard.py +++ b/discord/shard.py @@ -124,7 +124,8 @@ class AutoShardedClient(Client): raise ClientException('shard_ids parameter must be a list or a tuple.') self._connection = AutoShardedConnectionState(dispatch=self.dispatch, chunker=self._chunker, - syncer=self._syncer, http=self.http, loop=self.loop, **kwargs) + handlers=self._handlers, syncer=self._syncer, + http=self.http, loop=self.loop, **kwargs) # instead of a single websocket, we have multiple # the key is the shard_id |