DiscordLua
discorddiscord
v1.2.4
Install

CDN

Class
On this page

CDN 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

CDN.new(base)

The class table is callable, so CDN(base) is the same as .new.

NameTypeRequiredBehavior
base any required Passed through to the implementation as written.
lua
local discord = require("discord")
local object = discord.CDN({})

Methods

CDN:appAsset()

#

Performs app asset on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:appAsset(clientId, assetHash, options)

Parameters

NameTypeRequiredBehavior
clientId string required Snowflake id string.
assetHash any required Passed through to the implementation as written.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:appAsset("123", assetHash, {})

CDN:appIcon()

#

Performs app icon on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:appIcon(clientId, iconHash, options)

Parameters

NameTypeRequiredBehavior
clientId string required Snowflake id string.
iconHash any required Passed through to the implementation as written.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:appIcon("123", iconHash, {})

CDN:avatar()

#

Performs avatar on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:avatar(id, avatarHash, options)

Parameters

NameTypeRequiredBehavior
id string required Snowflake id string.
avatarHash any required Passed through to the implementation as written.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:avatar("123", avatarHash, {})

CDN:avatarDecoration()

#

Performs avatar decoration on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:avatarDecoration(asset)

Parameters

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

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:avatarDecoration(asset)

CDN:channelIcon()

#

Performs channel icon on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:channelIcon(channelId, iconHash, options)

Parameters

NameTypeRequiredBehavior
channelId string required Snowflake id string.
iconHash any required Passed through to the implementation as written.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:channelIcon("123", iconHash, {})

CDN:defaultAvatar()

#

Performs default avatar on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:defaultAvatar(index)

Parameters

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

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:defaultAvatar(index)

CDN:discoverySplash()

#

Performs discovery splash on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:discoverySplash(guildId, splashHash, options)

Parameters

NameTypeRequiredBehavior
guildId string required Snowflake id string.
splashHash any required Passed through to the implementation as written.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:discoverySplash("123", splashHash, {})

CDN:emoji()

#

Performs emoji on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:emoji(emojiId, options)

Parameters

NameTypeRequiredBehavior
emojiId string required Snowflake id string.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:emoji("123", {})

CDN:guildMemberAvatar()

#

Performs guild member avatar on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:guildMemberAvatar(guildId, userId, avatarHash, options)

Parameters

NameTypeRequiredBehavior
guildId string required Snowflake id string.
userId string required Snowflake id string.
avatarHash any required Passed through to the implementation as written.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:guildMemberAvatar("123", "123", avatarHash, {})

CDN:guildMemberBanner()

#

Performs guild member banner on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:guildMemberBanner(guildId, userId, bannerHash, options)

Parameters

NameTypeRequiredBehavior
guildId string required Snowflake id string.
userId string required Snowflake id string.
bannerHash any required Passed through to the implementation as written.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:guildMemberBanner("123", "123", bannerHash, {})

CDN:guildScheduledEventCover()

#

Performs guild scheduled event cover on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:guildScheduledEventCover(eventId, coverHash, options)

Parameters

NameTypeRequiredBehavior
eventId string required Snowflake id string.
coverHash any required Passed through to the implementation as written.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:guildScheduledEventCover("123", coverHash, {})

CDN:guildTagBadge()

#

Performs guild tag badge on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:guildTagBadge(guildId, badgeHash, options)

Parameters

NameTypeRequiredBehavior
guildId string required Snowflake id string.
badgeHash any required Passed through to the implementation as written.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:guildTagBadge("123", badgeHash, {})

CDN:icon()

#

Performs icon on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:icon(id, iconHash, options)

Parameters

NameTypeRequiredBehavior
id string required Snowflake id string.
iconHash any required Passed through to the implementation as written.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:icon("123", iconHash, {})

CDN:roleIcon()

#

Performs role icon on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:roleIcon(roleId, roleIconHash, options)

Parameters

NameTypeRequiredBehavior
roleId string required Snowflake id string.
roleIconHash any required Passed through to the implementation as written.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:roleIcon("123", roleIconHash, {})

CDN:soundboardSound()

#

Performs soundboard sound on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:soundboardSound(soundId)

Parameters

NameTypeRequiredBehavior
soundId string required Snowflake id string.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:soundboardSound("123")

CDN:splash()

#

Performs splash on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:splash(guildId, splashHash, options)

Parameters

NameTypeRequiredBehavior
guildId string required Snowflake id string.
splashHash any required Passed through to the implementation as written.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:splash("123", splashHash, {})

CDN:sticker()

#

Performs sticker on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:sticker(stickerId, extension)

Parameters

NameTypeRequiredBehavior
stickerId string required Snowflake id string.
extension any required Passed through to the implementation as written.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:sticker("123", extension)

CDN:stickerPackBanner()

#

Performs sticker pack banner on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:stickerPackBanner(bannerId, options)

Parameters

NameTypeRequiredBehavior
bannerId string required Snowflake id string.
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

CDN — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a CDN
object:stickerPackBanner("123", {})

CDN:teamIcon()

#

Performs team icon on this CDN. Call it from bot code when you need that operation on the current object.

Signature

CDN:teamIcon(teamId, iconHash, options)

Parameters

NameTypeRequiredBehavior
teamId string required Snowflake id string.
iconHash any required Passed through to the implementation as written.
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 CDN
object:teamIcon("123", iconHash, {})

Examples

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

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

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc