From d76da2fc873ed54c5c187ff442e1a24452a9399e Mon Sep 17 00:00:00 2001 From: Matthew R Date: Mon, 6 Jul 2020 03:40:54 -0400 Subject: [PATCH] updates to rank cmd --- src/commands/rank.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/rank.ts b/src/commands/rank.ts index 7245095..d10528f 100644 --- a/src/commands/rank.ts +++ b/src/commands/rank.ts @@ -18,7 +18,7 @@ export default class Rank extends Command { const roles = await this.client.db.Rank.find(); const embed = new RichEmbed(); embed.setTitle('Ranks'); - embed.setDescription(`Use \`${this.client.config.prefix}rank to join/leave the rank.\``); + embed.setDescription(`Use \`${this.client.config.prefix}rank \` to join/leave the rank.`); for (const rank of roles.sort((a, b) => a.name.localeCompare(b.name))) { let perms: string; if (rank.permissions.includes('0')) { @@ -30,7 +30,9 @@ export default class Rank extends Command { }); perms = rolesArray.map((r) => message.guild.roles.get(r.id)).sort((a, b) => b.position - a.position).map((r) => `<@&${r.id}>`).join(', '); } - embed.addField(rank.name, `__Description:__ ${rank.description}\n__Permissions:__ ${perms}`); + let hasRank = false; + if (message.member.roles.includes(rank.roleID)) hasRank = true; + embed.addField(rank.name, `${hasRank ? '*You have this role.*' : ''}__Description:__ ${rank.description}\n__Permissions:__ ${perms}`); } embed.setFooter(this.client.user.username, this.client.user.avatarURL); embed.setTimestamp();