Merge branch 'dev'

merge-requests/13/head
Matthew 2020-07-06 03:41:17 -04:00
commit c909dd6090
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 4 additions and 2 deletions

View File

@ -18,7 +18,7 @@ export default class Rank extends Command {
const roles = await this.client.db.Rank.find(); const roles = await this.client.db.Rank.find();
const embed = new RichEmbed(); const embed = new RichEmbed();
embed.setTitle('Ranks'); embed.setTitle('Ranks');
embed.setDescription(`Use \`${this.client.config.prefix}rank <rank name> to join/leave the rank.\``); embed.setDescription(`Use \`${this.client.config.prefix}rank <rank name>\` to join/leave the rank.`);
for (const rank of roles.sort((a, b) => a.name.localeCompare(b.name))) { for (const rank of roles.sort((a, b) => a.name.localeCompare(b.name))) {
let perms: string; let perms: string;
if (rank.permissions.includes('0')) { 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(', '); 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.setFooter(this.client.user.username, this.client.user.avatarURL);
embed.setTimestamp(); embed.setTimestamp();