From ab569e7c9218269cf9e2c4c29e4ee5521bb29fb0 Mon Sep 17 00:00:00 2001 From: Almeida Date: Wed, 5 May 2021 02:20:52 +0100 Subject: [PATCH] simplified RoleInfoCmd --- backend/src/plugins/Utility/commands/RoleInfoCmd.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/src/plugins/Utility/commands/RoleInfoCmd.ts b/backend/src/plugins/Utility/commands/RoleInfoCmd.ts index 2439a481..13c26802 100644 --- a/backend/src/plugins/Utility/commands/RoleInfoCmd.ts +++ b/backend/src/plugins/Utility/commands/RoleInfoCmd.ts @@ -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 }); },