Merge branch 'dev'
commit
c909dd6090
|
@ -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 <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))) {
|
||||
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();
|
||||
|
|
Loading…
Reference in New Issue