From a374276310264ff0f5da3a2701ed74e941784718 Mon Sep 17 00:00:00 2001 From: Soheab <33902984+Soheab@users.noreply.github.com> Date: Wed, 14 Jan 2026 20:10:39 +0100 Subject: [PATCH] Better docs --- discord/abc.py | 5 +++-- discord/invite.py | 15 +++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index 54309ab85..7a2e17c25 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -1330,11 +1330,12 @@ class GuildChannel: roles: Optional[List[:class:`~discord.abc.Snowflake`]] A list of roles that should be granted to the users joining via this invite. - Requires :attr:`~discord.Permissions.manage_guild` permission. + Requires :attr:`~discord.Permissions.manage_guild` permission and cannot + assign roles with higher permissions than the bot. .. versionadded:: 2.7 users: Optional[List[:class:`~discord.abc.Snowflake`]] - A list of user IDs that should be able to access this invite. + A list of users that are allowed to join via this invite. Requires :attr:`~discord.Permissions.manage_guild` permission. diff --git a/discord/invite.py b/discord/invite.py index 60906f0a7..72280659a 100644 --- a/discord/invite.py +++ b/discord/invite.py @@ -408,8 +408,11 @@ class Invite(Hashable): .. versionadded:: 2.0 roles: List[:class:`Role`] - A list of roles the invite grants access to. Only available if the - invite's guild is cached. + A list of roles that are granted to users joining via this invite. + + This is only filled if the bot is in the guild where the invite belongs. + + .. versionadded:: 2.7 """ __slots__ = ( @@ -646,14 +649,14 @@ class Invite(Hashable): async def fetch_target_users(self) -> list[int]: """|coro| - Fetches the target users CSV file for this invite. + Fetches the users that are allowed to join via this invite. Requires the :attr:`~Permissions.manage_guild` permission. Returns -------- List[:class:`int`] - A list of user IDs representing the target users. + A list of user IDs. Raises ------- @@ -678,8 +681,8 @@ class Invite(Hashable): Returns -------- - :class:`InviteTargetUsersJobStatus` - A dictionary containing the status of the target users job. + :class:`InviteTargetUsersJobErrorStatus` + The status of the target users job. Raises -------