3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-20 16:25:03 +00:00

simplified RoleInfoCmd

This commit is contained in:
Almeida 2021-05-05 02:20:52 +01:00
parent 6d344474d3
commit ab569e7c92

View file

@ -14,14 +14,12 @@ export const RoleInfoCmd = utilityCmd({
},
async run({ message, args, pluginData }) {
const roleId = args.role?.id;
const role = roleId && pluginData.guild.roles.get(roleId);
if (!role) {
if (!args.role) {
sendErrorMessage(pluginData, message.channel, "Role not found");
return;
}
const embed = await getRoleInfoEmbed(pluginData, role, message.author.id);
const embed = await getRoleInfoEmbed(pluginData, args.role, message.author.id);
message.channel.createMessage({ embed });
},