mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-08 10:53:10 +00:00
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
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user