Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

discord-webhooks

ZudoMC24MITdeprecated1.0.0

this package is deprecated

Easily use webhooks with Discord

discord

readme

discord-webhooks

A simple way of getting started with Discord webhooks.

Getting started

Install:

npm install --save discord-webhooks

And run:

const DiscordWebhook = require("discord-webhooks");

let myWebhook = new DiscordWebhook("https://discordapp.com/api/webhooks/channel_id/token")

myWebhook.on("ready", () => {
    myWebhook.execute({
        content:"Hello from a webhook",
        username:"Mr Webhook",
        avatar_url:"https://example.com/image.png"
    });
});

myWebhook.on("error", (error) => {
  console.warn(error);
});

Discord documentation

Read more about webhooks on the Discord Documentation.