mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
Guilds helpers
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import type { DiscordImageFormat } from "../../types/misc/image_format.ts";
|
||||
import type { DiscordImageSize } from "../../types/misc/image_size.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { iconBigintToHash } from "../../util/hash.ts";
|
||||
import { formatImageURL } from "../../util/utils.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** The full URL of the splash from Discords CDN. Undefined if no splash is set. */
|
||||
export function guildSplashURL(
|
||||
bot: Bot,
|
||||
id: bigint,
|
||||
options: {
|
||||
splash?: string | bigint;
|
||||
@@ -15,12 +14,12 @@ export function guildSplashURL(
|
||||
}
|
||||
) {
|
||||
return options.splash
|
||||
? formatImageURL(
|
||||
endpoints.GUILD_SPLASH(
|
||||
? bot.utils.formatImageURL(
|
||||
bot.constants.endpoints.GUILD_SPLASH(
|
||||
id,
|
||||
typeof options.splash === "string"
|
||||
? options.splash
|
||||
: iconBigintToHash(options.splash, options.animated ?? true)
|
||||
: bot.utils.iconBigintToHash(options.splash, options.animated ?? true)
|
||||
),
|
||||
options.size || 128,
|
||||
options.format
|
||||
|
||||
Reference in New Issue
Block a user