Add shard related connection and resume events.
These include: * on_shard_resumed * on_shard_connect * on_shard_disconnect
This commit is contained in:
		
							
								
								
									
										30
									
								
								docs/api.rst
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user