#[non_exhaustive]pub struct CreateChannelInvite {
pub max_age: Option<u32>,
pub max_uses: Option<u8>,
pub temporary: bool,
pub unique: bool,
pub target_type: Option<InviteTargetType>,
pub target_user_id: Option<UserId>,
pub target_application_id: Option<ApplicationId>,
pub target_user_ids: Vec<UserId>,
pub role_ids: Vec<RoleId>,
pub target_users_file: Option<FileUpload>,
}Expand description
The body of Create Channel Invite.
Every field is optional. The users who can accept the invite are given either as
target_user_ids or, for more than 1000 users, as a CSV
target_users_file with one user ID per line (D-111).
discord.js counterpart: InviteCreateOptions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_age: Option<u32>Seconds until the invite expires (0-604800, 0 = never; Discord’s default: 86400).
max_uses: Option<u8>How many times the invite can be used (0-100, 0 = unlimited, the default).
temporary: boolWhether the invite only grants temporary membership.
unique: boolWhether to always create a new invite instead of reusing a similar one.
target_type: Option<InviteTargetType>What a voice channel invite opens.
target_user_id: Option<UserId>The streaming user whose stream the invite shows (for
InviteTargetType::Stream).
target_application_id: Option<ApplicationId>The embedded application the invite opens (for
InviteTargetType::EmbeddedApplication).
target_user_ids: Vec<UserId>The only users who can see and accept the invite (max 1000).
role_ids: Vec<RoleId>The roles given to users who accept the invite (needs MANAGE_ROLES).
target_users_file: Option<FileUpload>A CSV file of the only users who can accept the invite, instead of
target_user_ids; sent as multipart/form-data. Build it with
FileUpload::target_users (D-127).