DiscordLua
discorddiscord
v1.2.4
Install

SoundboardSound

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

class Module 1.2.4 Source

Properties

SoundboardSound.available

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

SoundboardSound.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 SoundboardSound.

SoundboardSound.emoji

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

SoundboardSound.emojiId

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

SoundboardSound.emojiName

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

SoundboardSound.guildId

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

SoundboardSound.id

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

SoundboardSound.name

# readonly
Name
name
Type
any
Access
readonly
Description
Display name of this SoundboardSound.
Availability
Populated from the Gateway/REST payload or constructor for this SoundboardSound.

SoundboardSound.raw

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

SoundboardSound.soundId

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

SoundboardSound.user

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

SoundboardSound.volume

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

lua
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

lua
local discord = require("discord")
-- object is a SoundboardSound
object:createdTimestamp()

SoundboardSound:delete()

#

Permanently delete this resource through REST.

Signature

SoundboardSound:delete(callback)

Parameters

NameTypeRequiredBehavior
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

lua
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

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

SoundboardSound — the same instance, for chaining.

Throws

A DiscordLua error when arguments are invalid or the request fails without a callback.

Example

lua
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

NameTypeRequiredBehavior
other any required Passed through to the implementation as written.

Returns

SoundboardSound — the same instance, for chaining.

Example

lua
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

lua
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

NameTypeRequiredBehavior
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

lua
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

lua
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

lua
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.

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

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc