Refactor architecture: improve env loading and command workflow

This commit is contained in:
syntaxbullet
2025-12-05 12:06:29 +01:00
parent f4b72b93e4
commit 48995204a5
16 changed files with 362 additions and 30 deletions

View File

@@ -1,13 +1,13 @@
import type { Command } from "@lib/types";
import { createCommand } from "@lib/utils";
import { getUserBalance } from "@/modules/economy/economy.service";
import { SlashCommandBuilder, EmbedBuilder } from "discord.js";
export const balance: Command = {
export const balance = createCommand({
data: new SlashCommandBuilder().setName("balance").setDescription("Check your balance"),
execute: async (interaction) => {
const balance = await getUserBalance(interaction.user.id) || 0;
const embed = new EmbedBuilder().setDescription(`Your balance is ${balance}`);
await interaction.reply({ embeds: [embed] });
}
};
});