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, + });