diff options
| author | Rapptz <[email protected]> | 2017-01-07 21:55:47 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-01-07 23:19:39 -0500 |
| commit | 20041ea756305f20c86a621232639932c50f107c (patch) | |
| tree | fc9be7da66b1dffd274d96f85dd1cb7c605e56c2 /discord/errors.py | |
| parent | Fix variable shadowing in READY parsing. (diff) | |
| download | discord.py-20041ea756305f20c86a621232639932c50f107c.tar.xz discord.py-20041ea756305f20c86a621232639932c50f107c.zip | |
Implement AutoShardedClient for transparent sharding.
This allows people to run their >2,500 guild bot in a single process
without the headaches of IPC/RPC or much difficulty.
Diffstat (limited to 'discord/errors.py')
| -rw-r--r-- | discord/errors.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/discord/errors.py b/discord/errors.py index 5449b77e..46751b62 100644 --- a/discord/errors.py +++ b/discord/errors.py @@ -118,14 +118,17 @@ class ConnectionClosed(ClientException): Attributes ----------- - code : int + code: int The close code of the websocket. - reason : str + reason: str The reason provided for the closure. + shard_id: Optional[int] + The shard ID that got closed if applicable. """ - def __init__(self, original): + def __init__(self, original, *, shard_id): # This exception is just the same exception except # reconfigured to subclass ClientException for users self.code = original.code self.reason = original.reason + self.shard_id = shard_id super().__init__(str(original)) |