|
@ -741,6 +741,10 @@ class Client: |
|
|
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. |
|
|
"""Returns a channel or thread with the given ID. |
|
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
|
|
|
|
|
|
|
|
``id`` parameter is now positional-only. |
|
|
|
|
|
|
|
|
Parameters |
|
|
Parameters |
|
|
----------- |
|
|
----------- |
|
|
id: :class:`int` |
|
|
id: :class:`int` |
|
@ -800,6 +804,10 @@ class Client: |
|
|
def get_guild(self, id: int, /) -> Optional[Guild]: |
|
|
def get_guild(self, id: int, /) -> Optional[Guild]: |
|
|
"""Returns a guild with the given ID. |
|
|
"""Returns a guild with the given ID. |
|
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
|
|
|
|
|
|
|
|
``id`` parameter is now positional-only. |
|
|
|
|
|
|
|
|
Parameters |
|
|
Parameters |
|
|
----------- |
|
|
----------- |
|
|
id: :class:`int` |
|
|
id: :class:`int` |
|
@ -815,6 +823,10 @@ class Client: |
|
|
def get_user(self, id: int, /) -> Optional[User]: |
|
|
def get_user(self, id: int, /) -> Optional[User]: |
|
|
"""Returns a user with the given ID. |
|
|
"""Returns a user with the given ID. |
|
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
|
|
|
|
|
|
|
|
``id`` parameter is now positional-only. |
|
|
|
|
|
|
|
|
Parameters |
|
|
Parameters |
|
|
----------- |
|
|
----------- |
|
|
id: :class:`int` |
|
|
id: :class:`int` |
|
@ -830,6 +842,10 @@ class Client: |
|
|
def get_emoji(self, id: int, /) -> Optional[Emoji]: |
|
|
def get_emoji(self, id: int, /) -> Optional[Emoji]: |
|
|
"""Returns an emoji with the given ID. |
|
|
"""Returns an emoji with the given ID. |
|
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
|
|
|
|
|
|
|
|
``id`` parameter is now positional-only. |
|
|
|
|
|
|
|
|
Parameters |
|
|
Parameters |
|
|
----------- |
|
|
----------- |
|
|
id: :class:`int` |
|
|
id: :class:`int` |
|
@ -1205,6 +1221,10 @@ class Client: |
|
|
|
|
|
|
|
|
This method is an API call. For general usage, consider :meth:`get_guild` instead. |
|
|
This method is an API call. For general usage, consider :meth:`get_guild` instead. |
|
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
|
|
|
|
|
|
|
|
``guild_id`` parameter is now positional-only. |
|
|
|
|
|
|
|
|
Parameters |
|
|
Parameters |
|
|
----------- |
|
|
----------- |
|
|
guild_id: :class:`int` |
|
|
guild_id: :class:`int` |
|
@ -1239,6 +1259,10 @@ class Client: |
|
|
|
|
|
|
|
|
Bot accounts in more than 10 guilds are not allowed to create guilds. |
|
|
Bot accounts in more than 10 guilds are not allowed to create guilds. |
|
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
|
|
|
|
|
|
|
|
``name`` and ``region``, and ``icon`` parameters are now keyword-only. |
|
|
|
|
|
|
|
|
Parameters |
|
|
Parameters |
|
|
---------- |
|
|
---------- |
|
|
name: :class:`str` |
|
|
name: :class:`str` |
|
@ -1352,7 +1376,7 @@ class Client: |
|
|
data = await self.http.get_invite(invite_id, with_counts=with_counts, with_expiration=with_expiration) |
|
|
data = await self.http.get_invite(invite_id, with_counts=with_counts, with_expiration=with_expiration) |
|
|
return Invite.from_incomplete(state=self._connection, data=data) |
|
|
return Invite.from_incomplete(state=self._connection, data=data) |
|
|
|
|
|
|
|
|
async def delete_invite(self, invite: Union[Invite, str]) -> None: |
|
|
async def delete_invite(self, invite: Union[Invite, str], /) -> None: |
|
|
"""|coro| |
|
|
"""|coro| |
|
|
|
|
|
|
|
|
Revokes an :class:`.Invite`, URL, or ID to an invite. |
|
|
Revokes an :class:`.Invite`, URL, or ID to an invite. |
|
@ -1360,6 +1384,10 @@ class Client: |
|
|
You must have the :attr:`~.Permissions.manage_channels` permission in |
|
|
You must have the :attr:`~.Permissions.manage_channels` permission in |
|
|
the associated guild to do this. |
|
|
the associated guild to do this. |
|
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
|
|
|
|
|
|
|
|
``invite`` parameter is now positional-only. |
|
|
|
|
|
|
|
|
Parameters |
|
|
Parameters |
|
|
---------- |
|
|
---------- |
|
|
invite: Union[:class:`.Invite`, :class:`str`] |
|
|
invite: Union[:class:`.Invite`, :class:`str`] |
|
@ -1389,6 +1417,10 @@ class Client: |
|
|
|
|
|
|
|
|
The guild must have the widget enabled to get this information. |
|
|
The guild must have the widget enabled to get this information. |
|
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
|
|
|
|
|
|
|
|
``guild_id`` parameter is now positional-only. |
|
|
|
|
|
|
|
|
Parameters |
|
|
Parameters |
|
|
----------- |
|
|
----------- |
|
|
guild_id: :class:`int` |
|
|
guild_id: :class:`int` |
|
@ -1441,6 +1473,10 @@ class Client: |
|
|
|
|
|
|
|
|
This method is an API call. If you have :attr:`discord.Intents.members` and member cache enabled, consider :meth:`get_user` instead. |
|
|
This method is an API call. If you have :attr:`discord.Intents.members` and member cache enabled, consider :meth:`get_user` instead. |
|
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
|
|
|
|
|
|
|
|
``user_id`` parameter is now positional-only. |
|
|
|
|
|
|
|
|
Parameters |
|
|
Parameters |
|
|
----------- |
|
|
----------- |
|
|
user_id: :class:`int` |
|
|
user_id: :class:`int` |
|
@ -1472,6 +1508,10 @@ class Client: |
|
|
|
|
|
|
|
|
.. versionadded:: 1.2 |
|
|
.. versionadded:: 1.2 |
|
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
|
|
|
|
|
|
|
|
``channel_id`` parameter is now positional-only. |
|
|
|
|
|
|
|
|
Raises |
|
|
Raises |
|
|
------- |
|
|
------- |
|
|
:exc:`.InvalidData` |
|
|
:exc:`.InvalidData` |
|
@ -1511,6 +1551,10 @@ class Client: |
|
|
|
|
|
|
|
|
Retrieves a :class:`.Webhook` with the specified ID. |
|
|
Retrieves a :class:`.Webhook` with the specified ID. |
|
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
|
|
|
|
|
|
|
|
``webhook_id`` parameter is now positional-only. |
|
|
|
|
|
|
|
|
Raises |
|
|
Raises |
|
|
-------- |
|
|
-------- |
|
|
:exc:`.HTTPException` |
|
|
:exc:`.HTTPException` |
|
|