mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-12-29 23:03:02 +05:00
feat: embed builder util
This commit is contained in:
parent
b634d9347d
commit
55e0118e24
1 changed files with 14 additions and 0 deletions
14
src/utils/create-embed.js
Normal file
14
src/utils/create-embed.js
Normal 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,
|
||||||
|
});
|
Loading…
Reference in a new issue