mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Fix up the Sphinx strings causing warnings.
This commit is contained in:
parent
0352c80a17
commit
5c24e69cf2
@ -363,7 +363,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
|
|||||||
name: str
|
name: str
|
||||||
The webhook's name.
|
The webhook's name.
|
||||||
avatar: Optional[bytes]
|
avatar: Optional[bytes]
|
||||||
A *bytes-like* object representing the webhook's default avatar.
|
A :term:`py:bytes-like object` representing the webhook's default avatar.
|
||||||
This operates similarly to :meth:`~ClientUser.edit`.
|
This operates similarly to :meth:`~ClientUser.edit`.
|
||||||
|
|
||||||
Raises
|
Raises
|
||||||
@ -877,7 +877,7 @@ class GroupChannel(discord.abc.Messageable, Hashable):
|
|||||||
The new name to change the group to.
|
The new name to change the group to.
|
||||||
Could be ``None`` to remove the name.
|
Could be ``None`` to remove the name.
|
||||||
icon: Optional[bytes]
|
icon: Optional[bytes]
|
||||||
A bytes-like object representing the new icon.
|
A :term:`py:bytes-like object` representing the new icon.
|
||||||
Could be ``None`` to remove the icon.
|
Could be ``None`` to remove the icon.
|
||||||
|
|
||||||
Raises
|
Raises
|
||||||
|
@ -855,7 +855,7 @@ class Client:
|
|||||||
The region for the voice communication server.
|
The region for the voice communication server.
|
||||||
Defaults to :attr:`VoiceRegion.us_west`.
|
Defaults to :attr:`VoiceRegion.us_west`.
|
||||||
icon: bytes
|
icon: bytes
|
||||||
The *bytes-like* object representing the icon. See :meth:`~ClientUser.edit`
|
The :term:`py:bytes-like object` representing the icon. See :meth:`~ClientUser.edit`
|
||||||
for more details on what is expected.
|
for more details on what is expected.
|
||||||
|
|
||||||
Raises
|
Raises
|
||||||
|
@ -228,7 +228,7 @@ class Emoji(Hashable):
|
|||||||
await self._state.http.delete_custom_emoji(self.guild.id, self.id, reason=reason)
|
await self._state.http.delete_custom_emoji(self.guild.id, self.id, reason=reason)
|
||||||
|
|
||||||
async def edit(self, *, name, roles=None, reason=None):
|
async def edit(self, *, name, roles=None, reason=None):
|
||||||
"""|coro|
|
r"""|coro|
|
||||||
|
|
||||||
Edits the custom emoji.
|
Edits the custom emoji.
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ class Emoji(Hashable):
|
|||||||
name: str
|
name: str
|
||||||
The new emoji name.
|
The new emoji name.
|
||||||
roles: Optional[list[:class:`Role`]]
|
roles: Optional[list[:class:`Role`]]
|
||||||
A :class:`list` of :class:`Role`s that can use this emoji. Leave empty to make it available to everyone.
|
A :class:`list` of :class:`Role`\s that can use this emoji. Leave empty to make it available to everyone.
|
||||||
reason: Optional[str]
|
reason: Optional[str]
|
||||||
The reason for editing this emoji. Shows up on the audit log.
|
The reason for editing this emoji. Shows up on the audit log.
|
||||||
|
|
||||||
|
@ -688,10 +688,10 @@ class Guild(Hashable):
|
|||||||
name: str
|
name: str
|
||||||
The new name of the guild.
|
The new name of the guild.
|
||||||
icon: bytes
|
icon: bytes
|
||||||
A *bytes-like* object representing the icon. Only PNG/JPEG supported.
|
A :term:`py:bytes-like object` representing the icon. Only PNG/JPEG supported.
|
||||||
Could be ``None`` to denote removal of the icon.
|
Could be ``None`` to denote removal of the icon.
|
||||||
splash: bytes
|
splash: bytes
|
||||||
A *bytes-like* object representing the invite splash.
|
A :term:`py:bytes-like object` representing the invite splash.
|
||||||
Only PNG/JPEG supported. Could be ``None`` to denote removing the
|
Only PNG/JPEG supported. Could be ``None`` to denote removing the
|
||||||
splash. Only available for partnered guilds with ``INVITE_SPLASH``
|
splash. Only available for partnered guilds with ``INVITE_SPLASH``
|
||||||
feature.
|
feature.
|
||||||
@ -987,7 +987,7 @@ class Guild(Hashable):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
async def create_custom_emoji(self, *, name, image, roles=None, reason=None):
|
async def create_custom_emoji(self, *, name, image, roles=None, reason=None):
|
||||||
"""|coro|
|
r"""|coro|
|
||||||
|
|
||||||
Creates a custom :class:`Emoji` for the guild.
|
Creates a custom :class:`Emoji` for the guild.
|
||||||
|
|
||||||
@ -1003,10 +1003,10 @@ class Guild(Hashable):
|
|||||||
name: str
|
name: str
|
||||||
The emoji name. Must be at least 2 characters.
|
The emoji name. Must be at least 2 characters.
|
||||||
image: bytes
|
image: bytes
|
||||||
The *bytes-like* object representing the image data to use.
|
The :term:`py:bytes-like object` representing the image data to use.
|
||||||
Only JPG and PNG images are supported.
|
Only JPG and PNG images are supported.
|
||||||
roles: Optional[list[:class:`Role`]]
|
roles: Optional[list[:class:`Role`]]
|
||||||
A :class:`list` of :class:`Role`s that can use this emoji. Leave empty to make it available to everyone.
|
A :class:`list` of :class:`Role`\s that can use this emoji. Leave empty to make it available to everyone.
|
||||||
reason: Optional[str]
|
reason: Optional[str]
|
||||||
The reason for creating this emoji. Shows up on the audit log.
|
The reason for creating this emoji. Shows up on the audit log.
|
||||||
|
|
||||||
|
@ -54,8 +54,8 @@ class AudioSource:
|
|||||||
|
|
||||||
Subclasses must implement this.
|
Subclasses must implement this.
|
||||||
|
|
||||||
If the audio is complete, then returning an empty *bytes-like* object
|
If the audio is complete, then returning an empty
|
||||||
to signal this is the way to do so.
|
:term:`py:bytes-like object` to signal this is the way to do so.
|
||||||
|
|
||||||
If :meth:`is_opus` method returns ``True``, then it must return
|
If :meth:`is_opus` method returns ``True``, then it must return
|
||||||
20ms worth of Opus encoded audio. Otherwise, it must be 20ms
|
20ms worth of Opus encoded audio. Otherwise, it must be 20ms
|
||||||
|
@ -323,10 +323,10 @@ class ClientUser(BaseUser):
|
|||||||
|
|
||||||
Note
|
Note
|
||||||
-----
|
-----
|
||||||
To upload an avatar, a *bytes-like object* must be passed in that
|
To upload an avatar, a :term:`py:bytes-like object` must be passed in that
|
||||||
represents the image being uploaded. If this is done through a file
|
represents the image being uploaded. If this is done through a file
|
||||||
then the file must be opened via ``open('some_filename', 'rb')`` and
|
then the file must be opened via ``open('some_filename', 'rb')`` and
|
||||||
the *bytes-like object* is given through the use of ``fp.read()``.
|
the :term:`py:bytes-like object` is given through the use of ``fp.read()``.
|
||||||
|
|
||||||
The only image formats supported for uploading is JPEG and PNG.
|
The only image formats supported for uploading is JPEG and PNG.
|
||||||
|
|
||||||
@ -341,14 +341,14 @@ class ClientUser(BaseUser):
|
|||||||
email: str
|
email: str
|
||||||
The new email you wish to change to.
|
The new email you wish to change to.
|
||||||
Only applicable to user accounts.
|
Only applicable to user accounts.
|
||||||
Optional[:class:`HypeSquadHouse`]
|
house: Optional[:class:`HypeSquadHouse`]
|
||||||
The hypesquad house you wish to change to.
|
The hypesquad house you wish to change to.
|
||||||
Could be ``None`` to leave the current house.
|
Could be ``None`` to leave the current house.
|
||||||
Only applicable to user accounts.
|
Only applicable to user accounts.
|
||||||
username :str
|
username :str
|
||||||
The new username you wish to change to.
|
The new username you wish to change to.
|
||||||
avatar: bytes
|
avatar: bytes
|
||||||
A *bytes-like object* representing the image to upload.
|
A :term:`py:bytes-like object` representing the image to upload.
|
||||||
Could be ``None`` to denote no avatar.
|
Could be ``None`` to denote no avatar.
|
||||||
|
|
||||||
Raises
|
Raises
|
||||||
|
@ -392,7 +392,7 @@ class VoiceClient:
|
|||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
data: bytes
|
data: bytes
|
||||||
The *bytes-like object* denoting PCM or Opus voice data.
|
The :term:`py:bytes-like object` denoting PCM or Opus voice data.
|
||||||
encode: bool
|
encode: bool
|
||||||
Indicates if ``data`` should be encoded into Opus.
|
Indicates if ``data`` should be encoded into Opus.
|
||||||
|
|
||||||
|
@ -525,7 +525,7 @@ class Webhook:
|
|||||||
name: Optional[str]
|
name: Optional[str]
|
||||||
The webhook's new default name.
|
The webhook's new default name.
|
||||||
avatar: Optional[bytes]
|
avatar: Optional[bytes]
|
||||||
A *bytes-like* object representing the webhook's new default avatar.
|
A :term:`py:bytes-like object` representing the webhook's new default avatar.
|
||||||
|
|
||||||
Raises
|
Raises
|
||||||
-------
|
-------
|
||||||
|
@ -46,7 +46,7 @@ extlinks = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Links used for cross-referencing stuff in other documentation
|
# Links used for cross-referencing stuff in other documentation
|
||||||
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
|
intersphinx_mapping = {'py': ('https://docs.python.org/3', None)}
|
||||||
|
|
||||||
rst_prolog = """
|
rst_prolog = """
|
||||||
.. |coro| replace:: This function is a |corourl|_.
|
.. |coro| replace:: This function is a |corourl|_.
|
||||||
@ -314,4 +314,4 @@ texinfo_documents = [
|
|||||||
def setup(app):
|
def setup(app):
|
||||||
app.add_javascript('custom.js')
|
app.add_javascript('custom.js')
|
||||||
if app.config.language == 'ja':
|
if app.config.language == 'ja':
|
||||||
app.config.intersphinx_mapping['python'] = ('https://docs.python.org/ja/3', None)
|
app.config.intersphinx_mapping['py'] = ('https://docs.python.org/ja/3', None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user