diff options
| author | Rapptz <[email protected]> | 2020-04-11 22:35:07 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2020-07-25 09:59:39 -0400 |
| commit | 8070d39a23863aacd52b28e1b432e128cf5d3a2e (patch) | |
| tree | f7460ce9fe541f0a2d33b4615f0150efbb1ad1b7 /docs/api.rst | |
| parent | Handle connection errors during reidentify flow. (diff) | |
| download | discord.py-8070d39a23863aacd52b28e1b432e128cf5d3a2e.tar.xz discord.py-8070d39a23863aacd52b28e1b432e128cf5d3a2e.zip | |
Add shard related connection and resume events.
These include:
* on_shard_resumed
* on_shard_connect
* on_shard_disconnect
Diffstat (limited to 'docs/api.rst')
| -rw-r--r-- | docs/api.rst | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/api.rst b/docs/api.rst index 5469f9b8..601a6c01 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -117,6 +117,16 @@ to handle it, which defaults to print a traceback and ignoring the exception. The warnings on :func:`on_ready` also apply. +.. function:: on_shard_connect(shard_id) + + Similar to :func:`on_connect` except used by :class:`AutoShardedClient` + to denote when a particular shard ID has connected to Discord. + + .. versionadded:: 1.4 + + :param shard_id: The shard ID that has connected. + :type shard_id: :class:`int` + .. function:: on_disconnect() Called when the client has disconnected from Discord. This could happen either through @@ -125,6 +135,16 @@ to handle it, which defaults to print a traceback and ignoring the exception. This function can be called many times. +.. function:: on_shard_disconnect(shard_id) + + Similar to :func:`on_disconnect` except used by :class:`AutoShardedClient` + to denote when a particular shard ID has disconnected from Discord. + + .. versionadded:: 1.4 + + :param shard_id: The shard ID that has disconnected. + :type shard_id: :class:`int` + .. function:: on_ready() Called when the client is done preparing the data received from Discord. Usually after login is successful @@ -149,6 +169,16 @@ to handle it, which defaults to print a traceback and ignoring the exception. Called when the client has resumed a session. +.. function:: on_shard_resumed(shard_id) + + Similar to :func:`on_resumed` except used by :class:`AutoShardedClient` + to denote when a particular shard ID has resumed a session. + + .. versionadded:: 1.4 + + :param shard_id: The shard ID that has resumed. + :type shard_id: :class:`int` + .. function:: on_error(event, \*args, \*\*kwargs) Usually when an event raises an uncaught exception, a traceback is |