feat: Initialize database and restructure application source code.

This commit is contained in:
syntaxbullet
2025-12-05 18:52:20 +01:00
parent 1fb59a26cc
commit fdfb2508ae
24 changed files with 55 additions and 255 deletions

View File

@@ -0,0 +1,13 @@
import { createCommand } from "@lib/utils";
import { getUserBalance } from "@/modules/economy/economy.service";
import { SlashCommandBuilder, EmbedBuilder } from "discord.js";
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] });
}
});

View File

@@ -0,0 +1,34 @@
import { createCommand } from "@lib/utils";
import { KyokoClient } from "@lib/KyokoClient";
import { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } from "discord.js";
export const reload = createCommand({
data: new SlashCommandBuilder()
.setName("reload")
.setDescription("Reloads all commands")
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
execute: async (interaction) => {
await interaction.deferReply({ ephemeral: true });
try {
await KyokoClient.loadCommands(true);
const embed = new EmbedBuilder()
.setTitle("✅ System Reloaded")
.setDescription(`Successfully reloaded ${KyokoClient.commands.size} commands.`)
.setColor("Green");
// Deploy commands
await KyokoClient.deployCommands();
await interaction.editReply({ embeds: [embed] });
} catch (error) {
console.error(error);
const embed = new EmbedBuilder()
.setTitle("❌ Reload Failed")
.setDescription("An error occurred while reloading commands. Check console for details.")
.setColor("Red");
await interaction.editReply({ embeds: [embed] });
}
}
});