Invite
ClassOn this page
Invite is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.
Properties
- Name
approximateMemberCount- Type
any- Access
- readonly
- Description
- Instance field
Invite.approximateMemberCount. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
approximatePresenceCount- Type
any- Access
- readonly
- Description
- Instance field
Invite.approximatePresenceCount. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
channel- Type
any- Access
- readonly
- Description
- Channel this Invite belongs to, when resolved from cache.
- Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
channelId- Type
any- Access
- readonly
- Description
- Instance field
Invite.channelId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
client- Type
any- Access
- readonly
- Description
- Owning Client instance used for REST, cache, and event dispatch.
- Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
code- Type
any- Access
- readonly
- Description
- Instance field
Invite.code. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
createdTimestamp- Type
any- Access
- readonly
- Description
- Instance field
Invite.createdTimestamp. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
expiresAt- Type
any- Access
- readonly
- Description
- Instance field
Invite.expiresAt. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
expiresTimestamp- Type
any- Access
- readonly
- Description
- Instance field
Invite.expiresTimestamp. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
flags- Type
any- Access
- readonly
- Description
- Instance field
Invite.flags. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
guild- Type
any- Access
- readonly
- Description
- Guild this Invite belongs to, when the payload included a guild id.
- Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
guildId- Type
any- Access
- readonly
- Description
- Instance field
Invite.guildId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
guildScheduledEvent- Type
any- Access
- readonly
- Description
- Instance field
Invite.guildScheduledEvent. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
inviter- Type
any- Access
- readonly
- Description
- Instance field
Invite.inviter. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
inviterId- Type
any- Access
- readonly
- Description
- Instance field
Invite.inviterId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
maxAge- Type
any- Access
- readonly
- Description
- Instance field
Invite.maxAge. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
maxUses- Type
any- Access
- readonly
- Description
- Instance field
Invite.maxUses. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
memberCount- Type
any- Access
- readonly
- Description
- Instance field
Invite.memberCount. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
presenceCount- Type
any- Access
- readonly
- Description
- Instance field
Invite.presenceCount. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
raw- Type
any- Access
- readonly
- Description
- Instance field
Invite.raw. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
stageInstance- Type
any- Access
- readonly
- Description
- Instance field
Invite.stageInstance. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
targetApplication- Type
any- Access
- readonly
- Description
- Instance field
Invite.targetApplication. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
targetType- Type
any- Access
- readonly
- Description
- Instance field
Invite.targetType. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
targetUser- Type
any- Access
- readonly
- Description
- Instance field
Invite.targetUser. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
temporary- Type
any- Access
- readonly
- Description
- Instance field
Invite.temporary. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
type- Type
any- Access
- readonly
- Description
- Instance field
Invite.type. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
url- Type
any- Access
- readonly
- Description
- Instance field
Invite.url. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
- Name
uses- Type
any- Access
- readonly
- Description
- Instance field
Invite.uses. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Invite.
Methods
Invite:createdAt()
#Create dAt through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Invite:createdAt() Parameters
No parameters.
Returns
Invite — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Invite
object:createdAt()Invite:deletable()
#Performs deletable on this Invite. Call it from bot code when you need that operation on the current object.
Signature
Invite:deletable() Parameters
No parameters.
Returns
Invite — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Invite
object:deletable()Invite:delete()
#Permanently delete this resource through REST.
Signature
Invite:delete(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Invite — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Invite
object:delete(function(err, result)
if err then error(err) end
end)Invite:isGuest()
#Predicate that returns whether this Invite matches isGuest. Use it to branch before calling type-specific methods.
Signature
Invite:isGuest() Parameters
No parameters.
Returns
Invite — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Invite
object:isGuest()Invite:toString()
#function toString() { [native code] }
Signature
Invite:toString() Parameters
No parameters.
Returns
Invite — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Invite
object:toString()Static members
-
Invite.BaseInvite -
Invite.GroupDMInvite -
Invite.GuildInvite -
Invite.InviteStageInstance -
Invite.InvitesPattern
Examples
Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.
Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0