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 { inventoryService } from "@/modules/inventory/inventory.service";
import { userService } from "@/modules/user/user.service";
import { createWarningEmbed } from "@lib/embeds";
export const inventory = createCommand({
data: new SlashCommandBuilder()
@@ -20,12 +21,7 @@ export const inventory = createCommand({
const items = await inventoryService.getInventory(user.id);
if (!items || items.length === 0) {
const embed = new EmbedBuilder()
.setTitle(`${user.username}'s Inventory`)
.setDescription("Inventory is empty.")
.setColor("Blue");
await interaction.editReply({ embeds: [embed] });
await interaction.editReply({ embeds: [createWarningEmbed("Inventory is empty.", `${user.username}'s Inventory`)] });
return;
}