1.0.0 • Published 8 years ago

discord-webhooks v1.0.0

Weekly downloads
41
License
MIT
Repository
github
Last release
8 years ago

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.