April/events/error.mjs

22 lines
601 B
JavaScript
Raw Permalink Normal View History

2023-10-13 15:04:11 +02:00
import { EmbedBuilder } from "discord.js";
import { inspect } from "util";
const errorEmbed = new EmbedBuilder().setColor("Red");
2023-09-13 21:12:45 +02:00
export default {
2023-10-13 15:04:11 +02:00
name: "error",
async execute() {
errorEmbed
2023-10-13 15:04:11 +02:00
.setTitle("Discord API Error")
.setURL(
"https://discordjs.guide/popular-topics/errors.html#api-errors",
)
.setDescription(
`\`\`\`${inspect(err, { depth: 0 }).slice(0, 1000)}\`\`\``,
)
.setTimestamp();
2023-10-13 15:04:11 +02:00
return client.errorCatcherWebhook.send({ embeds: [errorEmbed] });
},
};