From 28e7f1bdc84acba6eea263f5bbdd2ded0f8b3889 Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Sun, 11 Aug 2024 22:45:36 -0500 Subject: [PATCH] pfp randomization for new users --- .dist/user.js | 3 ++- webpage/user.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.dist/user.js b/.dist/user.js index 94daec6..04a77a6 100644 --- a/.dist/user.js +++ b/.dist/user.js @@ -144,7 +144,8 @@ class User { return this.info.cdn + "/avatars/" + this.id + "/" + this.avatar + ".png"; } else { - return this.info.cdn + "/embed/avatars/3.png"; + const int = new Number((BigInt(this.id) >> 22n) % 6n); + return this.info.cdn + `/embed/avatars/${int}.png`; } } createjankpromises() { diff --git a/webpage/user.ts b/webpage/user.ts index 5073c2c..6d52e7e 100644 --- a/webpage/user.ts +++ b/webpage/user.ts @@ -146,7 +146,8 @@ class User{ if(this.avatar!=null){ return this.info.cdn+"/avatars/"+this.id+"/"+this.avatar+".png"; }else{ - return this.info.cdn+"/embed/avatars/3.png"; + const int=new Number((BigInt(this.id) >> 22n) % 6n); + return this.info.cdn+`/embed/avatars/${int}.png`; } } createjankpromises(){