forked from syntaxbullet/AuroraBot-discord
feat: add trading system with dedicated modules and centralize embed creation for commands
This commit is contained in:
@@ -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.")] });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user