DiscordLua
discorddiscord
v1.2.4
Install

InteractionResponse

Class
On 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.

class Module 1.2.4 Source

Constructor

InteractionResponse.new(interaction, message)

The class table is callable, so InteractionResponse(interaction, message) is the same as .new.

NameTypeRequiredBehavior
interaction any required Passed through to the implementation as written.
message any required Passed through to the implementation as written.
lua
local discord = require("discord")
local object = discord.InteractionResponse({}, {})

Properties

InteractionResponse.client

# readonly
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.

InteractionResponse.id

# readonly
Name
id
Type
any
Access
readonly
Description
Snowflake id of this InteractionResponse.
Availability
Populated from the Gateway/REST payload or constructor for this InteractionResponse.

InteractionResponse.interaction

# readonly
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.

InteractionResponse.message

# readonly
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

NameTypeRequiredBehavior
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

lua
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

lua
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

lua
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

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

any.

Example

lua
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

lua
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

NameTypeRequiredBehavior
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

lua
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

NameTypeRequiredBehavior
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

InteractionResponse — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a InteractionResponse
object:fetch(function(err, result)
    if err then error(err) end
end)

Examples

lua
local discord = require("discord")
local object = discord.InteractionResponse({})

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc