Skip to content

DEVSMSM/fixercord

Repository files navigation

Fixercord

Its Simple Package To which catches and save discord errors and Find Every Bug In Your Code!

npm GitHub Repo stars

Download

You Can download it from npm:

For Discord.js v14 Users:
npm i fixercord
&
For Discord.js v13 Users:
npm i [email protected]

Setting Up

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

Example

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) 
  }
});

Catch Unhandeld 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

Need Help ?

For Any Problems Feel Free To Ask Question Or Any Suggestions </SmSm#8700>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published