Invite
Implementation of discords Invite object as a Luau builder.
https://discord.com/developers/docs/resources/channel#create-channel-invite-json-params
Summary
Properties
Invite.maxAge :: number?Invite.maxUses :: number?Invite.temporary :: boolean?Invite.unique :: boolean?Invite.targetType :: api_types.InviteTargetType?Invite.targetUserId :: string?Invite.targetApplicationId :: string?Methods
Invite:setMaxAge(age: number) → InviteInvite:setMaxUses(uses: number) → InviteInvite:setTemporary(isTemporary: boolean) → InviteInvite:setIsUnique(isUnique: boolean) → InviteInvite:setTargetType(targetType: apiTypes.InviteTargetType) → InviteInvite:setTargetUser(userId: string) → InviteInvite:setTargetApplication(applicationId: string) → InviteInvite:build() → JSONProperties
Section titled “Properties”maxAge
Section titled “maxAge”Duration in seconds after which the invite expires. Must be between 0 and 604800 seconds.
maxUses
Section titled “maxUses”Maximum number of times this invite can be used. Must be between 0 and 100.
temporary
Section titled “temporary”Whether the invite grants temporary membership. Members are removed on disconnect unless granted a role.
unique
Section titled “unique”Whether this invite should be unique. If true, don’t try to reuse a similar invite.
targetType
Section titled “targetType”The type of target for this invite. Used for stream and embedded application invites.
targetUserId
Section titled “targetUserId”The target user ID for this invite. Used to specify which user’s stream to display.
targetApplicationId
Section titled “targetApplicationId”The target application ID for this invite. Used to specify which embedded application to open.
Methods
Section titled “Methods”setMaxAge
Section titled “setMaxAge”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 |
setMaxUses
Section titled “setMaxUses”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 |
setTemporary
Section titled “setTemporary”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 |
setIsUnique
Section titled “setIsUnique”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 |
setTargetType
Section titled “setTargetType”Invite : setTargetType ( targetType ) -> Invite
Sets the type of target for this invite. Used for stream and embedded application invites.
Parameters
| targetType: InviteTargetType |
Returns
| Invite |
setTargetUser
Section titled “setTargetUser”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 |
setTargetApplication
Section titled “setTargetApplication”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 |
Functions
Section titled “Functions”Invite . new ( resource ) -> Invite
Responsible for creating a new Invite.