From 427e1c6ae210e616901e81a1de261f9da4b772d3 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Fri, 9 Feb 2024 21:30:11 +0500 Subject: [PATCH] update embed generator --- base/Client.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/base/Client.js b/base/Client.js index 093ba2ed..aa093fe3 100644 --- a/base/Client.js +++ b/base/Client.js @@ -179,12 +179,15 @@ class JaBaClient extends Client { .setImage(data.image || null) .setURL(data.url || null) .setColor(data.color || this.config.embed.color) - .setFooter(data.footer || this.config.embed.footer) - .setTimestamp(data.timestamp || null); + .setFooter(data.footer || this.config.embed.footer); + + if (data.timestamp) embed.setTimestamp(data.timestamp); + else if (data.timestamp === null) embed.setTimestamp(null); + else embed.setTimestamp(); if (typeof data.author === "string") embed.setAuthor({ name: data.author, iconURL: this.user.avatarURL() }); else if (typeof data.author === "object" && (data.author.iconURL !== null || data.author.iconURL !== undefined)) embed.setAuthor({ name: data.author.name, iconURL: this.user.avatarURL() }); - else if (!data.author) embed.setAuthor(null); + else if (!data.author || data.author === null) embed.setAuthor(null); else embed.setAuthor(data.author); return embed;