[docs] Add async with documentation for Client

Co-authored-by: Rapptz <1695103+Rapptz@users.noreply.github.com>
This commit is contained in:
James Hilton-Balfe
2022-06-12 16:06:44 -04:00
committed by GitHub
co-authored by Rapptz
parent 1f053e0a32
commit 5d1b63bfee
3 changed files with 32 additions and 0 deletions
+16
View File
@@ -1387,6 +1387,14 @@ class Bot(BotBase, discord.Client):
a :class:`~discord.app_commands.CommandTree` and is automatically set upon
instantiating the class.
.. container:: operations
.. describe:: async with x
Asynchronously initialises the bot and automatically cleans up.
.. versionadded:: 2.0
Attributes
-----------
command_prefix
@@ -1457,6 +1465,14 @@ class Bot(BotBase, discord.Client):
class AutoShardedBot(BotBase, discord.AutoShardedClient):
"""This is similar to :class:`.Bot` except that it is inherited from
:class:`discord.AutoShardedClient` instead.
.. container:: operations
.. describe:: async with x
Asynchronously initialises the bot and automatically cleans.
.. versionadded:: 2.0
"""
pass