feat: add trading system with dedicated modules and centralize embed creation for commands

This commit is contained in:
syntaxbullet
2025-12-13 12:43:27 +01:00
parent 5f4efd372f
commit 421bb26ceb
13 changed files with 667 additions and 41 deletions

View File

@@ -2,6 +2,7 @@ import { createCommand } from "@/lib/utils";
import { SlashCommandBuilder, EmbedBuilder } from "discord.js";
import { economyService } from "@/modules/economy/economy.service";
import { userService } from "@/modules/user/user.service";
import { createErrorEmbed, createWarningEmbed } from "@lib/embeds";
export const daily = createCommand({
data: new SlashCommandBuilder()
@@ -27,17 +28,12 @@ export const daily = createCommand({
} catch (error: any) {
if (error.message.includes("Daily already claimed")) {
const embed = new EmbedBuilder()
.setTitle("⏳ Cooldown")
.setDescription(error.message)
.setColor("Orange");
await interaction.editReply({ embeds: [embed] });
await interaction.editReply({ embeds: [createWarningEmbed(error.message, "Cooldown")] });
return;
}
console.error(error);
await interaction.editReply({ content: "❌ An error occurred while claiming your daily reward." });
await interaction.editReply({ embeds: [createErrorEmbed("An error occurred while claiming your daily reward.")] });
}
}
});