aboutsummaryrefslogtreecommitdiff
path: root/discord/client.py
diff options
context:
space:
mode:
authorChrovo <[email protected]>2021-08-26 20:47:24 -0400
committerGitHub <[email protected]>2021-08-26 20:47:24 -0400
commit932efa1edc4d05bf42c7fd7cb8844bcb27e4742c (patch)
tree0d2f7930ea93c28f76e0553cc57e92716b9824ef /discord/client.py
parentFix Webhook return types (diff)
downloaddiscord.py-932efa1edc4d05bf42c7fd7cb8844bcb27e4742c.tar.xz
discord.py-932efa1edc4d05bf42c7fd7cb8844bcb27e4742c.zip
Change a few parameters to be positional only
This makes parameters positional only in the methods fetch_sticker, fetch_webhook, fetch_channel, fetch_user, fetch_widget, fetch_stage_instance, fetch_guild, get_sticker, and get_channel.
Diffstat (limited to 'discord/client.py')
-rw-r--r--discord/client.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/discord/client.py b/discord/client.py
index a9988f18..678586e1 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -738,7 +738,7 @@ class Client:
"""List[:class:`~discord.User`]: Returns a list of all the users the bot can see."""
return list(self._connection._users.values())
- def get_channel(self, id: int) -> Optional[Union[GuildChannel, Thread, PrivateChannel]]:
+ def get_channel(self, id: int, /) -> Optional[Union[GuildChannel, Thread, PrivateChannel]]:
"""Returns a channel or thread with the given ID.
Parameters
@@ -842,7 +842,7 @@ class Client:
"""
return self._connection.get_emoji(id)
- def get_sticker(self, id: int) -> Optional[GuildSticker]:
+ def get_sticker(self, id: int, /) -> Optional[GuildSticker]:
"""Returns a guild sticker with the given ID.
.. versionadded:: 2.0
@@ -1191,7 +1191,7 @@ class Client:
data = await self.http.get_template(code)
return Template(data=data, state=self._connection) # type: ignore
- async def fetch_guild(self, guild_id: int) -> Guild:
+ async def fetch_guild(self, guild_id: int, /) -> Guild:
"""|coro|
Retrieves a :class:`.Guild` from an ID.
@@ -1280,7 +1280,7 @@ class Client:
data = await self.http.create_guild(name, region_value, icon_base64)
return Guild(data=data, state=self._connection)
- async def fetch_stage_instance(self, channel_id: int) -> StageInstance:
+ async def fetch_stage_instance(self, channel_id: int, /) -> StageInstance:
"""|coro|
Gets a :class:`.StageInstance` for a stage channel id.
@@ -1380,7 +1380,7 @@ class Client:
# Miscellaneous stuff
- async def fetch_widget(self, guild_id: int) -> Widget:
+ async def fetch_widget(self, guild_id: int, /) -> Widget:
"""|coro|
Gets a :class:`.Widget` from a guild ID.
@@ -1430,7 +1430,7 @@ class Client:
data['rpc_origins'] = None
return AppInfo(self._connection, data)
- async def fetch_user(self, user_id: int) -> User:
+ async def fetch_user(self, user_id: int, /) -> User:
"""|coro|
Retrieves a :class:`~discord.User` based on their ID.
@@ -1461,7 +1461,7 @@ class Client:
data = await self.http.get_user(user_id)
return User(state=self._connection, data=data)
- async def fetch_channel(self, channel_id: int) -> Union[GuildChannel, PrivateChannel, Thread]:
+ async def fetch_channel(self, channel_id: int, /) -> Union[GuildChannel, PrivateChannel, Thread]:
"""|coro|
Retrieves a :class:`.abc.GuildChannel`, :class:`.abc.PrivateChannel`, or :class:`.Thread` with the specified ID.
@@ -1506,7 +1506,7 @@ class Client:
return channel
- async def fetch_webhook(self, webhook_id: int) -> Webhook:
+ async def fetch_webhook(self, webhook_id: int, /) -> Webhook:
"""|coro|
Retrieves a :class:`.Webhook` with the specified ID.
@@ -1528,7 +1528,7 @@ class Client:
data = await self.http.get_webhook(webhook_id)
return Webhook.from_state(data, state=self._connection)
- async def fetch_sticker(self, sticker_id: int) -> Union[StandardSticker, GuildSticker]:
+ async def fetch_sticker(self, sticker_id: int, /) -> Union[StandardSticker, GuildSticker]:
"""|coro|
Retrieves a :class:`.Sticker` with the specified ID.