CDN
ClassOn 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.
Constructor
CDN.new(base) The class table is callable, so CDN(base) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
base |
any |
required | Passed through to the implementation as written. |
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
asset |
any |
required | Passed through to the implementation as written. |
Returns
CDN — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a CDN
object:avatarDecoration(asset)CDN:banner()
#Performs banner on this CDN. Call it from bot code when you need that operation on the current object.
Signature
CDN:banner(id, bannerHash, options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
id |
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
local discord = require("discord")
-- object is a CDN
object:banner("123", bannerHash, {})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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
index |
any |
required | Passed through to the implementation as written. |
Returns
CDN — the same instance, for chaining.
Example
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
soundId |
string |
required | Snowflake id string. |
Returns
CDN — the same instance, for chaining.
Example
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
stickerId |
string |
required | Snowflake id string. |
extension |
any |
required | Passed through to the implementation as written. |
Returns
CDN — the same instance, for chaining.
Example
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
local discord = require("discord")
-- object is a CDN
object:teamIcon("123", iconHash, {})Examples
local discord = require("discord")
local object = discord.CDN({})Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0