mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
refactor(helpers): separate functions into files (#667)
* refactor(helpers): separate functions into files * idk * idk
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { ImageFormats, ImageSize } from "../../types/mod.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { formatImageURL } from "../../util/utils.ts";
|
||||
|
||||
/** The users custom avatar or the default avatar if you don't have a member object. */
|
||||
export function rawAvatarURL(
|
||||
userID: string,
|
||||
discriminator: string,
|
||||
avatar?: string | null,
|
||||
size: ImageSize = 128,
|
||||
format?: ImageFormats,
|
||||
) {
|
||||
return avatar
|
||||
? formatImageURL(endpoints.USER_AVATAR(userID, avatar), size, format)
|
||||
: endpoints.USER_DEFAULT_AVATAR(Number(discriminator) % 5);
|
||||
}
|
||||
Reference in New Issue
Block a user