refactor: replace direct EmbedBuilder usage with a new createBaseEmbed helper for consistent embed creation

This commit is contained in:
syntaxbullet
2025-12-24 11:17:59 +01:00
parent 1189483244
commit eaf97572a4
14 changed files with 58 additions and 79 deletions

View File

@@ -1,8 +1,8 @@
import { createCommand } from "@/lib/utils";
import { SlashCommandBuilder, EmbedBuilder } from "discord.js";
import { SlashCommandBuilder } from "discord.js";
import { inventoryService } from "@/modules/inventory/inventory.service";
import { userService } from "@/modules/user/user.service";
import { createWarningEmbed } from "@lib/embeds";
import { createWarningEmbed, createBaseEmbed } from "@lib/embeds";
export const inventory = createCommand({
data: new SlashCommandBuilder()
@@ -35,11 +35,7 @@ export const inventory = createCommand({
return `**${entry.item.name}** x${entry.quantity}`;
}).join("\n");
const embed = new EmbedBuilder()
.setTitle(`${user.username}'s Inventory`)
.setDescription(description)
.setColor("Blue")
.setTimestamp();
const embed = createBaseEmbed(`${user.username}'s Inventory`, description, "Blue");
await interaction.editReply({ embeds: [embed] });
}