mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
refactor!: move dirs outside of src/ (#2032)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import type { ImageFormat } from "../../types/misc/imageFormat.ts";
|
||||
import type { ImageSize } from "../../types/misc/imageSize.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** The users custom avatar or the default avatar if you don't have a member object. */
|
||||
export function avatarURL(
|
||||
bot: Bot,
|
||||
userId: bigint,
|
||||
discriminator: number,
|
||||
options?: {
|
||||
avatar: bigint | undefined;
|
||||
size?: ImageSize;
|
||||
format?: ImageFormat;
|
||||
},
|
||||
) {
|
||||
return options?.avatar
|
||||
? bot.utils.formatImageURL(
|
||||
bot.constants.endpoints.USER_AVATAR(
|
||||
userId,
|
||||
typeof options?.avatar === "string" ? options.avatar : bot.utils.iconBigintToHash(options?.avatar),
|
||||
),
|
||||
options?.size || 128,
|
||||
options?.format,
|
||||
)
|
||||
: bot.constants.endpoints.USER_DEFAULT_AVATAR(Number(discriminator) % 5);
|
||||
}
|
||||
Reference in New Issue
Block a user