You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
asyncfunctiongetRepLeaderboard(author){// Create a cache key using the user ID and the type of leaderboardconstcacheKey=`${author.id}:rep`;// Check if there is a cached result for this requestif(cache.has(cacheKey)){// Return the cached result if it existsreturncache.get(cacheKey);}constlb=awaitgetReputationLb(10);if(lb.length===0)return"There are no users in the leaderboard";letcollector="";for(leti=0;i<lb.length;i++){try{constuser=awaitauthor.client.users.fetch(lb[i].member_id);collector+=`**#${(i+1).toString()}** - ${escapeInlineCode(user.tag)} [${lb[i].rep}]\n`;}catch(ex){collector+=`**#${(i+1).toString()}** - DeletedUser#0000 [${lb[i].rep}]\n`;}}constembed=newEmbedBuilder().setAuthor({name: "Reputation Leaderboard"}).setColor(EMBED_COLORS.BOT_EMBED).setDescription(collector).setFooter({text: `Requested by ${author.tag}`});// Store the result in the cache for future requestscache.set(cacheKey,{embeds: [embed]});return{embeds: [embed]};}
The text was updated successfully, but these errors were encountered:
The reputation leaderboard also says Deleted user
The text was updated successfully, but these errors were encountered: