feat: Introduce new modules for class, inventory, leveling, and quests with expanded schema, refactor user service, and add verification scripts.

This commit is contained in:
syntaxbullet
2025-12-07 23:03:33 +01:00
parent be471f348d
commit 29c0a4752d
21 changed files with 1228 additions and 163 deletions

View File

@@ -0,0 +1,45 @@
import { createCommand } from "@/lib/utils";
import { SlashCommandBuilder, EmbedBuilder } from "discord.js";
import { questService } from "@/modules/quest/quest.service";
export const quests = createCommand({
data: new SlashCommandBuilder()
.setName("quests")
.setDescription("View your active quests"),
execute: async (interaction) => {
await interaction.deferReply({ ephemeral: true });
const userQuests = await questService.getUserQuests(interaction.user.id);
if (!userQuests || userQuests.length === 0) {
const embed = new EmbedBuilder()
.setTitle("📜 Quest Log")
.setDescription("You have no active quests.")
.setColor("Grey");
await interaction.editReply({ embeds: [embed] });
return;
}
const embed = new EmbedBuilder()
.setTitle("📜 Quest Log")
.setColor("Blue")
.setTimestamp();
userQuests.forEach(entry => {
const status = entry.completedAt ? "✅ Completed" : "In Progress";
const rewards = entry.quest.rewards as { xp?: number, balance?: number };
const rewardStr = [];
if (rewards?.xp) rewardStr.push(`${rewards.xp} XP`);
if (rewards?.balance) rewardStr.push(`${rewards.balance} 🪙`);
embed.addFields({
name: `${entry.quest.name} (${status})`,
value: `${entry.quest.description}\n**Rewards:** ${rewardStr.join(", ")}\n**Progress:** ${entry.progress}%`,
inline: false
});
});
await interaction.editReply({ embeds: [embed] });
}
});