mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
fix: guildSplashURL no longer accepts cached guild
This commit is contained in:
@@ -1,16 +1,18 @@
|
|||||||
import { Guild } from "../../structures/mod.ts";
|
import { DiscordImageFormat } from "../../types/misc/image_format.ts";
|
||||||
|
import { DiscordImageSize } from "../../types/misc/image_size.ts";
|
||||||
import { endpoints } from "../../util/constants.ts";
|
import { endpoints } from "../../util/constants.ts";
|
||||||
import { formatImageURL } from "../../util/utils.ts";
|
import { formatImageURL } from "../../util/utils.ts";
|
||||||
|
|
||||||
/** The full URL of the splash from Discords CDN. Undefined if no splash is set. */
|
/** The full URL of the splash from Discords CDN. Undefined if no splash is set. */
|
||||||
export function guildSplashURL(
|
export function guildSplashURL(
|
||||||
guild: Guild,
|
id: string,
|
||||||
size: ImageSize = 128,
|
splash: string,
|
||||||
format?: ImageFormats,
|
size: DiscordImageSize = 128,
|
||||||
|
format?: DiscordImageFormat,
|
||||||
) {
|
) {
|
||||||
return guild.splash
|
return splash
|
||||||
? formatImageURL(
|
? formatImageURL(
|
||||||
endpoints.GUILD_SPLASH(guild.id, guild.splash),
|
endpoints.GUILD_SPLASH(id, splash),
|
||||||
size,
|
size,
|
||||||
format,
|
format,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user