Webhook Builder
Sections
Installation
With NPM
$ npm install webhook-builder
With yarn
$ yarn add webhook-builder
Examples
Basic Use
const webhook = new Webhook("your webhook url here");
webhook.setWebhook({
username: "Your webhook username",
avatar_url: "Your avatar/icon URL",
});
const mb = new MessageBuilder("Your content here", {
title: "Hello World!",
description: "This is a description",
color: "#fff",
});
const mb = new MessageBuilder("Your content here")
.setTitle("Hello World!")
.setDescription("This is a description")
.setColor("#fff");
webhook.send(mb);
webhook
.send(mb)
.then(() => {
console.log("The webhook has been sended successfully!");
})
.catch((err) => {
throw new Error(err);
});
API
Webhook (Class)
Constructor:
- webhookURL: "String" | "URL"
Methods:
Message Builder (Class)
Constructor:
Methods:
More features will come soon!