From 3cbb817b431a395ee1591e37c7fc93c4e7009b70 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Mon, 13 Feb 2023 16:31:24 +1100 Subject: [PATCH] Remove useless await and tidy up embed builder --- src/commands/bonk.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/commands/bonk.ts b/src/commands/bonk.ts index d50cd79..2e6cba0 100644 --- a/src/commands/bonk.ts +++ b/src/commands/bonk.ts @@ -6,15 +6,14 @@ export default { const member = interaction.options.getMember('member') as Discord.GuildMember; const reason = interaction.options.getString('reason'); const adminPerm = member.permissions.has('Administrator'); - if (adminPerm) return interaction.reply('You cannot bonk an admin!'); - await client.bonkCount._incrementUser(member.id).forceSave(); - const embed = new client.embed().setColor(client.config.embedColor) + client.bonkCount._incrementUser(member.id).forceSave(); + interaction.reply({embeds: [new client.embed().setColor(client.config.embedColor) .setDescription(`> <@${member.id}> has been bonked!\n${reason?.length == null ? '' : `> Reason: **${reason}**`}`) .setImage('https://media.tenor.com/7tRddlNUNNcAAAAd/hammer-on-head-minions.gif') - .setFooter({text: `Bonk count for ${member.user.tag}: ${await client.bonkCount.getUser(member.id).toLocaleString('en-US')}`}) - interaction.reply({embeds: [embed]}); + .setFooter({text: `Bonk count for ${member.user.tag}: ${client.bonkCount.getUser(member.id).toLocaleString('en-US')}`}) + ]}) }, data: new SlashCommandBuilder() .setName('bonk')