feat: embed builder util

This commit is contained in:
Slincnik 2024-12-11 15:12:32 +03:00
parent b634d9347d
commit 55e0118e24
No known key found for this signature in database

14
src/utils/create-embed.js Normal file
View file

@ -0,0 +1,14 @@
import { EmbedBuilder } from "discord.js";
import { client } from "../index.js";
/**
*
* @param {import("discord.js").EmbedData} data - embed data
* @returns The generated EmbedBuilder instance.
*/
export const createEmbed = data =>
new EmbedBuilder({
footer: typeof data.footer === "object" ? data.footer : data.footer ? { text: data.footer } : client.configService.get("embed.footer"),
color: data.color ?? client.configService.get("embed.color"),
...data,
});