mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
19 lines
492 B
TypeScript
19 lines
492 B
TypeScript
import { Guild } from "../../structures/mod.ts";
|
|
import { endpoints } from "../../util/constants.ts";
|
|
import { formatImageURL } from "../../util/utils.ts";
|
|
|
|
/** The full URL of the splash from Discords CDN. Undefined if no splash is set. */
|
|
export function guildSplashURL(
|
|
guild: Guild,
|
|
size: ImageSize = 128,
|
|
format?: ImageFormats,
|
|
) {
|
|
return guild.splash
|
|
? formatImageURL(
|
|
endpoints.GUILD_SPLASH(guild.id, guild.splash),
|
|
size,
|
|
format,
|
|
)
|
|
: undefined;
|
|
}
|