Fix permissions-based docstrings to be more consistent

This commit is contained in:
Steve C
2022-09-17 14:07:39 -04:00
committed by GitHub
parent a53b609e37
commit ce06beeb6c
19 changed files with 104 additions and 155 deletions

View File

@@ -1229,8 +1229,7 @@ class Guild(Hashable):
Creates a :class:`TextChannel` for the guild.
Note that you need the :attr:`~Permissions.manage_channels` permission
to create the channel.
Note that you must have :attr:`~Permissions.manage_channels` to create the channel.
The ``overwrites`` parameter can be used to create a 'secret'
channel upon creation. This parameter expects a :class:`dict` of
@@ -1724,7 +1723,7 @@ class Guild(Hashable):
Edits the guild.
You must have the :attr:`~Permissions.manage_guild` permission to edit the guild.
You must have :attr:`~Permissions.manage_guild` to edit the guild.
.. versionchanged:: 1.4
The ``rules_channel`` and ``public_updates_channel`` keyword parameters were added.
@@ -2144,8 +2143,7 @@ class Guild(Hashable):
Retrieves the :class:`BanEntry` for a user.
You must have the :attr:`~Permissions.ban_members` permission
to get this information.
You must have :attr:`~Permissions.ban_members` to get this information.
Parameters
-----------
@@ -2223,8 +2221,7 @@ class Guild(Hashable):
) -> AsyncIterator[BanEntry]:
"""Retrieves an :term:`asynchronous iterator` of the users that are banned from the guild as a :class:`BanEntry`.
You must have the :attr:`~Permissions.ban_members` permission
to get this information.
You must have :attr:`~Permissions.ban_members` to get this information.
.. versionchanged:: 2.0
Due to a breaking change in Discord's API, this now returns a paginated iterator instead of a list.
@@ -2335,8 +2332,7 @@ class Guild(Hashable):
The inactive members are denoted if they have not logged on in
``days`` number of days and they have no roles.
You must have the :attr:`~Permissions.kick_members` permission
to use this.
You must have :attr:`~Permissions.kick_members` to do this.
To check how many members you would prune without actually pruning,
see the :meth:`estimate_pruned_members` function.
@@ -2399,7 +2395,7 @@ class Guild(Hashable):
Gets the list of templates from this guild.
Requires :attr:`~.Permissions.manage_guild` permissions.
You must have :attr:`~.Permissions.manage_guild` to do this.
.. versionadded:: 1.7
@@ -2423,7 +2419,7 @@ class Guild(Hashable):
Gets the list of webhooks from this guild.
Requires :attr:`~.Permissions.manage_webhooks` permissions.
You must have :attr:`~.Permissions.manage_webhooks` to do this.
Raises
-------
@@ -2496,8 +2492,7 @@ class Guild(Hashable):
Returns a list of all active instant invites from the guild.
You must have the :attr:`~Permissions.manage_guild` permission to get
this information.
You must have :attr:`~Permissions.manage_guild` to get this information.
Raises
-------
@@ -2525,8 +2520,7 @@ class Guild(Hashable):
Creates a template for the guild.
You must have the :attr:`~Permissions.manage_guild` permission to
do this.
You must have :attr:`~Permissions.manage_guild` to do this.
.. versionadded:: 1.7
@@ -2553,8 +2547,7 @@ class Guild(Hashable):
Attaches an integration to the guild.
You must have the :attr:`~Permissions.manage_guild` permission to
do this.
You must have :attr:`~Permissions.manage_guild` to do this.
.. versionadded:: 1.4
@@ -2579,8 +2572,7 @@ class Guild(Hashable):
Returns a list of all integrations attached to the guild.
You must have the :attr:`~Permissions.manage_guild` permission to
do this.
You must have :attr:`~Permissions.manage_guild` to do this.
.. versionadded:: 1.4
@@ -2675,8 +2667,7 @@ class Guild(Hashable):
Creates a :class:`Sticker` for the guild.
You must have :attr:`~Permissions.manage_emojis_and_stickers` permission to
do this.
You must have :attr:`~Permissions.manage_emojis_and_stickers` to do this.
.. versionadded:: 2.0
@@ -2728,8 +2719,7 @@ class Guild(Hashable):
Deletes the custom :class:`Sticker` from the guild.
You must have :attr:`~Permissions.manage_emojis_and_stickers` permission to
do this.
You must have :attr:`~Permissions.manage_emojis_and_stickers` to do this.
.. versionadded:: 2.0
@@ -2823,7 +2813,7 @@ class Guild(Hashable):
Creates a scheduled event for the guild.
Requires :attr:`~Permissions.manage_events` permissions.
You must have :attr:`~Permissions.manage_events` to do this.
.. versionadded:: 2.0
@@ -3025,8 +3015,7 @@ class Guild(Hashable):
There is currently a limit of 50 static and animated emojis respectively per guild,
unless the guild has the ``MORE_EMOJI`` feature which extends the limit to 200.
You must have the :attr:`~Permissions.manage_emojis` permission to
do this.
You must have :attr:`~Permissions.manage_emojis` to do this.
Parameters
-----------
@@ -3067,8 +3056,7 @@ class Guild(Hashable):
Deletes the custom :class:`Emoji` from the guild.
You must have :attr:`~Permissions.manage_emojis` permission to
do this.
You must have :attr:`~Permissions.manage_emojis` to do this.
.. versionchanged:: 2.0
@@ -3161,8 +3149,7 @@ class Guild(Hashable):
All fields are optional.
You must have the :attr:`~Permissions.manage_roles` permission to
do this.
You must have :attr:`~Permissions.manage_roles` to do this.
.. versionchanged:: 1.6
Can now pass ``int`` to ``colour`` keyword-only parameter.
@@ -3249,8 +3236,7 @@ class Guild(Hashable):
Bulk edits a list of :class:`Role` in the guild.
You must have the :attr:`~Permissions.manage_roles` permission to
do this.
You must have :attr:`~Permissions.manage_roles` to do this.
.. versionadded:: 1.4
@@ -3319,8 +3305,7 @@ class Guild(Hashable):
The guild must have ``COMMUNITY`` in :attr:`~Guild.features`.
You must have the :attr:`~Permissions.manage_guild` permission to use
this as well.
You must have :attr:`~Permissions.manage_guild` to do this.as well.
.. versionadded:: 2.0
@@ -3354,8 +3339,7 @@ class Guild(Hashable):
The guild must have ``COMMUNITY`` in :attr:`~Guild.features`.
You must have the :attr:`~Permissions.manage_guild` permission to use
this as well.
You must have :attr:`~Permissions.manage_guild` to do this.as well.
.. versionadded:: 2.0
@@ -3390,8 +3374,7 @@ class Guild(Hashable):
The user must meet the :class:`abc.Snowflake` abc.
You must have the :attr:`~Permissions.kick_members` permission to
do this.
You must have :attr:`~Permissions.kick_members` to do this.
Parameters
-----------
@@ -3423,8 +3406,7 @@ class Guild(Hashable):
The user must meet the :class:`abc.Snowflake` abc.
You must have the :attr:`~Permissions.ban_members` permission to
do this.
You must have :attr:`~Permissions.ban_members` to do this.
Parameters
-----------
@@ -3474,8 +3456,7 @@ class Guild(Hashable):
The user must meet the :class:`abc.Snowflake` abc.
You must have the :attr:`~Permissions.ban_members` permission to
do this.
You must have :attr:`~Permissions.ban_members` to do this.
Parameters
-----------
@@ -3512,8 +3493,7 @@ class Guild(Hashable):
The guild must have ``VANITY_URL`` in :attr:`~Guild.features`.
You must have the :attr:`~Permissions.manage_guild` permission to use
this as well.
You must have :attr:`~Permissions.manage_guild` to do this.as well.
Raises
-------
@@ -3558,7 +3538,7 @@ class Guild(Hashable):
) -> AsyncIterator[AuditLogEntry]:
"""Returns an :term:`asynchronous iterator` that enables receiving the guild's audit logs.
You must have the :attr:`~Permissions.view_audit_log` permission to use this.
You must have :attr:`~Permissions.view_audit_log` to do this.
Examples
----------
@@ -3756,8 +3736,7 @@ class Guild(Hashable):
Edits the widget of the guild.
You must have the :attr:`~Permissions.manage_guild` permission to
use this
You must have :attr:`~Permissions.manage_guild` to do this.
.. versionadded:: 2.0
@@ -3921,7 +3900,7 @@ class Guild(Hashable):
Fetches an active automod rule from the guild.
You must have the :attr:`Permissions.manage_guild` to use this.
You must have :attr:`Permissions.manage_guild` to do this.
.. versionadded:: 2.0
@@ -3950,7 +3929,7 @@ class Guild(Hashable):
Fetches all automod rules from the guild.
You must have the :attr:`Permissions.manage_guild` to use this.
You must have :attr:`Permissions.manage_guild` to do this.
.. versionadded:: 2.0
@@ -3986,7 +3965,7 @@ class Guild(Hashable):
Create an automod rule.
You must have the :attr:`Permissions.manage_guild` permission to use this.
You must have :attr:`Permissions.manage_guild` to do this.
.. versionadded:: 2.0