import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; module.exports = class RoleInfoServer extends Command { constructor(client: CommandoClient) { super(client, { name: 'roleinfo', aliases: [ 'role-info' ], group: 'server', memberName: 'roleinfo', description: 'Gets information on a specified role.', examples: ['uwu!roleinfo @Role'], throttling: { usages: 5, duration: 30 }, userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], guildOnly: true, args: [ { key: 'rRole', prompt: 'What role would you like to get information on?', type: 'role' } ] }); } run(msg: CommandoMessage, { rRole }: any) { let emb = new MessageEmbed() .setColor(0xFFCC4D) .setTitle(`${rRole.name} (${rRole.id})`) .setTimestamp(rRole.createdAt) .addFields([ { name: '🔢 Position', value: `${rRole.position + 1} (raw position: ${rRole.rawPosition})` }, { name: '**@** Mentionable', value: rRole.mentionable ? 'Yes' : 'No' }, { name: "💡 Display separately", value: rRole.hoist ? "Yes" : "No" }, { name: "👥 Members", value: rRole.members.size }, { name: "🔍 Color", value: `Use ${msg.anyUsage(`color ${rRole.hexColor}`)}` } ]) return msg.say(emb) } };