diff options
| author | Rapptz <[email protected]> | 2015-11-01 15:30:20 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2015-11-01 15:30:20 -0500 |
| commit | 71617230344a6adf2c0c9688d5d55e0132aa3050 (patch) | |
| tree | 32a1e8a8da2491badee08efc6db543d79fa39de0 /docs/api.rst | |
| parent | Document Client.login raising exceptions. (diff) | |
| download | discord.py-71617230344a6adf2c0c9688d5d55e0132aa3050.tar.xz discord.py-71617230344a6adf2c0c9688d5d55e0132aa3050.zip | |
Change on_server_create/delete to on_server_join/remove.
Diffstat (limited to 'docs/api.rst')
| -rw-r--r-- | docs/api.rst | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/docs/api.rst b/docs/api.rst index 03100c08..5ffc9966 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -188,15 +188,28 @@ to handle it, which defaults to print a traceback and ignore the exception. :param member: The :class:`Member` that updated their profile with the updated info. -.. function:: on_server_create(server) - on_server_delete(server) +.. function:: on_server_join(server) - Called when a :class:`Server` is created or deleted. + Called when a :class:`Server` is either created by the :class:`Client` or when the + :class:`Client` joins a server. - Note that the server that is created must belong to the :class:`Client` and the server - that got deleted must have been part of the client's participating servers. + :param server: The class:`Server` that was joined. - :param server: The :class:`Server` that got created or deleted. +.. function:: on_server_remove(server) + + Called when a :class:`Server` is removed from the :class:`Client`. + + This happens through, but not limited to, these circumstances: + + - The client got banned. + - The client got kicked. + - The client left the server. + - The client or the server owner deleted the server. + + In order for this event to be invoked then the :class:`Client` must have + been part of the server to begin with. (i.e. it is part of :attr:`Client.servers`) + + :param server: The :class:`Server` that got removed. .. function:: on_server_role_create(server, role) on_server_role_delete(server, role) |