Its Simple Package To which catches and save discord errors and Find Every Bug In Your Code!
You Can download it from npm:
For Discord.js v14 Users:
npm i fixercord
&
For Discord.js v13 Users:
npm i [email protected]
First we Add the module(into your main bot file)
const Fixer = require("fixercord");
const client = new Discord.Client();
const fix = new Fixer(client, {
webhook: {id: `Discord Webhook id for error logging`, token: `Discord Webhooktoken for error logging`}
})// You Can Change const fix to global.fix or client.fix to easy defined
This Example For Logging Error
client.on('messageCreate', async message => {
try{
if(message.author.bot) return;
if(message.content.startsWith("hello") || message.author.bot) return message.chaneel.send("Hello Welcome!");
// the error here is "chaneel" , the right thing is "channel"
//When The Error Happens Again. error will not send again
} catch (error){
fix.create(client, message.guild.id, message.content, error)
// For InteractionCreate Use
fix.create(client, interaction.guild.id, interaction.commandName, error)
}
});
This Code Will Catch All Unhandeld Errors
process.on('unhandledRejection', async (error) => {
fix.create(client, undefined, undefined, error)
});
// Add This Code On Main File
For Any Problems Feel Free To Ask Question Or Any Suggestions </SmSm#8700>