2023-10-13 15:04:11 +02:00
|
|
|
import { EmbedBuilder } from "discord.js";
|
|
|
|
import { inspect } from "util";
|
2023-09-04 10:51:57 +02:00
|
|
|
|
|
|
|
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() {
|
2023-09-04 10:51:57 +02:00
|
|
|
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-09-04 10:51:57 +02:00
|
|
|
|
2023-10-13 15:04:11 +02:00
|
|
|
return client.errorCatcherWebhook.send({ embeds: [errorEmbed] });
|
|
|
|
},
|
|
|
|
};
|