aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorapple502j <[email protected]>2021-03-31 20:30:41 +0900
committerGitHub <[email protected]>2021-03-31 07:30:41 -0400
commit954dd09e18e098ef95047c2bc85c8c58b34a8e29 (patch)
treef57bcb6356d2760a9bd9af34a186f7fae2202d9f
parentBring back older background task example under a new name (diff)
downloaddiscord.py-954dd09e18e098ef95047c2bc85c8c58b34a8e29.tar.xz
discord.py-954dd09e18e098ef95047c2bc85c8c58b34a8e29.zip
Deprecate Client.logout
-rw-r--r--discord/client.py5
-rw-r--r--docs/api.rst2
2 files changed, 5 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py
index 8ea1cf30..7866ffd1 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -511,10 +511,13 @@ class Client:
await self.http.static_login(token.strip(), bot=bot)
self._connection.is_bot = bot
+ @utils.deprecated('Client.close')
async def logout(self):
"""|coro|
Logs out of Discord and closes all connections.
+
+ .. deprecated:: 1.7
.. note::
@@ -675,7 +678,7 @@ class Client:
try:
loop.run_until_complete(start(*args, **kwargs))
except KeyboardInterrupt:
- loop.run_until_complete(logout())
+ loop.run_until_complete(close())
# cancel all tasks lingering
finally:
loop.close()
diff --git a/docs/api.rst b/docs/api.rst
index 0b581d6f..2a081c45 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -201,7 +201,7 @@ to handle it, which defaults to print a traceback and ignoring the exception.
.. function:: on_disconnect()
Called when the client has disconnected from Discord, or a connection attempt to Discord has failed.
- This could happen either through the internet being disconnected, explicit calls to logout,
+ This could happen either through the internet being disconnected, explicit calls to close,
or Discord terminating the connection one way or the other.
This function can be called many times without a corresponding :func:`on_connect` call.