LogoAntiRaid

@discord-types/builders/invite

API reference for @discord-types/builders/invite

@discord-types/builders/invite

Types

Invite

Raw Type
type Invite = Invite.Prototype, & {
	maxAge: number?,

	maxUses: number?,

	temporary: boolean?,

	unique: boolean?,

	targetType: guildTypes.InviteTargetType?,

	targetUserId: string?,

	targetApplicationId: string?
}

Intersection with variants:

Variant 2
PropTypeDescription
maxAge?
-
maxUses?
-
temporary?
-
unique?
-
targetType?
-
targetUserId?
-
targetApplicationId?
-

JSON

Raw Type
type JSON = Invite.Prototype.build(nil :: any),

Functions

Invite.Prototype.setMaxAge

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

Function Signature
--[[
	Sets the duration in seconds after which the invite expires.
	Age must be between 0 and 604800 seconds.
]]
function Invite.Prototype.setMaxAge(self: Invite, age: number) -> Invite end

Arguments

age

number

Returns

ret1

Invite

Invite.Prototype.setMaxUses

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

Function Signature
--[[
	Sets the maximum number of times this invite can be used.
	Uses must be between 0 and 100.
]]
function Invite.Prototype.setMaxUses(self: Invite, uses: number) -> Invite end

Arguments

uses

number

Returns

ret1

Invite

Invite.Prototype.setTemporary

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

Function Signature
--[[
	Sets whether the invite grants temporary membership.
	Temporary members are removed when they disconnect unless granted a role.
]]
function Invite.Prototype.setTemporary(self: Invite, isTemporary: boolean) -> Invite end

Arguments

isTemporary

boolean

Returns

ret1

Invite

Invite.Prototype.setIsUnique

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

Function Signature
--[[
	Sets whether this invite should be unique.
	If true, don't try to reuse a similar invite.
]]
function Invite.Prototype.setIsUnique(self: Invite, isUnique: boolean) -> Invite end

Arguments

isUnique

boolean

Returns

ret1

Invite

Invite.Prototype.setTargetType

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

Function Signature
--[[
	Sets the type of target for this invite.
	Used for stream and embedded application invites.
]]
function Invite.Prototype.setTargetType(self: Invite, targetType: guildTypes.InviteTargetType) -> Invite end

Arguments

targetType

guildTypes.InviteTargetType

Returns

ret1

Invite

Invite.Prototype.setTargetUser

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

Function Signature
--[[
	Sets the target user ID for this invite.
	Used to specify which user's stream to display for stream invites.
]]
function Invite.Prototype.setTargetUser(self: Invite, userId: string) -> Invite end

Arguments

userId

string

Returns

ret1

Invite

Invite.Prototype.setTargetApplication

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

Function Signature
--[[
	Sets the target application ID for this invite.
	Used to specify which embedded application to open.
]]
function Invite.Prototype.setTargetApplication(self: Invite, applicationId: string) -> Invite end

Arguments

applicationId

string

Returns

ret1

Invite

Invite.Prototype.build

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

Function Signature
--[[
	Responsible for buillding the invite object that the Discord API can understand.
]]
function Invite.Prototype.build(self: Invite) -> JSON end

Returns

ret1

JSON

Invite.Interface.new

[[ Responsible for creating a new Invite.

```lua

``` ]]

Function Signature
--[[
	Responsible for creating a new Invite.

	\`\`\`lua
	
	\`\`\`
]]
function Invite.Interface.new(resource: {
		maxAge: number?,

		maxUses: number?,

		temporary: boolean?,

		unique: boolean?,

		targetType: guildTypes.InviteTargetType?,

		targetUserId: string?,

		targetApplicationId: string?
	}?) -> Invite end

Arguments

resource

This field is optional and may not be specified

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

Returns

ret1

Invite

Last updated on