Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
webhook-builder
Advanced tools
With NPM
$ npm install webhook-builder
With yarn
$ yarn add webhook-builder
/* ================================================================================= */
// Example //
/* ================================================================================= */
// Make sure you require the file.
// e.g: const { Webhook, MessageBuilder } = require("webhook-builder");
const webhook = new Webhook("your webhook url here");
// If you want to set a username and an icon/avatar for the webhook. Do this:
webhook.setWebhook({
username: "Your webhook username",
avatar_url: "Your avatar/icon URL",
});
// MessageBuilder (Object)
const mb = new MessageBuilder("Your content here", {
title: "Hello World!",
description: "This is a description",
color: "#fff",
});
// MessageBuilder (methods)
const mb = new MessageBuilder("Your content here")
.setTitle("Hello World!")
.setDescription("This is a description")
.setColor("#fff");
// Sending the webhook (Without promise prototypes)
webhook.send(mb);
// Sending the webhook (with promise prototypes)
webhook
.send(mb)
.then(() => {
console.log("The webhook has been sended successfully!");
})
.catch((err) => {
// Throws an error, if there is an error sending the webhook
throw new Error(err);
});
setWebhook
send
// But this is valid webhook.send(null, mb);
// And this webhook.send("Hello World!");
setTitle
setURL
setDescription
setColor
setAuthor
setThumbnail
setField
setFooter - footerText: "String" - footerIcon (optional): "String" | "URL"
FAQs
Build a webhook with this package
The npm package webhook-builder receives a total of 0 weekly downloads. As such, webhook-builder popularity was classified as not popular.
We found that webhook-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.