19 lines
601 B
TypeScript
19 lines
601 B
TypeScript
export function discordColorToHex(value: number) {
|
|
return `#${value.toString(16).padStart(6, "0")}`;
|
|
}
|
|
|
|
export function discordAvatarDecorationUrl(asset: string | null | undefined) {
|
|
return asset
|
|
? `https://cdn.discordapp.com/avatar-decoration-presets/${encodeURIComponent(asset)}.png?size=256`
|
|
: null;
|
|
}
|
|
|
|
export function discordGuildTagBadgeUrl(
|
|
guildId: string | null | undefined,
|
|
badge: string | null | undefined,
|
|
) {
|
|
return guildId && badge
|
|
? `https://cdn.discordapp.com/guild-tag-badges/${encodeURIComponent(guildId)}/${encodeURIComponent(badge)}.png?size=64`
|
|
: null;
|
|
}
|