From e8be911f9f88a7619c18b95667314827d9f8852c Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 22 Aug 2023 00:52:36 -0400 Subject: [PATCH] misc(roleinfo): added spacing so the code looks nicer --- commands/utilities/roleinfo.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/commands/utilities/roleinfo.js b/commands/utilities/roleinfo.js index c084ae0..3d1c073 100644 --- a/commands/utilities/roleinfo.js +++ b/commands/utilities/roleinfo.js @@ -12,9 +12,11 @@ module.exports = { .setDMPermission(false), async execute(interaction) { const role = interaction.options.getRole('role'); + const role_color = role.hexColor !== '#000000' ? role.hexColor : '#99aab5'; const role_color_url_safe = role_color.toString().replace('#', ''); const formattedCreationDate = ``; + let managed = role.managed ? 'True' : 'False'; let managed_description = ''; if (managed == 'True') { @@ -29,15 +31,18 @@ module.exports = { } } managed += managed_description; + const embed = new EmbedBuilder() .setColor(role_color) .setTitle(role.name) .setDescription(`**ID:** ${role.id}\n**Mention:** ${role}\n**Creation Date:** ${formattedCreationDate}\n**Color:** [${role_color}](https://www.color-hex.com/color/${role_color_url_safe})\n**Hoisted:** ${role.hoist ? 'True' : 'False'}\n**Position:** ${role.position}\n **Managed:** ${managed}\n**Mentionable:** ${role.mentionable ? 'True' : 'False'}\n**Administrator:** ${role.permissions.has([PermissionsBitField.Flags.Administrator]) ? 'True' : 'False'}`); + if (role.icon) { embed.setThumbnail(role.iconURL()); } else if (role.unicodeEmoji) { embed.setThumbnail(await fetchTwemoji(role.unicodeEmoji)); } + await interaction.reply({ embeds: [embed], ephemeral: true }); }, };