mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-11 12:28:03 +00:00
[docs] Add async with documentation for Client
Co-authored-by: Rapptz <1695103+Rapptz@users.noreply.github.com>
This commit is contained in:
parent
1f053e0a32
commit
5d1b63bfee
@ -117,6 +117,14 @@ class Client:
|
|||||||
r"""Represents a client connection that connects to Discord.
|
r"""Represents a client connection that connects to Discord.
|
||||||
This class is used to interact with the Discord WebSocket and API.
|
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`.
|
A number of options can be passed to the :class:`Client`.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
|
@ -1387,6 +1387,14 @@ class Bot(BotBase, discord.Client):
|
|||||||
a :class:`~discord.app_commands.CommandTree` and is automatically set upon
|
a :class:`~discord.app_commands.CommandTree` and is automatically set upon
|
||||||
instantiating the class.
|
instantiating the class.
|
||||||
|
|
||||||
|
.. container:: operations
|
||||||
|
|
||||||
|
.. describe:: async with x
|
||||||
|
|
||||||
|
Asynchronously initialises the bot and automatically cleans up.
|
||||||
|
|
||||||
|
.. versionadded:: 2.0
|
||||||
|
|
||||||
Attributes
|
Attributes
|
||||||
-----------
|
-----------
|
||||||
command_prefix
|
command_prefix
|
||||||
@ -1457,6 +1465,14 @@ class Bot(BotBase, discord.Client):
|
|||||||
class AutoShardedBot(BotBase, discord.AutoShardedClient):
|
class AutoShardedBot(BotBase, discord.AutoShardedClient):
|
||||||
"""This is similar to :class:`.Bot` except that it is inherited from
|
"""This is similar to :class:`.Bot` except that it is inherited from
|
||||||
:class:`discord.AutoShardedClient` instead.
|
:class:`discord.AutoShardedClient` instead.
|
||||||
|
|
||||||
|
.. container:: operations
|
||||||
|
|
||||||
|
.. describe:: async with x
|
||||||
|
|
||||||
|
Asynchronously initialises the bot and automatically cleans.
|
||||||
|
|
||||||
|
.. versionadded:: 2.0
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
@ -308,6 +308,14 @@ class AutoShardedClient(Client):
|
|||||||
if this is used. By default, when omitted, the client will launch shards from
|
if this is used. By default, when omitted, the client will launch shards from
|
||||||
0 to ``shard_count - 1``.
|
0 to ``shard_count - 1``.
|
||||||
|
|
||||||
|
.. container:: operations
|
||||||
|
|
||||||
|
.. describe:: async with x
|
||||||
|
|
||||||
|
Asynchronously initialises the client and automatically.
|
||||||
|
|
||||||
|
.. versionadded:: 2.0
|
||||||
|
|
||||||
Attributes
|
Attributes
|
||||||
------------
|
------------
|
||||||
shard_ids: Optional[List[:class:`int`]]
|
shard_ids: Optional[List[:class:`int`]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user