refactor: Remove interaction deferrals, use direct replies, and make error/warning messages ephemeral in economy commands.

This commit is contained in:
syntaxbullet
2025-12-13 12:46:38 +01:00
parent 421bb26ceb
commit 86cbe827a2
3 changed files with 14 additions and 13 deletions

View File

@@ -9,8 +9,6 @@ export const daily = createCommand({
.setName("daily")
.setDescription("Claim your daily reward"),
execute: async (interaction) => {
await interaction.deferReply();
try {
const result = await economyService.claimDaily(interaction.user.id);
@@ -24,16 +22,16 @@ export const daily = createCommand({
.setColor("Gold")
.setTimestamp();
await interaction.editReply({ embeds: [embed] });
await interaction.reply({ embeds: [embed] });
} catch (error: any) {
if (error.message.includes("Daily already claimed")) {
await interaction.editReply({ embeds: [createWarningEmbed(error.message, "Cooldown")] });
await interaction.reply({ embeds: [createWarningEmbed(error.message, "Cooldown")], ephemeral: true });
return;
}
console.error(error);
await interaction.editReply({ embeds: [createErrorEmbed("An error occurred while claiming your daily reward.")] });
await interaction.reply({ embeds: [createErrorEmbed("An error occurred while claiming your daily reward.")], ephemeral: true });
}
}
});