Browse Source

Update sphinx and fix documentation issues

pull/7494/head
Josh 3 years ago
committed by GitHub
parent
commit
4dbe1af32f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      discord/channel.py
  2. 68
      discord/client.py
  3. 2
      discord/ext/commands/bot.py
  4. 4
      discord/ext/commands/converter.py
  5. 2
      discord/ext/commands/core.py
  6. 8
      discord/guild.py
  7. 2
      discord/role.py
  8. 5
      discord/threads.py
  9. 6
      docs/api.rst
  10. 2
      setup.py

4
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

68
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

2
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.
"""

4
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.')

2
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`.

8
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

2
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`

5
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

6
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`

2
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',
],

Loading…
Cancel
Save