From 55e0118e243bb2dc37c363f1f2b8e9040602fde2 Mon Sep 17 00:00:00 2001 From: Slincnik Date: Wed, 11 Dec 2024 15:12:32 +0300 Subject: [PATCH] feat: embed builder util --- src/utils/create-embed.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/utils/create-embed.js diff --git a/src/utils/create-embed.js b/src/utils/create-embed.js new file mode 100644 index 00000000..dbf1c281 --- /dev/null +++ b/src/utils/create-embed.js @@ -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, + });