easy-discord-error
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Discord error messages made easy

Installation

npm install easy-discord-error --save

Usage with Discord.js

const EDE = require("easy-discord-error");
const Discord = require("discord.js");
const bot = new Discord.Client();

bot.once("ready", () =>{

console.log("Test bot is on!");

})


bot.on("message", async(msg) =>{
    if(msg.content.startsWith("error")){
        try{
         NOTDEFINED;
        }catch(e){
            EDE.errorHandler(e, msg, "777474453114191882", bot);// The "777474453114191882" is the owner's id
        }
        
    }
});

bot.login("TOKEN");

Output

That's what you'll see in your DMs!

without embed

If you use the embed version(EDE.embedErrorHandler)

embed

Usage with Eris

coming soon

Options

const { options } = require("discord-error-handler");

Options Function variables Description
errorHandler error, message, id, Discord_client send the error as a msg
embedErrorHandler error, message, id, Discord_client Send the error as an embed

stuck?

Get in touch with me!

My Discord (RaZe#2841)

Discord server

Readme

Keywords

none

Package Sidebar

Install

npm i easy-discord-error

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

4.51 kB

Total Files

4

Last publish

Collaborators

  • razegame