Browse Source

[docs] Fix various unresolved references

pull/6744/head
Nadir Chowdhury 4 years ago
committed by GitHub
parent
commit
8f9819eb4c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      discord/abc.py
  2. 2
      discord/embeds.py
  3. 6
      discord/message.py
  4. 5
      docs/ext/commands/commands.rst
  5. 4
      docs/ext/commands/extensions.rst
  6. 6
      docs/faq.rst

6
discord/abc.py

@ -780,10 +780,10 @@ class GuildChannel(Protocol):
Whether to move the channel to the end of the Whether to move the channel to the end of the
channel list (or category if given). channel list (or category if given).
This is mutually exclusive with ``beginning``, ``before``, and ``after``. This is mutually exclusive with ``beginning``, ``before``, and ``after``.
before: :class:`abc.Snowflake` before: :class:`~discord.abc.Snowflake`
The channel that should be before our current channel. The channel that should be before our current channel.
This is mutually exclusive with ``beginning``, ``end``, and ``after``. This is mutually exclusive with ``beginning``, ``end``, and ``after``.
after: :class:`abc.Snowflake` after: :class:`~discord.abc.Snowflake`
The channel that should be after our current channel. The channel that should be after our current channel.
This is mutually exclusive with ``beginning``, ``end``, and ``before``. This is mutually exclusive with ``beginning``, ``end``, and ``before``.
offset: :class:`int` offset: :class:`int`
@ -793,7 +793,7 @@ class GuildChannel(Protocol):
while a negative number moves it above. Note that this while a negative number moves it above. Note that this
number is relative and computed after the ``beginning``, number is relative and computed after the ``beginning``,
``end``, ``before``, and ``after`` parameters. ``end``, ``before``, and ``after`` parameters.
category: Optional[:class:`abc.Snowflake`] category: Optional[:class:`~discord.abc.Snowflake`]
The category to move this channel under. The category to move this channel under.
If ``None`` is given then it moves it out of the category. If ``None`` is given then it moves it out of the category.
This parameter is ignored if moving a category channel. This parameter is ignored if moving a category channel.

2
discord/embeds.py

@ -528,7 +528,7 @@ class Embed:
@property @property
def fields(self) -> List[_EmbedFieldProxy]: def fields(self) -> List[_EmbedFieldProxy]:
"""Union[List[:class:`EmbedProxy`], :attr:`Empty`]: Returns a :class:`list` of ``EmbedProxy`` denoting the field contents. """List[Union[``EmbedProxy``, :attr:`Empty`]]: Returns a :class:`list` of ``EmbedProxy`` denoting the field contents.
See :meth:`add_field` for possible values you can access. See :meth:`add_field` for possible values you can access.

6
discord/message.py

@ -1263,8 +1263,8 @@ class Message(Hashable):
async def reply(self, content=None, **kwargs): async def reply(self, content=None, **kwargs):
"""|coro| """|coro|
A shortcut method to :meth:`abc.Messageable.send` to reply to the A shortcut method to :meth:`.abc.Messageable.send` to reply to the
:class:`Message`. :class:`.Message`.
.. versionadded:: 1.6 .. versionadded:: 1.6
@ -1280,7 +1280,7 @@ class Message(Hashable):
Returns Returns
--------- ---------
:class:`Message` :class:`.Message`
The message that was sent. The message that was sent.
""" """

5
docs/ext/commands/commands.rst

@ -328,7 +328,7 @@ For example, a common idiom would be to have a class and a converter for that cl
else: else:
await ctx.send("Hm you're not so new.") await ctx.send("Hm you're not so new.")
This can get tedious, so an inline advanced converter is possible through a ``classmethod`` inside the type: This can get tedious, so an inline advanced converter is possible through a :func:`classmethod` inside the type:
.. code-block:: python3 .. code-block:: python3
@ -380,6 +380,7 @@ A lot of discord models work out of the gate as a parameter:
- :class:`PartialMessage` (since v1.7) - :class:`PartialMessage` (since v1.7)
- :class:`TextChannel` - :class:`TextChannel`
- :class:`VoiceChannel` - :class:`VoiceChannel`
- :class:`StageChannel` (since v1.7)
- :class:`StoreChannel` (since v1.7) - :class:`StoreChannel` (since v1.7)
- :class:`CategoryChannel` - :class:`CategoryChannel`
- :class:`Invite` - :class:`Invite`
@ -411,6 +412,8 @@ converter is given below:
+--------------------------+-------------------------------------------------+ +--------------------------+-------------------------------------------------+
| :class:`VoiceChannel` | :class:`~ext.commands.VoiceChannelConverter` | | :class:`VoiceChannel` | :class:`~ext.commands.VoiceChannelConverter` |
+--------------------------+-------------------------------------------------+ +--------------------------+-------------------------------------------------+
| :class:`StageChannel` | :class:`~ext.commands.StageChannelConverter` |
+--------------------------+-------------------------------------------------+
| :class:`StoreChannel` | :class:`~ext.commands.StoreChannelConverter` | | :class:`StoreChannel` | :class:`~ext.commands.StoreChannelConverter` |
+--------------------------+-------------------------------------------------+ +--------------------------+-------------------------------------------------+
| :class:`CategoryChannel` | :class:`~ext.commands.CategoryChannelConverter` | | :class:`CategoryChannel` | :class:`~ext.commands.CategoryChannelConverter` |

4
docs/ext/commands/extensions.rst

@ -27,7 +27,7 @@ An example extension looks like this:
def setup(bot): def setup(bot):
bot.add_command(hello) bot.add_command(hello)
In this example we define a simple command, and when the extension is loaded this command is added to the bot. Now the final step to this is loading the extension, which we do by calling :meth:`.commands.Bot.load_extension`. To load this extension we call ``bot.load_extension('hello')``. In this example we define a simple command, and when the extension is loaded this command is added to the bot. Now the final step to this is loading the extension, which we do by calling :meth:`.Bot.load_extension`. To load this extension we call ``bot.load_extension('hello')``.
.. admonition:: Cogs .. admonition:: Cogs
:class: helpful :class: helpful
@ -41,7 +41,7 @@ In this example we define a simple command, and when the extension is loaded thi
Reloading Reloading
----------- -----------
When you make a change to the extension and want to reload the references, the library comes with a function to do this for you, :meth:`Bot.reload_extension`. When you make a change to the extension and want to reload the references, the library comes with a function to do this for you, :meth:`.Bot.reload_extension`.
.. code-block:: python3 .. code-block:: python3

6
docs/faq.rst

@ -236,7 +236,7 @@ technically in another thread, we must take caution in calling thread-safe opera
us, :mod:`asyncio` comes with a :func:`asyncio.run_coroutine_threadsafe` function that allows us to call us, :mod:`asyncio` comes with a :func:`asyncio.run_coroutine_threadsafe` function that allows us to call
a coroutine from another thread. a coroutine from another thread.
However, this function returns a :class:`concurrent.Future` and to actually call it we have to fetch its result. Putting all of However, this function returns a :class:`~concurrent.futures.Future` and to actually call it we have to fetch its result. Putting all of
this together we can do the following: :: this together we can do the following: ::
def my_after(error): def my_after(error):
@ -297,7 +297,7 @@ How do I make a web request?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To make a request, you should use a non-blocking library. To make a request, you should use a non-blocking library.
This library already uses and requires a 3rd party library for making requests, ``aiohttp``. This library already uses and requires a 3rd party library for making requests, :doc:`aiohttp <aio:index>`.
Quick example: :: Quick example: ::
@ -395,7 +395,7 @@ Example: ::
How do I make a subcommand? How do I make a subcommand?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the ``group`` decorator. This will transform the callback into a ``Group`` which will allow you to add commands into Use the :func:`~ext.commands.group` decorator. This will transform the callback into a :class:`~ext.commands.Group` which will allow you to add commands into
the group operating as "subcommands". These groups can be arbitrarily nested as well. the group operating as "subcommands". These groups can be arbitrarily nested as well.
Example: :: Example: ::

Loading…
Cancel
Save