Invite¶
discord_http.invite module¶
- class discord_http.invite.Invite(*, state, data)¶
Bases:
PartialInviteRepresents an invite object.
- Parameters:
state (DiscordAPI)
data (dict)
- async add_target_user(user) None¶
Add a single user to the list of users allowed to use this invite.
- async bulk_add_target_users(user_ids) None¶
Add multiple users to the list of users allowed to use this invite.
- Parameters:
user_ids (
list[Snowflake|int]) – The user IDs to allow to use this invite, max 1000- Raises:
ValueError – More than 1000 user IDs were provided
- Return type:
- async bulk_remove_target_users(user_ids) None¶
Remove multiple users from the list of users allowed to use this invite.
- Parameters:
user_ids (
list[Snowflake|int]) – The user IDs to remove from this invite, max 1000- Raises:
ValueError – More than 1000 user IDs were provided
- Return type:
- property channel: PartialChannel | None¶
The channel the invite is in.
- async fetch_target_users() list[PartialUser]¶
Fetch the list of users allowed to use this invite.
- Return type:
- async fetch_target_users_job_status() InviteTargetUsersJobStatus¶
Fetch the status of the target users file processing job.
- Return type:
- async remove_target_user(user) None¶
Remove a single user from the list of users allowed to use this invite.
- target_type: InviteTargetType | None¶
The target type of the invite, if applicable.
- property guild: Guild | PartialGuild | None¶
The guild associated with the invite, if applicable. Resolved live from cache.
- property type: InviteType¶
The type of the invite.
- property flags: GuildInviteFlags¶
The flags associated with the invite.
- class discord_http.invite.InviteTargetUsersJobStatus(status, total_users, processed_users, created_at, completed_at, error_message)¶
Bases:
NamedTupleRepresents the status of an invite’s target users file processing job.
- Parameters:
- status: InviteTargetUsersJobStatusType¶
Alias for field number 0
- count(value, /)¶
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.
- class discord_http.invite.PartialInvite(*, state, code, channel_id=None, guild_id=None)¶
Bases:
objectRepresents a partial invite object.
- Parameters:
state (DiscordAPI)
code (str)
channel_id (int | None)
guild_id (int | None)
- property guild: Guild | PartialGuild | None¶
The guild associated with the invite, if applicable. Resolved live from cache.
- property channel: PartialChannel | None¶
The channel the invite is in.
- async fetch_target_users() list[PartialUser]¶
Fetch the list of users allowed to use this invite.
- Return type:
- async add_target_user(user) None¶
Add a single user to the list of users allowed to use this invite.
- async remove_target_user(user) None¶
Remove a single user from the list of users allowed to use this invite.
- async bulk_add_target_users(user_ids) None¶
Add multiple users to the list of users allowed to use this invite.
- Parameters:
user_ids (
list[Snowflake|int]) – The user IDs to allow to use this invite, max 1000- Raises:
ValueError – More than 1000 user IDs were provided
- Return type:
- async bulk_remove_target_users(user_ids) None¶
Remove multiple users from the list of users allowed to use this invite.
- Parameters:
user_ids (
list[Snowflake|int]) – The user IDs to remove from this invite, max 1000- Raises:
ValueError – More than 1000 user IDs were provided
- Return type:
- async fetch_target_users_job_status() InviteTargetUsersJobStatus¶
Fetch the status of the target users file processing job.
- Return type: