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 { 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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user