defer replies in counter commands

This commit is contained in:
Jill 2022-08-26 19:46:19 +03:00
parent f11c7681f0
commit 7890d44482
3 changed files with 4 additions and 3 deletions

View File

@ -15,6 +15,7 @@ module.exports = {
),
execute: async (interaction: CommandInteraction, member: GuildMember) => {
await interaction.deferReply({ephemeral: true});
const amount = Math.trunc(interaction.options.getNumber('amount') || 1);
changeCounterInteraction(interaction, member, -amount);
}

View File

@ -15,6 +15,7 @@ module.exports = {
),
execute: async (interaction: CommandInteraction, member: GuildMember) => {
await interaction.deferReply({ephemeral: true});
const amount = Math.trunc(interaction.options.getNumber('amount') || 1);
changeCounterInteraction(interaction, member, amount);
}

View File

@ -83,8 +83,7 @@ export async function changeCounterInteraction(interaction: CommandInteraction,
const newCount = await changeCounter(amount);
await updateCounter(interaction.client);
await announceCounterUpdate(interaction.client, member, amount);
interaction.reply({
content: `${EMOJI} **You have ${amount > 0 ? 'increased' : 'decreased'} the counter.**\n\`\`\`diff\n ${newCount - amount}\n${getSign(amount)}${Math.abs(amount)}\n ${newCount}\`\`\``,
ephemeral: true
interaction.followUp({
content: `${EMOJI} **You have ${amount > 0 ? 'increased' : 'decreased'} the counter.**\n\`\`\`diff\n ${newCount - amount}\n${getSign(amount)}${Math.abs(amount)}\n ${newCount}\`\`\``
});
}