A simple Javascript file for nicely formatting Discord webhooks
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib Add ratelimit handler May 8, 2018
.eslintrc.json ESLint & Add name verification May 8, 2018
.gitignore Update .gitignore Apr 29, 2018
README.md Fix readme May 8, 2018
package-lock.json 2.3.0 May 8, 2018
package.json 2.3.0 May 8, 2018

README.md

Discord Webhooks

version npm A simple Javascript file for nicely formatting Discord webhooks

Usage

It's simple

To initialise:

const Webhook = require("webhook-discord")

const Hook = new Webhook("WEBHOOK URL")

To send an info message:

Hook.info("WEBHOOK NAME","Info")

To send a warning message:

Hook.warn("WEBHOOK NAME", "Warning message")

To send an error message:

Hook.err("WEBHOOK NAME","Error")

To send a success message:

Hook.success("WEBHOOK NAME","Yay we did something right")

To send a message with a custom format:

Hook.custom("WEBHOOK NAME","MESSAGE CONTENT","MESSAGE TITLE","MESSAGE COLOUR (optional)", "IMAGE URL (optional)")

If specified, color must be a hexadecimal color, and, if specified, image must be a valid image URL.

To send a message with a custom format and an image:

Hook.image("WEBHOOK NAME","MESSAGE CONTENT","MESSAGE TITLE", "IMAGE URL")

Installation

Either use npm:

npm install webhook-discord

Or clone from source:

git clone https://github.com/JoeBanks13/webhook-discord.git

License

MIT