diff --git a/discord/channel.py b/discord/channel.py index 0790f09a5..c395f82d1 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -153,7 +153,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): *not* point to an existing or valid message. slowmode_delay: :class:`int` The number of seconds a member must wait between sending messages - in this channel. A value of `0` denotes that it is disabled. + in this channel. A value of ``0`` denotes that it is disabled. Bots and users with :attr:`~Permissions.manage_channels` or :attr:`~Permissions.manage_messages` bypass slowmode. nsfw: :class:`bool` @@ -338,7 +338,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): category. slowmode_delay: :class:`int` Specifies the slowmode rate limit for user in this channel, in seconds. - A value of `0` disables slowmode. The maximum value possible is `21600`. + A value of ``0`` disables slowmode. The maximum value possible is ``21600``. type: :class:`ChannelType` Change the type of this text channel. Currently, only conversion between :attr:`ChannelType.text` and :attr:`ChannelType.news` is supported. This @@ -711,7 +711,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): Defaults to ``True``. slowmode_delay: Optional[:class:`int`] Specifies the slowmode rate limit for user in this channel, in seconds. - The maximum value possible is `21600`. By default no slowmode rate limit + The maximum value possible is ``21600``. By default no slowmode rate limit if this is ``None``. Raises @@ -2037,7 +2037,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): It may *not* point to an existing or valid thread or message. slowmode_delay: :class:`int` The number of seconds a member must wait between creating threads - in this forum. A value of `0` denotes that it is disabled. + in this forum. A value of ``0`` denotes that it is disabled. Bots and users with :attr:`~Permissions.manage_channels` or :attr:`~Permissions.manage_messages` bypass slowmode. nsfw: :class:`bool` @@ -2239,7 +2239,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): category. slowmode_delay: :class:`int` Specifies the slowmode rate limit for user in this forum, in seconds. - A value of `0` disables slowmode. The maximum value possible is `21600`. + A value of ``0`` disables slowmode. The maximum value possible is ``21600``. type: :class:`ChannelType` Change the type of this text forum. Currently, only conversion between :attr:`ChannelType.text` and :attr:`ChannelType.news` is supported. This @@ -2404,7 +2404,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): If not provided, the channel's default auto archive duration is used. slowmode_delay: Optional[:class:`int`] Specifies the slowmode rate limit for user in this channel, in seconds. - The maximum value possible is `21600`. By default no slowmode rate limit + The maximum value possible is ``21600``. By default no slowmode rate limit if this is ``None``. content: Optional[:class:`str`] The content of the message to send with the thread. diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index 52bdbc508..4df966b8b 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -155,7 +155,7 @@ class IDConverter(Converter[T_co]): class ObjectConverter(IDConverter[discord.Object]): """Converts to a :class:`~discord.Object`. - The argument must follow the valid ID or mention formats (e.g. `<@80088516616269824>`). + The argument must follow the valid ID or mention formats (e.g. ``<@80088516616269824>``). .. versionadded:: 2.0 diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index a4c4d621f..782d664ba 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -2039,7 +2039,7 @@ def has_role(item: Union[int, str], /) -> Check[Any]: def has_any_role(*items: Union[int, str]) -> Callable[[T], T]: r"""A :func:`.check` that is added that checks if the member invoking the command has **any** of the roles specified. This means that if they have - one out of the three roles specified, then this check will return `True`. + one out of the three roles specified, then this check will return ``True``. Similar to :func:`.has_role`\, the names or IDs passed in must be exact. diff --git a/discord/guild.py b/discord/guild.py index 5a24dd8c0..950fffcb9 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1326,7 +1326,7 @@ class Guild(Hashable): The new channel's topic. slowmode_delay: :class:`int` Specifies the slowmode rate limit for user in this channel, in seconds. - The maximum value possible is `21600`. + The maximum value possible is ``21600``. nsfw: :class:`bool` To mark the channel as NSFW or not. news: :class:`bool` @@ -1639,7 +1639,7 @@ class Guild(Hashable): To mark the channel as NSFW or not. slowmode_delay: :class:`int` Specifies the slowmode rate limit for users in this channel, in seconds. - The maximum possible value is `21600`. + The maximum possible value is ``21600``. reason: Optional[:class:`str`] The reason for creating this channel. Shows up in the audit log. default_auto_archive_duration: :class:`int` @@ -1772,7 +1772,7 @@ class Guild(Hashable): The ``rules_channel`` and ``public_updates_channel`` keyword parameters were added. .. versionchanged:: 2.0 - The ``discovery_splash`` and `community` keyword parameters were added. + The ``discovery_splash`` and ``community`` keyword parameters were added. .. versionchanged:: 2.0 The newly updated guild is returned. @@ -2864,7 +2864,7 @@ class Guild(Hashable): Raises ------- TypeError - `image` was not a :term:`py:bytes-like object`, or ``privacy_level`` + ``image`` was not a :term:`py:bytes-like object`, or ``privacy_level`` was not a :class:`PrivacyLevel`, or ``entity_type`` was not an :class:`EntityType`, ``status`` was not an :class:`EventStatus`, or an argument was provided that was incompatible with the provided diff --git a/discord/invite.py b/discord/invite.py index 4123c7853..702141fb5 100644 --- a/discord/invite.py +++ b/discord/invite.py @@ -309,23 +309,23 @@ class Invite(Hashable): The following table illustrates what methods will obtain the attributes: - +------------------------------------+------------------------------------------------------------+ - | Attribute | Method | - +====================================+============================================================+ - | :attr:`max_age` | :meth:`abc.GuildChannel.invites`\, :meth:`Guild.invites` | - +------------------------------------+------------------------------------------------------------+ - | :attr:`max_uses` | :meth:`abc.GuildChannel.invites`\, :meth:`Guild.invites` | - +------------------------------------+------------------------------------------------------------+ - | :attr:`created_at` | :meth:`abc.GuildChannel.invites`\, :meth:`Guild.invites` | - +------------------------------------+------------------------------------------------------------+ - | :attr:`temporary` | :meth:`abc.GuildChannel.invites`\, :meth:`Guild.invites` | - +------------------------------------+------------------------------------------------------------+ - | :attr:`uses` | :meth:`abc.GuildChannel.invites`\, :meth:`Guild.invites` | - +------------------------------------+------------------------------------------------------------+ - | :attr:`approximate_member_count` | :meth:`Client.fetch_invite` with `with_counts` enabled | - +------------------------------------+------------------------------------------------------------+ - | :attr:`approximate_presence_count` | :meth:`Client.fetch_invite` with `with_counts` enabled | - +------------------------------------+------------------------------------------------------------+ + +------------------------------------+--------------------------------------------------------------+ + | Attribute | Method | + +====================================+==============================================================+ + | :attr:`max_age` | :meth:`abc.GuildChannel.invites`\, :meth:`Guild.invites` | + +------------------------------------+--------------------------------------------------------------+ + | :attr:`max_uses` | :meth:`abc.GuildChannel.invites`\, :meth:`Guild.invites` | + +------------------------------------+--------------------------------------------------------------+ + | :attr:`created_at` | :meth:`abc.GuildChannel.invites`\, :meth:`Guild.invites` | + +------------------------------------+--------------------------------------------------------------+ + | :attr:`temporary` | :meth:`abc.GuildChannel.invites`\, :meth:`Guild.invites` | + +------------------------------------+--------------------------------------------------------------+ + | :attr:`uses` | :meth:`abc.GuildChannel.invites`\, :meth:`Guild.invites` | + +------------------------------------+--------------------------------------------------------------+ + | :attr:`approximate_member_count` | :meth:`Client.fetch_invite` with ``with_counts`` enabled | + +------------------------------------+--------------------------------------------------------------+ + | :attr:`approximate_presence_count` | :meth:`Client.fetch_invite` with ``with_counts`` enabled | + +------------------------------------+--------------------------------------------------------------+ If it's not in the table above then it is available by all methods. @@ -340,7 +340,6 @@ class Invite(Hashable): The type of invite. .. versionadded:: 2.0 - guild: Optional[Union[:class:`Guild`, :class:`Object`, :class:`PartialInviteGuild`]] The guild the invite is for. Can be ``None`` if not a guild invite. revoked: Optional[:class:`bool`] @@ -364,22 +363,19 @@ class Invite(Hashable): This includes idle, dnd, online, and invisible members. Offline members are excluded. expires_at: Optional[:class:`datetime.datetime`] The expiration date of the invite. If the value is ``None`` (unless received through - `Client.fetch_invite` with `with_expiration` disabled), the invite will never expire. + :meth:`Client.fetch_invite` with ``with_expiration`` disabled), the invite will never expire. .. versionadded:: 2.0 - channel: Optional[Union[:class:`abc.GuildChannel`, :class:`GroupChannel`, :class:`Object`, :class:`PartialInviteChannel`]] The channel the invite is for. Can be ``None`` if not a guild invite. target_type: :class:`InviteTarget` The type of target for the voice channel invite. .. versionadded:: 2.0 - target_user: Optional[:class:`User`] The user whose stream to display for this invite, if any. .. versionadded:: 2.0 - target_application: Optional[:class:`PartialApplication`] The embedded application the invite targets, if any. diff --git a/discord/message.py b/discord/message.py index 9d187fdf8..1308cf84e 100644 --- a/discord/message.py +++ b/discord/message.py @@ -1038,7 +1038,7 @@ class PartialMessage(Hashable): If not provided, the channel's default auto archive duration is used. slowmode_delay: Optional[:class:`int`] Specifies the slowmode rate limit for user in this channel, in seconds. - The maximum value possible is `21600`. By default no slowmode rate limit + The maximum value possible is ``21600``. By default no slowmode rate limit if this is ``None``. reason: Optional[:class:`str`] The reason for creating a new thread. Shows up on the audit log. diff --git a/discord/raw_models.py b/discord/raw_models.py index 7f80cbb1f..2dbbb8b4e 100644 --- a/discord/raw_models.py +++ b/discord/raw_models.py @@ -179,7 +179,7 @@ class RawReactionActionEvent(_RawReprMixin): emoji: :class:`PartialEmoji` The custom or unicode emoji being used. member: Optional[:class:`Member`] - The member who added the reaction. Only available if `event_type` is `REACTION_ADD` and the reaction is inside a guild. + The member who added the reaction. Only available if ``event_type`` is ``REACTION_ADD`` and the reaction is inside a guild. .. versionadded:: 1.3 diff --git a/discord/scheduled_event.py b/discord/scheduled_event.py index 51eef2745..0f6911d22 100644 --- a/discord/scheduled_event.py +++ b/discord/scheduled_event.py @@ -358,7 +358,7 @@ class ScheduledEvent(Hashable): Raises ------- TypeError - `image` was not a :term:`py:bytes-like object`, or ``privacy_level`` + ``image`` was not a :term:`py:bytes-like object`, or ``privacy_level`` was not a :class:`PrivacyLevel`, or ``entity_type`` was not an :class:`EntityType`, ``status`` was not an :class:`EventStatus`, or an argument was provided that was incompatible with the scheduled event's diff --git a/discord/threads.py b/discord/threads.py index 573debc04..17e419f82 100644 --- a/discord/threads.py +++ b/discord/threads.py @@ -102,7 +102,7 @@ class Thread(Messageable, Hashable): *not* point to an existing or valid message. slowmode_delay: :class:`int` The number of seconds a member must wait between sending messages - in this thread. A value of `0` denotes that it is disabled. + in this thread. A value of ``0`` denotes that it is disabled. Bots and users with :attr:`~Permissions.manage_channels` or :attr:`~Permissions.manage_messages` bypass slowmode. message_count: :class:`int` diff --git a/discord/widget.py b/discord/widget.py index 34c28acc7..4e63975e3 100644 --- a/discord/widget.py +++ b/discord/widget.py @@ -121,7 +121,7 @@ class WidgetMember(BaseUser): .. describe:: str(x) - Returns the widget member's `name#discriminator`. + Returns the widget member's ``name#discriminator``. Attributes ----------- diff --git a/docs/migrating.rst b/docs/migrating.rst index 42f13ff4b..f2d27d1ed 100644 --- a/docs/migrating.rst +++ b/docs/migrating.rst @@ -1145,7 +1145,7 @@ The following changes have been made: - :meth:`Permissions.stage_moderator` now includes the :attr:`Permissions.manage_channels` permission and the :attr:`Permissions.request_to_speak` permission is no longer included. -- :attr:`File.filename` will no longer be ``None``, in situations where previously this was the case the filename is set to `'untitled'`. +- :attr:`File.filename` will no longer be ``None``, in situations where previously this was the case the filename is set to ``'untitled'``. :meth:`VoiceProtocol.connect` signature changes. -------------------------------------------------- diff --git a/docs/quickstart.rst b/docs/quickstart.rst index eddee857b..f15ec5ef4 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -42,7 +42,7 @@ with the library. There's a lot going on here, so let's walk you through it step by step. -1. The first line just imports the library, if this raises a `ModuleNotFoundError` or `ImportError` +1. The first line just imports the library, if this raises a :exc:`ModuleNotFoundError` or :exc:`ImportError` then head on over to :ref:`installing` section to properly install. 2. Next, we create an instance of a :class:`Client`. This client is our connection to Discord. 3. We then use the :meth:`Client.event` decorator to register an event. This library has many events.