Minor adjustments on embed creation.
This commit is contained in:
+6
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user