From 4dbe1af32f92bd31556dbbbe9616d51ed32e0b59 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 20 Feb 2022 13:35:32 +1000 Subject: [PATCH] Update sphinx and fix documentation issues --- discord/channel.py | 4 +- discord/client.py | 68 +++++++++++++++---------------- discord/ext/commands/bot.py | 2 +- discord/ext/commands/converter.py | 4 +- discord/ext/commands/core.py | 2 +- discord/guild.py | 8 ++-- discord/role.py | 2 +- discord/threads.py | 5 +-- docs/api.rst | 6 +-- setup.py | 2 +- 10 files changed, 51 insertions(+), 52 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index d2409cd34..cd7cc1abb 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1274,9 +1274,9 @@ class StageChannel(VocalGuildChannel): Raises ------- - :exc:`.NotFound` + NotFound The stage instance or channel could not be found. - :exc:`.HTTPException` + HTTPException Getting the stage instance failed. Returns diff --git a/discord/client.py b/discord/client.py index e7cdeac3e..3527dba3f 100644 --- a/discord/client.py +++ b/discord/client.py @@ -475,9 +475,9 @@ class Client: Raises ------ - :exc:`.LoginFailure` + LoginFailure The wrong credentials are passed. - :exc:`.HTTPException` + HTTPException An unknown HTTP related error occurred, usually when it isn't 200 or the known incorrect credentials passing status code. @@ -506,10 +506,10 @@ class Client: Raises ------- - :exc:`.GatewayNotFound` + 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` + ConnectionClosed The websocket connection has been terminated. """ @@ -1106,7 +1106,7 @@ class Client: Raises ------ - :exc:`.InvalidArgument` + InvalidArgument If the ``activity`` parameter is not the proper type. """ @@ -1186,7 +1186,7 @@ class Client: Raises ------ - :exc:`.HTTPException` + HTTPException Getting the guilds failed. Yields @@ -1261,9 +1261,9 @@ class Client: Raises ------- - :exc:`.NotFound` + NotFound The template is invalid. - :exc:`.HTTPException` + HTTPException Getting the template failed. Returns @@ -1300,9 +1300,9 @@ class Client: Raises ------ - :exc:`.Forbidden` + Forbidden You do not have access to the guild. - :exc:`.HTTPException` + HTTPException Getting the guild failed. Returns @@ -1348,9 +1348,9 @@ class Client: Raises ------ - :exc:`.HTTPException` + HTTPException Guild creation failed. - :exc:`.InvalidArgument` + InvalidArgument Invalid icon image format given. Must be PNG or JPG. Returns @@ -1386,9 +1386,9 @@ class Client: Raises ------- - :exc:`.NotFound` + NotFound The stage instance or channel could not be found. - :exc:`.HTTPException` + HTTPException Getting the stage instance failed. Returns @@ -1429,9 +1429,9 @@ class Client: Raises ------- - :exc:`.NotFound` + NotFound The invite has expired or is invalid. - :exc:`.HTTPException` + HTTPException Getting the invite failed. Returns @@ -1463,11 +1463,11 @@ class Client: Raises ------- - :exc:`.Forbidden` + Forbidden You do not have permissions to revoke invites. - :exc:`.NotFound` + NotFound The invite is invalid or expired. - :exc:`.HTTPException` + HTTPException Revoking the invite failed. """ @@ -1496,9 +1496,9 @@ class Client: Raises ------- - :exc:`.Forbidden` + Forbidden The widget for this guild is disabled. - :exc:`.HTTPException` + HTTPException Retrieving the widget failed. Returns @@ -1517,7 +1517,7 @@ class Client: Raises ------- - :exc:`.HTTPException` + HTTPException Retrieving the information failed somehow. Returns @@ -1552,9 +1552,9 @@ class Client: Raises ------- - :exc:`.NotFound` + NotFound A user with this ID does not exist. - :exc:`.HTTPException` + HTTPException Fetching the user failed. Returns @@ -1582,13 +1582,13 @@ class Client: Raises ------- - :exc:`.InvalidData` + InvalidData An unknown channel type was received from Discord. - :exc:`.HTTPException` + HTTPException Retrieving the channel failed. - :exc:`.NotFound` + NotFound Invalid Channel ID. - :exc:`.Forbidden` + Forbidden You do not have permission to fetch this channel. Returns @@ -1625,11 +1625,11 @@ class Client: Raises -------- - :exc:`.HTTPException` + HTTPException Retrieving the webhook failed. - :exc:`.NotFound` + NotFound Invalid webhook ID. - :exc:`.Forbidden` + Forbidden You do not have permission to fetch this webhook. Returns @@ -1649,9 +1649,9 @@ class Client: Raises -------- - :exc:`.HTTPException` + HTTPException Retrieving the sticker failed. - :exc:`.NotFound` + NotFound Invalid sticker ID. Returns @@ -1672,7 +1672,7 @@ class Client: Raises ------- - :exc:`.HTTPException` + HTTPException Retrieving the sticker packs failed. Returns diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index c111be056..7fef7c4e7 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -548,7 +548,7 @@ class BotBase(GroupMixin): The cog does not inherit from :class:`.Cog`. CommandError An error happened during loading. - .ClientException + ClientException A cog with the same name is already loaded. """ diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index 38a08ecd3..5c233dbc6 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -130,9 +130,9 @@ class Converter(Protocol[T_co]): Raises ------- - :exc:`.CommandError` + CommandError A generic exception occurred when converting the argument. - :exc:`.BadArgument` + BadArgument The converter failed to convert the argument. """ raise NotImplementedError('Derived classes need to implement this.') diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index a33c6cce1..393880d74 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -1184,7 +1184,7 @@ class GroupMixin(Generic[CogT]): Raises ------- - :exc:`.CommandRegistrationError` + CommandRegistrationError If the command or its alias is already registered by different command. TypeError If the command passed is not a subclass of :class:`.Command`. diff --git a/discord/guild.py b/discord/guild.py index 062b28f37..2d55b1932 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1802,15 +1802,15 @@ class Guild(Hashable): Raises ------- - :exc:`.InvalidData` + InvalidData An unknown channel type was received from Discord or the guild the channel belongs to is not the same as the one in this object points to. - :exc:`.HTTPException` + HTTPException Retrieving the channel failed. - :exc:`.NotFound` + NotFound Invalid Channel ID. - :exc:`.Forbidden` + Forbidden You do not have permission to fetch this channel. Returns diff --git a/discord/role.py b/discord/role.py index 8caea16bd..b95c3e101 100644 --- a/discord/role.py +++ b/discord/role.py @@ -427,7 +427,7 @@ class Role(Hashable): or :class:`str` representing unicode emoji that should be used as a role icon. Could be ``None`` to denote removal of the icon. Only PNG/JPEG is supported. - This is only available to guilds that contain ``ROLE_ICONS`` in :attr:`features`. + This is only available to guilds that contain ``ROLE_ICONS`` in :attr:`Guild.features`. mentionable: :class:`bool` Indicates if the role should be mentionable by others. position: :class:`int` diff --git a/discord/threads.py b/discord/threads.py index b478b4f29..74b58d944 100644 --- a/discord/threads.py +++ b/discord/threads.py @@ -636,9 +636,8 @@ class Thread(Messageable, Hashable): Adds a user to this thread. - You must have :attr:`~Permissions.send_messages` and :attr:`~Permissions.use_threads` - to add a user to a public thread. If the thread is private then :attr:`~Permissions.send_messages` - and either :attr:`~Permissions.use_private_threads` or :attr:`~Permissions.manage_messages` + You must have :attr:`~Permissions.send_messages_in_threads` to add a user to a thread. + If the thread is private then and :attr:`invitable` is ``False`` then :attr:`~Permissions.manage_messages` is required to add a user to the thread. Parameters diff --git a/docs/api.rst b/docs/api.rst index ce43a92cd..88b71bc2d 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -3157,7 +3157,7 @@ AuditLogDiff Integration emoticons were enabled or disabled. - see also :attr:`Integration.enable_emoticons` + see also :attr:`StreamIntegration.enable_emoticons` :type: :class:`bool` @@ -3166,7 +3166,7 @@ AuditLogDiff The behaviour of expiring subscribers changed. - see also :attr:`Integration.expire_grace_period` + see also :attr:`StreamIntegration.expire_behaviour` :type: :class:`ExpireBehaviour` @@ -3174,7 +3174,7 @@ AuditLogDiff The grace period before expiring subscribers changed. - see also :attr:`Integration.expire_grace_period` + see also :attr:`StreamIntegration.expire_grace_period` :type: :class:`int` diff --git a/setup.py b/setup.py index bedd8f706..9f016acb9 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ with open('README.rst') as f: extras_require = { 'voice': ['PyNaCl>=1.3.0,<1.5'], 'docs': [ - 'sphinx==4.0.2', + 'sphinx==4.4.0', 'sphinxcontrib_trio==1.1.2', 'sphinxcontrib-websupport', ],