Minor adjustments on embed creation.

This commit is contained in:
Nahokey
2024-04-28 18:55:43 +00:00
parent 483875609b
commit 9df52eb74c
+6 -2
View File
@@ -1,23 +1,27 @@
const { EmbedBuilder } = require('discord.js');
async function defaultCreateEmbed(title, desc, color, footer) {
async function defaultCreateEmbed(title, desc, color, footer, image, thumbnail) {
const embed = new EmbedBuilder();
if (title !== null) embed.setTitle(title);
if (desc !== null) embed.setDescription(desc);
if (color !== null) embed.setColor(color);
if (footer !== null) embed.setFooter(footer);
if (image !== null) embed.setImage(image);
if (thumbnail !== null) embed.setThumbnail(thumbnail);
embed.setTimestamp();
return embed;
}
async function advancedCreateEmbed(title, fields, color, footer) {
async function advancedCreateEmbed(title, fields, color, footer, image, thumbnail) {
const embed = new EmbedBuilder();
if (title !== null) embed.setTitle(title);
if (fields !== null) embed.addFields(fields);
if (color !== null) embed.setColor(color);
if (footer !== null) embed.setFooter(footer);
if (image !== null) embed.setImage(image);
if (thumbnail !== null) embed.setThumbnail(thumbnail);
embed.setTimestamp();
return embed;