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,6 +1,7 @@
import { createCommand } from "@/lib/utils";
import { SlashCommandBuilder, EmbedBuilder } from "discord.js";
import { SlashCommandBuilder } from "discord.js";
import { userService } from "@/modules/user/user.service";
import { createBaseEmbed } from "@lib/embeds";
export const balance = createCommand({
data: new SlashCommandBuilder()
@@ -22,10 +23,8 @@ export const balance = createCommand({
const user = await userService.getOrCreateUser(targetUser.id, targetUser.username);
const embed = new EmbedBuilder()
.setAuthor({ name: targetUser.username, iconURL: targetUser.displayAvatarURL() })
.setDescription(`**Balance**: ${user.balance || 0n} AU`)
.setColor("Yellow");
const embed = createBaseEmbed(undefined, `**Balance**: ${user.balance || 0n} AU`, "Yellow")
.setAuthor({ name: targetUser.username, iconURL: targetUser.displayAvatarURL() });
await interaction.editReply({ embeds: [embed] });
}