mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-12-25 23:15:38 -05:00
Only pick guild avatar if it exists
This commit is contained in:
parent
14b13dd190
commit
5192a7c93c
@ -24,7 +24,7 @@ export default {
|
||||
const index = allData.sort((a, b) => b.messages - a.messages).map(x => x._id).indexOf(member.id) + 1;
|
||||
const memberDifference = userData.messages - client.userLevels.algorithm(userData.level);
|
||||
const levelDifference = client.userLevels.algorithm(userData.level+1) - client.userLevels.algorithm(userData.level);
|
||||
interaction.reply({embeds: [new client.embed().setColor(member.displayColor).setTitle(`Level: **${userData.level}**\nRank: **${index ? '#' + index : 'last'}**\nProgress: **${memberDifference}/${levelDifference} (${(memberDifference/levelDifference*100).toFixed(2)}%)**\nTotal: **${userData.messages}**`).setThumbnail(member.user.avatarURL({ extension: 'png', size: 256}) || member.user.defaultAvatarURL)]})
|
||||
interaction.reply({embeds: [new client.embed().setColor(member.displayColor).setTitle(`Level: **${userData.level}**\nRank: **${index ? '#' + index : 'last'}**\nProgress: **${memberDifference}/${levelDifference} (${(memberDifference/levelDifference*100).toFixed(2)}%)**\nTotal: **${userData.messages.toLocaleString('en-US')}**`).setThumbnail(member.avatarURL({extension:'png',size:1024}) || member.user.avatarURL({extension:'png',size:1024}) || member.user.defaultAvatarURL)]})
|
||||
},
|
||||
leaderboard: ()=>{
|
||||
const messageCountsTotal = allData.reduce((a, b) => a + b.messages, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user