Interaction
interactionOn this page
Interaction is a Discord interaction payload. Branch on type helpers such as :isChatInputCommand, then :reply, :deferReply, or :showModal.
Properties
- Name
appPermissions- Type
any- Access
- readonly
- Description
- Instance field
Interaction.appPermissions. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
applicationId- Type
any- Access
- readonly
- Description
- Instance field
Interaction.applicationId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
attachmentSizeLimit- Type
any- Access
- readonly
- Description
- Instance field
Interaction.attachmentSizeLimit. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
authorizingIntegrationOwners- Type
- AuthorizingIntegrationOwners
- Access
- readonly
- Description
- Instance field
Interaction.authorizingIntegrationOwners. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Related
- AuthorizingIntegrationOwners
- Name
channelId- Type
any- Access
- readonly
- Description
- Instance field
Interaction.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 Interaction.
- 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 Interaction.
- Name
commandGuildId- Type
any- Access
- readonly
- Description
- Instance field
Interaction.commandGuildId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
commandId- Type
any- Access
- readonly
- Description
- Instance field
Interaction.commandId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
commandName- Type
any- Access
- readonly
- Description
- Instance field
Interaction.commandName. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
commandType- Type
any- Access
- readonly
- Description
- Instance field
Interaction.commandType. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
component- Type
any- Access
- readonly
- Description
- Instance field
Interaction.component. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
componentType- Type
any- Access
- readonly
- Description
- Instance field
Interaction.componentType. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
components- Type
any- Access
- readonly
- Description
- Instance field
Interaction.components. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
context- Type
any- Access
- readonly
- Description
- Instance field
Interaction.context. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
customId- Type
any- Access
- readonly
- Description
- Instance field
Interaction.customId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
data- Type
any- Access
- readonly
- Description
- Instance field
Interaction.data. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
deferred- Type
any- Access
- readonly
- Description
- Instance field
Interaction.deferred. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
entitlements- Type
- Collection
- Access
- readonly
- Description
- Instance field
Interaction.entitlements. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Related
- Collection
- Name
fields- Type
any- Access
- readonly
- Description
- Instance field
Interaction.fields. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
guildId- Type
any- Access
- readonly
- Description
- Instance field
Interaction.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 Interaction.
- Name
guildLocale- Type
any- Access
- readonly
- Description
- Instance field
Interaction.guildLocale. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
id- Type
any- Access
- readonly
- Description
- Snowflake id of this Interaction.
- Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
locale- Type
any- Access
- readonly
- Description
- Instance field
Interaction.locale. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
memberPermissions- Type
any- Access
- readonly
- Description
- Instance field
Interaction.memberPermissions. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
message- Type
MessageMod- Access
- readonly
- Description
- Instance field
Interaction.message. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
options- Type
any- Access
- readonly
- Description
- Instance field
Interaction.options. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
raw- Type
any- Access
- readonly
- Description
- Instance field
Interaction.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 Interaction.
- Name
replied- Type
any- Access
- readonly
- Description
- Instance field
Interaction.replied. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
responded- Type
any- Access
- readonly
- Description
- Instance field
Interaction.responded. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
targetId- Type
any- Access
- readonly
- Description
- Instance field
Interaction.targetId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
- Name
token- Type
any- Access
- readonly
- Description
- Authentication token held by this Interaction. Do not log this value.
- Availability
- Set by
login. Do not log this value.
- Name
type- Type
any- Access
- readonly
- Description
- Instance field
Interaction.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 Interaction.
- Name
version- Type
any- Access
- readonly
- Description
- Instance field
Interaction.version. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Interaction.
Methods
Interaction:awaitModalSubmit()
#Performs await modal submit on this Interaction. Call it from bot code when you need that operation on the current object.
Signature
Interaction:awaitModalSubmit(options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Interaction — the same instance, for chaining.
Throws
A DiscordLua error when arguments are invalid or the request fails without a callback.
Example
local discord = require("discord")
-- object is a Interaction
object:awaitModalSubmit({}, function(err, result)
if err then error(err) end
end)Interaction:channel()
#Performs channel on this Interaction. Call it from bot code when you need that operation on the current object.
Signature
Interaction:channel() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:channel()Interaction:command()
#Performs command on this Interaction. Call it from bot code when you need that operation on the current object.
Signature
Interaction:command() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:command()Interaction:createdAt()
#Create dAt through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Interaction:createdAt() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:createdAt()Interaction:createdTimestamp()
#Create dTimestamp through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Interaction:createdTimestamp() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:createdTimestamp()Interaction:deferReply()
#Acknowledge an interaction with a deferred channel message.
Signature
Interaction:deferReply(ephemeral) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
ephemeral |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:deferReply(ephemeral)Interaction:deferUpdate()
#Performs defer update on this Interaction. Call it from bot code when you need that operation on the current object.
Signature
Interaction:deferUpdate() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:deferUpdate()Interaction:deleteFollowUp()
#Permanently delete FollowUp through REST.
Signature
Interaction:deleteFollowUp(messageId) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
messageId |
string |
required | Snowflake id string. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:deleteFollowUp("123")Interaction:deleteReply()
#Permanently delete Reply through REST.
Signature
Interaction:deleteReply() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:deleteReply()Interaction:editFollowUp()
#Apply a REST update to FollowUp and refresh the local object when the request succeeds.
Signature
Interaction:editFollowUp(messageId, contentOrOptions) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
messageId |
string |
required | Snowflake id string. |
contentOrOptions |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:editFollowUp("123", "Hello")Interaction:editReply()
#Apply a REST update to Reply and refresh the local object when the request succeeds.
Signature
Interaction:editReply(contentOrOptions, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
contentOrOptions |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:editReply("Hello", function(err, result)
if err then error(err) end
end)Interaction:ephemeral()
#Performs ephemeral on this Interaction. Call it from bot code when you need that operation on the current object.
Signature
Interaction:ephemeral() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:ephemeral()Interaction:fetchFollowUp()
#Fetch FollowUp from REST and update the local cache when the request succeeds.
Signature
Interaction:fetchFollowUp(messageId, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
messageId |
string |
required | Snowflake id string. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:fetchFollowUp("123", function(err, result)
if err then error(err) end
end)Interaction:fetchReply()
#Fetch Reply from REST and update the local cache when the request succeeds.
Signature
Interaction:fetchReply(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:fetchReply(function(err, result)
if err then error(err) end
end)Interaction:fetchResponse()
#Fetch Response from REST and update the local cache when the request succeeds.
Signature
Interaction:fetchResponse() Parameters
No parameters.
Returns
any.
Example
local discord = require("discord")
-- object is a Interaction
object:fetchResponse()Interaction:followUp()
#Send an additional webhook follow-up after the first response.
Signature
Interaction:followUp(contentOrOptions, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
contentOrOptions |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:followUp("Hello", function(err, result)
if err then error(err) end
end)Interaction:getAttachment()
#Read the Attachment value from this Interaction.
Signature
Interaction:getAttachment(name, required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getAttachment(name, required)Interaction:getBoolean()
#Read the Boolean value from this Interaction.
Signature
Interaction:getBoolean(name, required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getBoolean(name, required)Interaction:getChannel()
#Read the Channel value from this Interaction.
Signature
Interaction:getChannel(name, required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getChannel(name, required)Interaction:getFocused()
#Read the Focused value from this Interaction.
Signature
Interaction:getFocused(getFull) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
getFull |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getFocused(getFull)Interaction:getInteger()
#Read the Integer value from this Interaction.
Signature
Interaction:getInteger(name, required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getInteger(name, required)Interaction:getMember()
#Read the Member value from this Interaction.
Signature
Interaction:getMember(name, required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getMember(name, required)Interaction:getMentionable()
#Read the Mentionable value from this Interaction.
Signature
Interaction:getMentionable(name, required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getMentionable(name, required)Interaction:getNumber()
#Read the Number value from this Interaction.
Signature
Interaction:getNumber(name, required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getNumber(name, required)Interaction:getOption()
#Read the Option value from this Interaction.
Signature
Interaction:getOption(name, required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getOption(name, required)Interaction:getRole()
#Read the Role value from this Interaction.
Signature
Interaction:getRole(name, required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getRole(name, required)Interaction:getString()
#Read the String value from this Interaction.
Signature
Interaction:getString(name, required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getString(name, required)Interaction:getSubcommand()
#Read the Subcommand value from this Interaction.
Signature
Interaction:getSubcommand(required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getSubcommand(required)Interaction:getSubcommandGroup()
#Read the SubcommandGroup value from this Interaction.
Signature
Interaction:getSubcommandGroup(required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getSubcommandGroup(required)Interaction:getTextInputValue()
#Read the TextInputValue value from this Interaction.
Signature
Interaction:getTextInputValue(customId, required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
customId |
string |
required | Snowflake id string. |
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getTextInputValue("123", required)Interaction:getUser()
#Read the User value from this Interaction.
Signature
Interaction:getUser(name, required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
required |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:getUser(name, required)Interaction:guild()
#Performs guild on this Interaction. Call it from bot code when you need that operation on the current object.
Signature
Interaction:guild() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:guild()Interaction:inCachedGuild()
#Predicate that returns whether this Interaction matches inCachedGuild. Use it to branch before calling type-specific methods.
Signature
Interaction:inCachedGuild() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:inCachedGuild()Interaction:inGuild()
#Predicate that returns whether this Interaction matches inGuild. Use it to branch before calling type-specific methods.
Signature
Interaction:inGuild() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:inGuild()Interaction:inRawGuild()
#Predicate that returns whether this Interaction matches inRawGuild. Use it to branch before calling type-specific methods.
Signature
Interaction:inRawGuild() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:inRawGuild()Interaction:isAnySelectMenu()
#Predicate that returns whether this Interaction matches isAnySelectMenu. Use it to branch before calling type-specific methods.
Signature
Interaction:isAnySelectMenu() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isAnySelectMenu()Interaction:isAutocomplete()
#Predicate that returns whether this Interaction matches isAutocomplete. Use it to branch before calling type-specific methods.
Signature
Interaction:isAutocomplete() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isAutocomplete()Interaction:isButton()
#Predicate that returns whether this Interaction matches isButton. Use it to branch before calling type-specific methods.
Signature
Interaction:isButton() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isButton()Interaction:isChannelSelectMenu()
#Predicate that returns whether this Interaction matches isChannelSelectMenu. Use it to branch before calling type-specific methods.
Signature
Interaction:isChannelSelectMenu() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isChannelSelectMenu()Interaction:isChatInputCommand()
#Predicate that returns whether this Interaction matches isChatInputCommand. Use it to branch before calling type-specific methods.
Signature
Interaction:isChatInputCommand() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isChatInputCommand()Interaction:isCommand()
#Predicate that returns whether this Interaction matches isCommand. Use it to branch before calling type-specific methods.
Signature
Interaction:isCommand() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isCommand()Interaction:isContextMenuCommand()
#Predicate that returns whether this Interaction matches isContextMenuCommand. Use it to branch before calling type-specific methods.
Signature
Interaction:isContextMenuCommand() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isContextMenuCommand()Interaction:isFromMessage()
#Predicate that returns whether this Interaction matches isFromMessage. Use it to branch before calling type-specific methods.
Signature
Interaction:isFromMessage() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isFromMessage()Interaction:isMentionableSelectMenu()
#Predicate that returns whether this Interaction matches isMentionableSelectMenu. Use it to branch before calling type-specific methods.
Signature
Interaction:isMentionableSelectMenu() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isMentionableSelectMenu()Interaction:isMessageComponent()
#Predicate that returns whether this Interaction matches isMessageComponent. Use it to branch before calling type-specific methods.
Signature
Interaction:isMessageComponent() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isMessageComponent()Interaction:isMessageContextMenuCommand()
#Predicate that returns whether this Interaction matches isMessageContextMenuCommand. Use it to branch before calling type-specific methods.
Signature
Interaction:isMessageContextMenuCommand() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isMessageContextMenuCommand()Interaction:isModalSubmit()
#Predicate that returns whether this Interaction matches isModalSubmit. Use it to branch before calling type-specific methods.
Signature
Interaction:isModalSubmit() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isModalSubmit()Interaction:isPrimaryEntryPointCommand()
#Predicate that returns whether this Interaction matches isPrimaryEntryPointCommand. Use it to branch before calling type-specific methods.
Signature
Interaction:isPrimaryEntryPointCommand() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isPrimaryEntryPointCommand()Interaction:isRepliable()
#Predicate that returns whether this Interaction matches isRepliable. Use it to branch before calling type-specific methods.
Signature
Interaction:isRepliable() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isRepliable()Interaction:isRoleSelectMenu()
#Predicate that returns whether this Interaction matches isRoleSelectMenu. Use it to branch before calling type-specific methods.
Signature
Interaction:isRoleSelectMenu() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isRoleSelectMenu()Interaction:isSelectMenu()
#Predicate that returns whether this Interaction matches isSelectMenu. Use it to branch before calling type-specific methods.
Signature
Interaction:isSelectMenu() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isSelectMenu()Interaction:isStringSelectMenu()
#Predicate that returns whether this Interaction matches isStringSelectMenu. Use it to branch before calling type-specific methods.
Signature
Interaction:isStringSelectMenu() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isStringSelectMenu()Interaction:isUserContextMenuCommand()
#Predicate that returns whether this Interaction matches isUserContextMenuCommand. Use it to branch before calling type-specific methods.
Signature
Interaction:isUserContextMenuCommand() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isUserContextMenuCommand()Interaction:isUserSelectMenu()
#Predicate that returns whether this Interaction matches isUserSelectMenu. Use it to branch before calling type-specific methods.
Signature
Interaction:isUserSelectMenu() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:isUserSelectMenu()Interaction:launchActivity()
#Performs launch activity on this Interaction. Call it from bot code when you need that operation on the current object.
Signature
Interaction:launchActivity() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:launchActivity()Interaction:reply()
#Send a message in the same channel as a reply to this object.
Signature
Interaction:reply(contentOrOptions) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
contentOrOptions |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:reply("Hello")Interaction:respondAutocomplete()
#Performs respond autocomplete on this Interaction. Call it from bot code when you need that operation on the current object.
Signature
Interaction:respondAutocomplete(choices) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
choices |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:respondAutocomplete(choices)Interaction:sendPremiumRequired()
#Send PremiumRequired using this Interaction.
Signature
Interaction:sendPremiumRequired() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:sendPremiumRequired()Interaction:showModal()
#Open a modal UI for this interaction.
Signature
Interaction:showModal(modal) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
modal |
any |
required | Passed through to the implementation as written. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:showModal(modal)Interaction:toJSON()
#Serialize this Interaction into a Lua table suitable for REST or debugging.
Signature
Interaction:toJSON() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:toJSON()Interaction:toString()
#function toString() { [native code] }
Signature
Interaction:toString() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:toString()Interaction:update()
#Performs update on this Interaction. Call it from bot code when you need that operation on the current object.
Signature
Interaction:update(contentOrOptions) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
contentOrOptions |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:update("Hello")Interaction:values()
#Performs values on this Interaction. Call it from bot code when you need that operation on the current object.
Signature
Interaction:values() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:values()Interaction:webhook()
#Performs webhook on this Interaction. Call it from bot code when you need that operation on the current object.
Signature
Interaction:webhook() Parameters
No parameters.
Returns
Interaction — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Interaction
object:webhook()Static members
-
Interaction.AuthorizingIntegrationOwners -
Interaction.AutocompleteInteraction -
Interaction.ButtonInteraction -
Interaction.ChannelSelectMenuInteraction -
Interaction.ChatInputCommandInteraction -
Interaction.CommandInteraction -
Interaction.ContextMenuCommandInteraction -
Interaction.InteractionResponse -
Interaction.MentionableSelectMenuInteraction -
Interaction.MessageComponentInteraction -
Interaction.MessageContextMenuCommandInteraction -
Interaction.ModalSubmitInteraction -
Interaction.PrimaryEntryPointCommandInteraction -
Interaction.RoleSelectMenuInteraction -
Interaction.SelectMenuInteraction -
Interaction.StringSelectMenuInteraction -
Interaction.UserContextMenuCommandInteraction -
Interaction.UserSelectMenuInteraction
Examples
Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.
Related APIs
AutocompleteInteraction · ButtonInteraction · ChannelSelectMenuInteraction · ChatInputCommandInteraction · ContextMenuCommandInteraction · MentionableSelectMenuInteraction · MessageComponentInteraction · MessageContextMenuCommandInteraction
Version: discord 1.2.4 · runtime 1.0.0