# easy-discord-error

> Discord.js error handler

Latest version **1.0.1** (published 2021-08-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install easy-discord-error
pnpm add easy-discord-error
yarn add easy-discord-error
bun add easy-discord-error
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-08-07 |
| First published | 2021-04-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | RaZe#2841 |
| Maintainers | razegame |

## Links

- npm: https://www.npmjs.com/package/easy-discord-error
- npm.io page: https://npm.io/package/easy-discord-error

## Dependencies (2)

- [discord.js](https://npm.io/package/discord.js.md) ^13.0.0
- [typescript](https://npm.io/package/typescript.md) ^4.3.5

## Recent versions

- 1.0.1 (latest) — 2021-08-07
- 1.0.0 — 2021-08-06
- 0.0.2-3.5 — 2021-04-03
- 0.0.2-3.4 — 2021-04-03
- 0.0.2-3.3 — 2021-04-03
- 0.0.2-3.2 — 2021-04-03
- 0.0.2-3.1 — 2021-04-03
- 0.0.23 — 2021-04-03
- 0.0.22 — 2021-04-02
- 0.0.21 — 2021-04-02
- 0.0.2 — 2021-04-02
- 0.0.1 — 2021-04-01

## README

# Discord error messages made easy

## Installation
```bash
npm install easy-discord-error --save
```

## Usage with Discord.js
```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](https://cdn.discordapp.com/attachments/800344177774559232/827500586986897440/unknown.png)

If you use the embed version(`EDE.embedErrorHandler`)

![embed](https://cdn.discordapp.com/attachments/826074155559682060/827887186014765076/unknown.png)


## 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](https://discord.gg/gSdg8FCxHf)

---
_Source: https://npm.io/package/easy-discord-error · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
