InteractionResponse
ClassOn this page
InteractionResponse is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.
Constructor
InteractionResponse.new(interaction, message) The class table is callable, so InteractionResponse(interaction, message) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
interaction |
any |
required | Passed through to the implementation as written. |
message |
any |
required | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.InteractionResponse({}, {})Properties
- 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 InteractionResponse.
- Name
id- Type
any- Access
- readonly
- Description
- Snowflake id of this InteractionResponse.
- Availability
- Populated from the Gateway/REST payload or constructor for this InteractionResponse.
- Name
interaction- Type
any- Access
- readonly
- Description
- Instance field
InteractionResponse.interaction. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this InteractionResponse.
- Name
message- Type
any- Access
- readonly
- Description
- Instance field
InteractionResponse.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 InteractionResponse.
Methods
InteractionResponse:awaitMessageComponent()
#Performs await message component on this InteractionResponse. Call it from bot code when you need that operation on the current object.
Signature
InteractionResponse:awaitMessageComponent(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
any.
Example
local discord = require("discord")
-- object is a InteractionResponse
object:awaitMessageComponent({}, function(err, result)
if err then error(err) end
end)InteractionResponse:createdAt()
#Create dAt through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
InteractionResponse:createdAt() Parameters
No parameters.
Returns
InteractionResponse — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a InteractionResponse
object:createdAt()InteractionResponse:createdTimestamp()
#Create dTimestamp through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
InteractionResponse:createdTimestamp() Parameters
No parameters.
Returns
InteractionResponse — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a InteractionResponse
object:createdTimestamp()InteractionResponse:createMessageComponentCollector()
#Create MessageComponentCollector through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
InteractionResponse:createMessageComponentCollector(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
any.
Example
local discord = require("discord")
-- object is a InteractionResponse
object:createMessageComponentCollector({})InteractionResponse:delete()
#Permanently delete this resource through REST.
Signature
InteractionResponse:delete() Parameters
No parameters.
Returns
InteractionResponse — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a InteractionResponse
object:delete()InteractionResponse:edit()
#Apply a REST update to this resource.
Signature
InteractionResponse:edit(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
InteractionResponse — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a InteractionResponse
object:edit("Hello", function(err, result)
if err then error(err) end
end)InteractionResponse:fetch()
#Request a fresh copy of this resource from REST and update the cache.
Signature
InteractionResponse:fetch(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
InteractionResponse — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a InteractionResponse
object:fetch(function(err, result)
if err then error(err) end
end)Examples
local discord = require("discord")
local object = discord.InteractionResponse({})Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0