SoundboardSound
ClassOn this page
SoundboardSound 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
available- Type
any- Access
- readonly
- Description
- Instance field
SoundboardSound.available. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this SoundboardSound.
- 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 SoundboardSound.
- Name
emoji- Type
any- Access
- readonly
- Description
- Instance field
SoundboardSound.emoji. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this SoundboardSound.
- Name
emojiId- Type
any- Access
- readonly
- Description
- Instance field
SoundboardSound.emojiId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this SoundboardSound.
- Name
emojiName- Type
any- Access
- readonly
- Description
- Instance field
SoundboardSound.emojiName. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this SoundboardSound.
- Name
guildId- Type
any- Access
- readonly
- Description
- Instance field
SoundboardSound.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 SoundboardSound.
- Name
id- Type
any- Access
- readonly
- Description
- Snowflake id of this SoundboardSound.
- Availability
- Populated from the Gateway/REST payload or constructor for this SoundboardSound.
- Name
name- Type
any- Access
- readonly
- Description
- Display name of this SoundboardSound.
- Availability
- Populated from the Gateway/REST payload or constructor for this SoundboardSound.
- Name
raw- Type
any- Access
- readonly
- Description
- Instance field
SoundboardSound.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 SoundboardSound.
- Name
soundId- Type
any- Access
- readonly
- Description
- Instance field
SoundboardSound.soundId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this SoundboardSound.
- Name
user- Type
any- Access
- readonly
- Description
- User object associated with this SoundboardSound.
- Availability
- Populated from the Gateway/REST payload or constructor for this SoundboardSound.
- Name
volume- Type
any- Access
- readonly
- Description
- Instance field
SoundboardSound.volume. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this SoundboardSound.
Methods
SoundboardSound:createdAt()
#Create dAt through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
SoundboardSound:createdAt() Parameters
No parameters.
Returns
SoundboardSound — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SoundboardSound
object:createdAt()SoundboardSound:createdTimestamp()
#Create dTimestamp through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
SoundboardSound:createdTimestamp() Parameters
No parameters.
Returns
SoundboardSound — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SoundboardSound
object:createdTimestamp()SoundboardSound:delete()
#Permanently delete this resource through REST.
Signature
SoundboardSound:delete(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
SoundboardSound — 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 SoundboardSound
object:delete(function(err, result)
if err then error(err) end
end)SoundboardSound:edit()
#Apply a REST update to this resource.
Signature
SoundboardSound:edit(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
SoundboardSound — 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 SoundboardSound
object:edit({}, function(err, result)
if err then error(err) end
end)SoundboardSound:equals()
#Return whether this SoundboardSound refers to the same resource as the argument.
Signature
SoundboardSound:equals(other) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
other |
any |
required | Passed through to the implementation as written. |
Returns
SoundboardSound — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SoundboardSound
object:equals(other)SoundboardSound:guild()
#Performs guild on this SoundboardSound. Call it from bot code when you need that operation on the current object.
Signature
SoundboardSound:guild() Parameters
No parameters.
Returns
SoundboardSound — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SoundboardSound
object:guild()SoundboardSound:send()
#Send a message, payload, or packet using this object.
Signature
SoundboardSound:send(channelId) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
channelId |
string |
required | Snowflake id string. |
Returns
SoundboardSound — 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 SoundboardSound
object:send("123")SoundboardSound:toJSON()
#Serialize this SoundboardSound into a Lua table suitable for REST or debugging.
Signature
SoundboardSound:toJSON() Parameters
No parameters.
Returns
any.
Example
local discord = require("discord")
-- object is a SoundboardSound
object:toJSON()SoundboardSound:url()
#Performs url on this SoundboardSound. Call it from bot code when you need that operation on the current object.
Signature
SoundboardSound:url() Parameters
No parameters.
Returns
SoundboardSound — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SoundboardSound
object:url()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