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

@@ -2,6 +2,7 @@
import { Message, TextChannel, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, ComponentType } from "discord.js";
import { config } from "@/lib/config";
import { economyService } from "./economy.service";
import { createBaseEmbed } from "@lib/embeds";
import { lootdrops } from "@/db/schema";
import { DrizzleClient } from "@/lib/DrizzleClient";
@@ -91,11 +92,7 @@ class LootdropService {
const reward = Math.floor(Math.random() * (max - min + 1)) + min;
const currency = config.lootdrop.reward.currency;
const embed = new EmbedBuilder()
.setTitle("💰 LOOTDROP!")
.setDescription(`A lootdrop has appeared! Click the button below to claim **${reward} ${currency}**!`)
.setColor("#FFD700")
.setTimestamp();
const embed = createBaseEmbed("💰 LOOTDROP!", `A lootdrop has appeared! Click the button below to claim **${reward} ${currency}**!`, "#FFD700");
const claimButton = new ButtonBuilder()
.setCustomId("lootdrop_claim")