Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
0b5adcf
Update quickstart.rst
plun1331 Mar 10, 2022
e34d4a8
Update bot.py
plun1331 Mar 10, 2022
e63d5ac
Update cog.py
plun1331 Mar 10, 2022
fc4c1a5
Update client.py
plun1331 Mar 10, 2022
31a2846
Update quickstart.rst
plun1331 Mar 10, 2022
1668b9b
Update client.py
plun1331 Mar 10, 2022
cf4b108
Update bot.py
plun1331 Mar 10, 2022
b9e6df6
Update core.py
plun1331 Mar 11, 2022
b7ed3f4
Update permissions.py
plun1331 Mar 11, 2022
80bf105
Update api.rst
plun1331 Mar 11, 2022
8c5e938
Update core.py
plun1331 Mar 11, 2022
ea73da0
Update voice_client.py
plun1331 Mar 11, 2022
2982a31
Update voice_client.py
plun1331 Mar 11, 2022
590ecb6
Update voice_client.py
plun1331 Mar 11, 2022
8df138b
Update voice_client.py
plun1331 Mar 11, 2022
84d9c35
Update api.rst
plun1331 Mar 11, 2022
decee2b
Update errors.py
plun1331 Mar 11, 2022
71e127c
Update api.rst
plun1331 Mar 11, 2022
75176e8
Merge branch 'Pycord-Development:master' into doc-updates
plun1331 Mar 21, 2022
269f74c
Update client.py
plun1331 Mar 21, 2022
d4f0e1e
Update utils.py
plun1331 Mar 22, 2022
65818db
Update member.py
plun1331 Mar 22, 2022
cf2703d
Update modal.py
plun1331 Mar 22, 2022
2326219
Update modal.py
plun1331 Mar 22, 2022
bdbbca6
Update input_text.py
plun1331 Mar 22, 2022
7421b1a
Update input_text.py
plun1331 Mar 22, 2022
4f22a0e
Update core.py
plun1331 Mar 22, 2022
27c9cab
Update core.py
plun1331 Mar 22, 2022
65192fd
Update m4a.py
plun1331 Mar 22, 2022
ee67ded
Update m4a.py
plun1331 Mar 22, 2022
db099c4
Update mka.py
plun1331 Mar 22, 2022
020fd6a
Update m4a.py
plun1331 Mar 22, 2022
d3815ff
Update mkv.py
plun1331 Mar 22, 2022
1e0db94
Update mp3.py
plun1331 Mar 22, 2022
736d6ad
Update mp4.py
plun1331 Mar 22, 2022
70eed8b
Update ogg.py
plun1331 Mar 22, 2022
7342dfe
Update pcm.py
plun1331 Mar 22, 2022
a6b29c1
Update wave.py
plun1331 Mar 22, 2022
c9dc1b4
Update core.py
plun1331 Mar 22, 2022
2974ec0
Update api.rst
plun1331 Mar 22, 2022
28d0a8c
Merge branch 'Pycord-Development:master' into doc-updates
plun1331 Mar 22, 2022
42a6c10
Update errors.py
plun1331 Mar 22, 2022
6110a3c
Update api.rst
plun1331 Mar 22, 2022
295e570
Update api.rst
plun1331 Mar 22, 2022
94a1716
Update utils.py
plun1331 Mar 22, 2022
449855a
Update async_.py
plun1331 Mar 23, 2022
952d4e4
Update scheduled_events.py
plun1331 Mar 23, 2022
3e7e45a
Update async_.py
plun1331 Mar 23, 2022
3ff601a
Update async_.py
plun1331 Mar 23, 2022
7222cb1
Update cogs.rst
plun1331 Mar 23, 2022
be32f94
Update api.rst
plun1331 Mar 23, 2022
2406fd6
Update api.rst
plun1331 Mar 23, 2022
90f4f89
Update __init__.py
plun1331 Mar 23, 2022
8372db3
Update api.rst
plun1331 Mar 23, 2022
e2e6c4d
Update api.rst
plun1331 Mar 23, 2022
1d4fd64
Update api.rst
plun1331 Mar 23, 2022
f20b8b2
Update api.rst
plun1331 Mar 23, 2022
2017be6
Merge branch 'Pycord-Development:master' into doc-updates
plun1331 Mar 23, 2022
aea9afe
Update cog.py
plun1331 Mar 23, 2022
520894b
Update core.py
plun1331 Mar 23, 2022
9eaa4cd
Update bot.py
plun1331 Mar 23, 2022
45b7aec
Rename migrating.rst to migrating_to_v1.rst
plun1331 Mar 23, 2022
58267a8
Update whats_new.rst
plun1331 Mar 23, 2022
346f68a
Update index.rst
plun1331 Mar 23, 2022
bb1928e
Update conf.py
plun1331 Mar 23, 2022
9106842
Update index.rst
plun1331 Mar 23, 2022
d6d258e
Update index.rst
plun1331 Mar 23, 2022
7c0167b
Update bot.py
plun1331 Mar 23, 2022
0a3d9aa
Update installing.rst
plun1331 Mar 24, 2022
1e67997
Update api.rst
plun1331 Mar 24, 2022
09d7bbe
Update commands.rst
plun1331 Mar 24, 2022
e61b0a5
Use :decorator: option
plun1331 Mar 27, 2022
2a5da61
Add trailing comma
plun1331 Mar 27, 2022
741c6bf
Fix docstrings
plun1331 Mar 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion discord/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from .bot import *
from .channel import *
from .client import *
from .cog import Cog
from .cog import *
from .colour import *
from .commands.__init__ import *
from .components import *
Expand Down
30 changes: 15 additions & 15 deletions discord/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def application_commands(self) -> List[ApplicationCommand]:
def add_application_command(self, command: ApplicationCommand) -> None:
"""Adds a :class:`.ApplicationCommand` into the internal list of commands.

This is usually not called, instead the :meth:`~.ApplicationMixin.command` or
This is usually not called, instead the :meth:`command` or
other shortcut decorators are used instead.

.. versionadded:: 2.0
Expand Down Expand Up @@ -321,7 +321,7 @@ async def register_command(
) -> None:
"""|coro|

Registers a command. If the command has guild_ids set, or if the guild_ids parameter is passed, the command will
Registers a command. If the command has ``guild_ids`` set, or if the ``guild_ids`` parameter is passed, the command will
be registered as a guild command for those guilds.

Parameters
Expand All @@ -333,7 +333,7 @@ async def register_command(
if it seems to already be registered and up to date with our internal cache. Defaults to True.
guild_ids: :class:`list`
A list of guild ids to register the command for. If this is not set, the command's
:attr:`~.ApplicationCommand.guild_ids` attribute will be used.
:attr:`ApplicationCommand.guild_ids` attribute will be used.

Returns
-------
Expand Down Expand Up @@ -361,7 +361,7 @@ async def register_commands(
A list of commands to register. If this is not set (None), then all commands will be registered.
guild_id: Optional[int]
If this is set, the commands will be registered as a guild command for the respective guild. If it is not
set, the commands will be registered according to their :attr:`~.ApplicationCommand.guild_ids` attribute.
set, the commands will be registered according to their :attr:`ApplicationCommand.guild_ids` attribute.
force: :class:`bool`
Registers the commands regardless of the state of the command on Discord. This can sometimes cause commands
to be re-registered without changes (The command can temporarily appear as an invalid command on the user's
Expand Down Expand Up @@ -752,8 +752,8 @@ async def process_application_commands(self, interaction: Interaction, auto_sync
await self.invoke_application_command(ctx)

def slash_command(self, **kwargs):
"""A shortcut decorator that invokes :func:`.ApplicationCommandMixin.command` and adds it to
the internal command list via :meth:`~.ApplicationCommandMixin.add_application_command`.
"""A shortcut decorator that invokes :func:`command` and adds it to
the internal command list via :meth:`add_application_command`.
This shortcut is made specifically for :class:`.SlashCommand`.

.. versionadded:: 2.0
Expand All @@ -767,8 +767,8 @@ def slash_command(self, **kwargs):
return self.application_command(cls=SlashCommand, **kwargs)

def user_command(self, **kwargs):
"""A shortcut decorator that invokes :func:`.ApplicationCommandMixin.command` and adds it to
the internal command list via :meth:`~.ApplicationCommandMixin.add_application_command`.
"""A shortcut decorator that invokes :func:`command` and adds it to
the internal command list via :meth:`add_application_command`.
This shortcut is made specifically for :class:`.UserCommand`.

.. versionadded:: 2.0
Expand All @@ -782,8 +782,8 @@ def user_command(self, **kwargs):
return self.application_command(cls=UserCommand, **kwargs)

def message_command(self, **kwargs):
"""A shortcut decorator that invokes :func:`.ApplicationCommandMixin.command` and adds it to
the internal command list via :meth:`~.ApplicationCommandMixin.add_application_command`.
"""A shortcut decorator that invokes :func:`command` and adds it to
the internal command list via :meth:`add_application_command`.
This shortcut is made specifically for :class:`.MessageCommand`.

.. versionadded:: 2.0
Expand All @@ -797,8 +797,8 @@ def message_command(self, **kwargs):
return self.application_command(cls=MessageCommand, **kwargs)

def application_command(self, **kwargs):
"""A shortcut decorator that invokes :func:`.command` and adds it to
the internal command list via :meth:`~.ApplicationCommandMixin.add_application_command`.
"""A shortcut decorator that invokes :func:`command` and adds it to
the internal command list via :meth:`add_application_command`.

.. versionadded:: 2.0

Expand All @@ -817,7 +817,7 @@ def decorator(func) -> ApplicationCommand:
return decorator

def command(self, **kwargs):
"""There is an alias for :meth:`application_command`.
"""An alias for :meth:`application_command`.

.. note::

Expand Down Expand Up @@ -1076,7 +1076,7 @@ def check(self, func):

This function can either be a regular function or a coroutine. Similar to a command :func:`.check`, this
takes a single parameter of type :class:`.Context` and can only raise exceptions inherited from
:exc:`.CommandError`.
:exc:`.ApplicationCommandError`.

Example
---------
Expand Down Expand Up @@ -1145,7 +1145,7 @@ def check_once(self, func):

This function can either be a regular function or a coroutine. Similar to a command :func:`.check`,
this takes a single parameter of type :class:`.Context` and can only raise exceptions inherited from
:exc:`.CommandError`.
:exc:`.ApplicationCommandError`.

Example
---------
Expand Down
70 changes: 35 additions & 35 deletions discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,9 @@ async def login(self, token: str) -> None:
------
TypeError
The token was in invalid type.
:exc:`.LoginFailure`
:exc:`LoginFailure`
The wrong credentials are passed.
:exc:`.HTTPException`
:exc:`HTTPException`
An unknown HTTP related error occurred,
usually when it isn't 200 or the known incorrect credentials
passing status code.
Expand Down Expand Up @@ -532,10 +532,10 @@ async def connect(self, *, reconnect: bool = True) -> None:

Raises
-------
:exc:`.GatewayNotFound`
:exc:`GatewayNotFound`
If the gateway to connect to Discord is not found. Usually if this
is thrown then there is a Discord API outage.
:exc:`.ConnectionClosed`
:exc:`ConnectionClosed`
The websocket connection has been terminated.
"""

Expand Down Expand Up @@ -1163,7 +1163,7 @@ async def change_presence(

Raises
------
:exc:`.InvalidArgument`
:exc:`InvalidArgument`
If the ``activity`` parameter is not the proper type.
"""

Expand Down Expand Up @@ -1239,7 +1239,7 @@ def fetch_guilds(

Raises
------
:exc:`.HTTPException`
:exc:`HTTPException`
Getting the guilds failed.

Yields
Expand All @@ -1261,9 +1261,9 @@ async def fetch_template(self, code: Union[Template, str]) -> Template:

Raises
-------
:exc:`.NotFound`
:exc:`NotFound`
The template is invalid.
:exc:`.HTTPException`
:exc:`HTTPException`
Getting the template failed.

Returns
Expand Down Expand Up @@ -1302,9 +1302,9 @@ async def fetch_guild(self, guild_id: int, /, *, with_counts=True) -> Guild:
.. versionadded:: 2.0
Raises
------
:exc:`.Forbidden`
:exc:`Forbidden`
You do not have access to the guild.
:exc:`.HTTPException`
:exc:`HTTPException`
Getting the guild failed.

Returns
Expand Down Expand Up @@ -1346,9 +1346,9 @@ async def create_guild(

Raises
------
:exc:`.HTTPException`
:exc:`HTTPException`
Guild creation failed.
:exc:`.InvalidArgument`
:exc:`InvalidArgument`
Invalid icon image format given. Must be PNG or JPG.

Returns
Expand Down Expand Up @@ -1384,9 +1384,9 @@ async def fetch_stage_instance(self, channel_id: int, /) -> StageInstance:

Raises
-------
:exc:`.NotFound`
:exc:`NotFound`
The stage instance or channel could not be found.
:exc:`.HTTPException`
:exc:`HTTPException`
Getting the stage instance failed.

Returns
Expand Down Expand Up @@ -1437,13 +1437,13 @@ async def fetch_invite(
See :meth:`Invite.set_scheduled_event` for more
info on event invite linking.

..versionadded:: 2.0
.. versionadded:: 2.0

Raises
-------
:exc:`.NotFound`
:exc:`NotFound`
The invite has expired or is invalid.
:exc:`.HTTPException`
:exc:`HTTPException`
Getting the invite failed.

Returns
Expand Down Expand Up @@ -1476,11 +1476,11 @@ async def delete_invite(self, invite: Union[Invite, str]) -> None:

Raises
-------
:exc:`.Forbidden`
:exc:`Forbidden`
You do not have permissions to revoke invites.
:exc:`.NotFound`
:exc:`NotFound`
The invite is invalid or expired.
:exc:`.HTTPException`
:exc:`HTTPException`
Revoking the invite failed.
"""

Expand All @@ -1505,9 +1505,9 @@ async def fetch_widget(self, guild_id: int, /) -> Widget:

Raises
-------
:exc:`.Forbidden`
:exc:`Forbidden`
The widget for this guild is disabled.
:exc:`.HTTPException`
:exc:`HTTPException`
Retrieving the widget failed.

Returns
Expand All @@ -1526,7 +1526,7 @@ async def application_info(self) -> AppInfo:

Raises
-------
:exc:`.HTTPException`
:exc:`HTTPException`
Retrieving the information failed somehow.

Returns
Expand Down Expand Up @@ -1557,9 +1557,9 @@ async def fetch_user(self, user_id: int, /) -> User:

Raises
-------
:exc:`.NotFound`
:exc:`NotFound`
A user with this ID does not exist.
:exc:`.HTTPException`
:exc:`HTTPException`
Fetching the user failed.

Returns
Expand All @@ -1583,13 +1583,13 @@ async def fetch_channel(self, channel_id: int, /) -> Union[GuildChannel, Private

Raises
-------
:exc:`.InvalidData`
:exc:`InvalidData`
An unknown channel type was received from Discord.
:exc:`.HTTPException`
:exc:`HTTPException`
Retrieving the channel failed.
:exc:`.NotFound`
:exc:`NotFound`
Invalid Channel ID.
:exc:`.Forbidden`
:exc:`Forbidden`
You do not have permission to fetch this channel.

Returns
Expand Down Expand Up @@ -1619,11 +1619,11 @@ async def fetch_webhook(self, webhook_id: int, /) -> Webhook:

Raises
--------
:exc:`.HTTPException`
:exc:`HTTPException`
Retrieving the webhook failed.
:exc:`.NotFound`
:exc:`NotFound`
Invalid webhook ID.
:exc:`.Forbidden`
:exc:`Forbidden`
You do not have permission to fetch this webhook.

Returns
Expand All @@ -1643,9 +1643,9 @@ async def fetch_sticker(self, sticker_id: int, /) -> Union[StandardSticker, Guil

Raises
--------
:exc:`.HTTPException`
:exc:`HTTPException`
Retrieving the sticker failed.
:exc:`.NotFound`
:exc:`NotFound`
Invalid sticker ID.

Returns
Expand All @@ -1666,7 +1666,7 @@ async def fetch_premium_sticker_packs(self) -> List[StickerPack]:

Raises
-------
:exc:`.HTTPException`
:exc:`HTTPException`
Retrieving the sticker packs failed.

Returns
Expand Down
6 changes: 3 additions & 3 deletions discord/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ async def cog_command_error(self, ctx: ApplicationContext, error: Exception) ->
-----------
ctx: :class:`.Context`
The invocation context where the error happened.
error: :class:`CommandError`
error: :class:`ApplicationCommandError`
The error that happened.
"""
pass
Expand Down Expand Up @@ -549,9 +549,9 @@ def add_cog(self, cog: Cog, *, override: bool = False) -> None:
-------
TypeError
The cog does not inherit from :class:`.Cog`.
CommandError
ApplicationCommandError
An error happened during loading.
.ClientException
ClientException
A cog with the same name is already loaded.
"""

Expand Down
Loading