CDN

The CDN link builder
export declare class CDN 

constructor(base?)

Constructs a new instance of the CDN class
NameTypeOptionalDescription
basestringYesNone

appAsset(clientId, assetHash, options?)

:

string

Generates an app asset URL for a client's asset.
NameTypeOptionalDescription
clientIdstringNo
The client id that has the asset
assetHashstringNo
The hash provided by Discord for this asset
optionsReadonly<BaseImageURLOptions>Yes
Optional options for the asset

appIcon(clientId, iconHash, options?)

:

string

Generates an app icon URL for a client's icon.
NameTypeOptionalDescription
clientIdstringNo
The client id that has the icon
iconHashstringNo
The hash provided by Discord for this icon
optionsReadonly<BaseImageURLOptions>Yes
Optional options for the icon

avatar(id, avatarHash, options?)

:

string

Generates an avatar URL, e.g. for a user or a webhook.
NameTypeOptionalDescription
idstringNo
The id that has the icon
avatarHashstringNo
The hash provided by Discord for this avatar
optionsReadonly<ImageURLOptions>Yes
Optional options for the avatar

channelIcon(channelId, iconHash, options?)

:

string

Generates an icon URL for a channel, e.g. a group DM.
NameTypeOptionalDescription
channelIdstringNo
The channel id that has the icon
iconHashstringNo
The hash provided by Discord for this channel
optionsReadonly<BaseImageURLOptions>Yes
Optional options for the icon

defaultAvatar(discriminator)

:

string

Generates the default avatar URL for a discriminator.
NameTypeOptionalDescription
discriminatornumberNo
The discriminator modulo 5

discoverySplash(guildId, splashHash, options?)

:

string

Generates a discovery splash URL for a guild's discovery splash.
NameTypeOptionalDescription
guildIdstringNo
The guild id that has the discovery splash
splashHashstringNo
The hash provided by Discord for this splash
optionsReadonly<BaseImageURLOptions>Yes
Optional options for the splash

emoji(emojiId, extension?)

:

string

Generates an emoji's URL for an emoji.
NameTypeOptionalDescription
emojiIdstringNo
The emoji id
extensionImageExtensionYes
The extension of the emoji

guildMemberAvatar(guildId, userId, avatarHash, options?)

:

string

Generates a guild member avatar URL.
NameTypeOptionalDescription
guildIdstringNo
The id of the guild
userIdstringNo
The id of the user
avatarHashstringNo
The hash provided by Discord for this avatar
optionsReadonly<ImageURLOptions>Yes
Optional options for the avatar

guildMemberBanner(guildId, userId, bannerHash, options?)

:

string

Generates a guild member banner URL.
NameTypeOptionalDescription
guildIdstringNo
The id of the guild
userIdstringNo
The id of the user
bannerHashstringNo
The hash provided by Discord for this banner
optionsReadonly<ImageURLOptions>Yes
Optional options for the banner

guildScheduledEventCover(scheduledEventId, coverHash, options?)

:

string

Generates a cover image for a guild scheduled event.
NameTypeOptionalDescription
scheduledEventIdstringNo
The scheduled event id
coverHashstringNo
The hash provided by discord for this cover image
optionsReadonly<BaseImageURLOptions>Yes
Optional options for the cover image

icon(id, iconHash, options?)

:

string

Generates an icon URL, e.g. for a guild.
NameTypeOptionalDescription
idstringNo
The id that has the icon splash
iconHashstringNo
The hash provided by Discord for this icon
optionsReadonly<ImageURLOptions>Yes
Optional options for the icon

roleIcon(roleId, roleIconHash, options?)

:

string

Generates a URL for the icon of a role
NameTypeOptionalDescription
roleIdstringNo
The id of the role that has the icon
roleIconHashstringNo
The hash provided by Discord for this role icon
optionsReadonly<BaseImageURLOptions>Yes
Optional options for the role icon

splash(guildId, splashHash, options?)

:

string

Generates a guild invite splash URL for a guild's invite splash.
NameTypeOptionalDescription
guildIdstringNo
The guild id that has the invite splash
splashHashstringNo
The hash provided by Discord for this splash
optionsReadonly<BaseImageURLOptions>Yes
Optional options for the splash

sticker(stickerId, extension?)

:

string

Generates a sticker URL.
NameTypeOptionalDescription
stickerIdstringNo
The sticker id
extensionStickerExtensionYes
The extension of the sticker

stickerPackBanner(bannerId, options?)

:

string

Generates a sticker pack banner URL.
NameTypeOptionalDescription
bannerIdstringNo
The banner id
optionsReadonly<BaseImageURLOptions>Yes
Optional options for the banner

teamIcon(teamId, iconHash, options?)

:

string

Generates a team icon URL for a team's icon.
NameTypeOptionalDescription
teamIdstringNo
The team id that has the icon
iconHashstringNo
The hash provided by Discord for this icon
optionsReadonly<BaseImageURLOptions>Yes
Optional options for the icon