diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-04-25 23:13:32 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-04-25 23:13:32 -0400 |
commit | 98a58a7d87a6009383e9de3ce5865ded0fb0efa6 (patch) | |
tree | d407e6d89ec1de1f444daa46ebfd31f24f28fe38 /src | |
parent | 6f5eb8c9b0b9aa1cfa7e90440e688cb8decee8c8 (diff) | |
download | tanzanite-98a58a7d87a6009383e9de3ce5865ded0fb0efa6.tar.gz tanzanite-98a58a7d87a6009383e9de3ce5865ded0fb0efa6.tar.bz2 tanzanite-98a58a7d87a6009383e9de3ce5865ded0fb0efa6.zip |
fix: add deferReply
Diffstat (limited to 'src')
-rw-r--r-- | src/listeners/interaction/interactionCreate.ts | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/listeners/interaction/interactionCreate.ts b/src/listeners/interaction/interactionCreate.ts index 7fdbbbf..7d26d34 100644 --- a/src/listeners/interaction/interactionCreate.ts +++ b/src/listeners/interaction/interactionCreate.ts @@ -28,32 +28,29 @@ export default class InteractionCreateListener extends BushListener { const role = interaction.guild.roles.cache.get(roleId); if (!role) return interaction.reply({ content: `${util.emojis.error} That role does not exist.` }); const has = interaction.member.roles.cache.has(roleId); + await interaction.deferReply({ ephemeral: true }); if (has) { const success = await interaction.member.roles.remove(roleId).catch(() => false); if (success) - return interaction.reply({ + return interaction.editReply({ content: `${util.emojis.success} Removed the ${role} role from you.`, - ephemeral: true, allowedMentions: {} }); else - return interaction.reply({ + return interaction.editReply({ content: `${util.emojis.error} Failed to remove ${role} from you.`, - ephemeral: true, allowedMentions: {} }); } else { const success = await interaction.member.roles.add(roleId).catch(() => false); if (success) - return interaction.reply({ + return interaction.editReply({ content: `${util.emojis.success} Added the ${role} role to you.`, - ephemeral: true, allowedMentions: {} }); else - return interaction.reply({ + return interaction.editReply({ content: `${util.emojis.error} Failed to add ${role} to you.`, - ephemeral: true, allowedMentions: {} }); } |