Skip to content

Invite

Implementation of discords Invite object as a Luau builder.

https://discord.com/developers/docs/resources/channel#create-channel-invite-json-params

Invite.maxAge  :: number?

Duration in seconds after which the invite expires. Must be between 0 and 604800 seconds.

Invite.maxUses  :: number?

Maximum number of times this invite can be used. Must be between 0 and 100.

Invite.temporary  :: boolean?

Whether the invite grants temporary membership. Members are removed on disconnect unless granted a role.

Invite.unique  :: boolean?

Whether this invite should be unique. If true, don’t try to reuse a similar invite.

Invite.targetType  :: InviteTargetType?

The type of target for this invite. Used for stream and embedded application invites.

Invite.targetUserId  :: string?

The target user ID for this invite. Used to specify which user’s stream to display.

Invite.targetApplicationId  :: string?

The target application ID for this invite. Used to specify which embedded application to open.

Invite : setMaxAge ( age )  -> Invite

Sets the duration in seconds after which the invite expires. Age must be between 0 and 604800 seconds.

Parameters

age: number

Returns

Invite
Invite : setMaxUses ( uses )  -> Invite

Sets the maximum number of times this invite can be used. Uses must be between 0 and 100.

Parameters

uses: number

Returns

Invite
Invite : setTemporary ( isTemporary )  -> Invite

Sets whether the invite grants temporary membership. Temporary members are removed when they disconnect unless granted a role.

Parameters

isTemporary: boolean

Returns

Invite
Invite : setIsUnique ( isUnique )  -> Invite

Sets whether this invite should be unique. If true, don’t try to reuse a similar invite.

Parameters

isUnique: boolean

Returns

Invite
Invite : setTargetType ( targetType )  -> Invite

Sets the type of target for this invite. Used for stream and embedded application invites.

Parameters

targetType: InviteTargetType

Returns

Invite
Invite : setTargetUser ( userId )  -> Invite

Sets the target user ID for this invite. Used to specify which user’s stream to display for stream invites.

Parameters

userId: string

Returns

Invite
Invite : setTargetApplication ( applicationId )  -> Invite

Sets the target application ID for this invite. Used to specify which embedded application to open.

Parameters

applicationId: string

Returns

Invite
Invite : build ( )  -> JSON

Responsible for buillding the invite object that the Discord API can understand.

Returns

JSON
Invite . new ( resource )  -> Invite

Responsible for creating a new Invite.

Parameters

resource: {
maxAge: number?,
maxUses: number?,
temporary: boolean?,
unique: boolean?,
targetType: apiTypes.InviteTargetType?,
targetUserId: string?,
targetApplicationId: string?,
}

Returns

Invite