Browse Source

[docs] Add async with documentation for Client

Co-authored-by: Rapptz <[email protected]>
pull/10109/head
James Hilton-Balfe 3 years ago
committed by dolfies
parent
commit
5858c44f63
  1. 8
      discord/client.py
  2. 10
      discord/ext/commands/bot.py

8
discord/client.py

@ -136,6 +136,14 @@ class Client:
r"""Represents a client connection that connects to Discord.
This class is used to interact with the Discord WebSocket and API.
.. container:: operations
.. describe:: async with x
Asynchronously initialises the client and automatically cleans up.
.. versionadded:: 2.0
A number of options can be passed to the :class:`Client`.
Parameters

10
discord/ext/commands/bot.py

@ -1220,6 +1220,14 @@ class Bot(BotBase, discord.Client):
This class also subclasses :class:`.GroupMixin` to provide the functionality
to manage commands.
.. container:: operations
.. describe:: async with x
Asynchronously initialises the bot and automatically cleans up.
.. versionadded:: 2.0
Attributes
-----------
command_prefix
@ -1277,3 +1285,5 @@ class Bot(BotBase, discord.Client):
.. versionadded:: 1.7
"""
pass

Loading…
Cancel
Save