Skip to content

Commit

Permalink
fixes #102
Browse files Browse the repository at this point in the history
  • Loading branch information
saiteja-madha committed Feb 20, 2022
1 parent 75ec39c commit bbd7267
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/helpers/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ const sendWebhook = (content, err) => {
if (!content && !err) return;
const errString = err?.stack || err;

const embed = new MessageEmbed()
.setColor(config.EMBED_COLORS.ERROR)
.setAuthor({ name: err?.name || "Error" })
.setDescription("```js\n" + (errString.length > 4096 ? `${errString.substr(0, 4000)}...` : errString) + "\n```");
const embed = new MessageEmbed().setColor(config.EMBED_COLORS.ERROR).setAuthor({ name: err?.name || "Error" });

if (errString)
embed.setDescription(
"```js\n" + (errString.length > 4096 ? `${errString.substr(0, 4000)}...` : errString) + "\n```"
);
if (err?.description) embed.addField("Description", content);
if (err?.message) embed.addField("Message", err?.message);

Expand Down

0 comments on commit bbd7267

Please sign in to comment.