Nighttime Possum Meandering

webhook-discord

2.3.0 • Public • Published

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

install

npm i webhook-discord

Downloadsweekly downloads

277

version

2.3.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability