Add positional-only arguments in more places

This commit is contained in:
jack1142
2022-02-20 02:28:01 +01:00
committed by GitHub
parent 19b10eecfe
commit dc19c6c7d5
14 changed files with 202 additions and 23 deletions

View File

@@ -639,6 +639,10 @@ class Guild(Hashable):
This does *not* search for threads.
.. versionchanged:: 2.0
``channel_id`` parameter is now positional-only.
Parameters
-----------
channel_id: :class:`int`
@@ -741,6 +745,10 @@ class Guild(Hashable):
def get_member(self, user_id: int, /) -> Optional[Member]:
"""Returns a member with the given ID.
.. versionchanged:: 2.0
``user_id`` parameter is now positional-only.
Parameters
-----------
user_id: :class:`int`
@@ -770,6 +778,10 @@ class Guild(Hashable):
def get_role(self, role_id: int, /) -> Optional[Role]:
"""Returns a role with the given ID.
.. versionchanged:: 2.0
``role_id`` parameter is now positional-only.
Parameters
-----------
role_id: :class:`int`
@@ -926,6 +938,10 @@ class Guild(Hashable):
If no member is found, ``None`` is returned.
.. versionchanged:: 2.0
``name`` parameter is now positional-only.
Parameters
-----------
name: :class:`str`
@@ -1696,6 +1712,10 @@ class Guild(Hashable):
This method is an API call. If you have :attr:`Intents.members` and member cache enabled, consider :meth:`get_member` instead.
.. versionchanged:: 2.0
``member_id`` parameter is now positional-only.
Parameters
-----------
member_id: :class:`int`
@@ -2208,7 +2228,7 @@ class Guild(Hashable):
data = await self._state.http.create_guild_sticker(self.id, payload, file, reason)
return self._state.store_sticker(self, data)
async def delete_sticker(self, sticker: Snowflake, *, reason: Optional[str] = None) -> None:
async def delete_sticker(self, sticker: Snowflake, /, *, reason: Optional[str] = None) -> None:
"""|coro|
Deletes the custom :class:`Sticker` from the guild.
@@ -2266,6 +2286,10 @@ class Guild(Hashable):
This method is an API call.
For general usage, consider iterating over :attr:`emojis` instead.
.. versionchanged:: 2.0
``emoji_id`` parameter is now positional-only.
Parameters
-------------
emoji_id: :class:`int`
@@ -2338,7 +2362,7 @@ class Guild(Hashable):
data = await self._state.http.create_custom_emoji(self.id, name, img, roles=role_ids, reason=reason)
return self._state.store_emoji(self, data)
async def delete_emoji(self, emoji: Snowflake, *, reason: Optional[str] = None) -> None:
async def delete_emoji(self, emoji: Snowflake, /, *, reason: Optional[str] = None) -> None:
"""|coro|
Deletes the custom :class:`Emoji` from the guild.
@@ -2346,6 +2370,10 @@ class Guild(Hashable):
You must have :attr:`~Permissions.manage_emojis` permission to
do this.
.. versionchanged:: 2.0
``emoji`` parameter is now positional-only.
Parameters
-----------
emoji: :class:`abc.Snowflake`