fixercord
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

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 fixercord@0.0.4

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>

Package Sidebar

Install

npm i fixercord

Weekly Downloads

7

Version

0.0.6

License

MIT

Unpacked Size

17.5 MB

Total Files

4588

Last publish

Collaborators

  • n0tzero