Skip to content

Commit

Permalink
fix web build
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinfuchs committed Feb 27, 2024
1 parent bfa145b commit 0c78b45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kite-web/src/lib/discord/cdn.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
export function userAvatarUrl(
user: { id: string; discriminator: string; avatar: string | null },
user: { id: string; discriminator: string | null; avatar: string | null },
size: number = 128
) {
if (user.avatar) {
return `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=${size}`;
} else {
let defaultAvatar: number | BigInt = parseInt(user.discriminator) % 5;
let defaultAvatar: number | BigInt =
parseInt(user.discriminator || "0") % 5;
if (!user.discriminator || user.discriminator === "0") {
defaultAvatar = (BigInt(user.id) >> BigInt(22)) % BigInt(6);
}
Expand Down

0 comments on commit 0c78b45

Please sign in to comment.