1.0.0 • Published 9 months ago

@lacerity/webhook v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Webhook

Send errors or custom embeds to Discord/Slack through webhooks easily.

Install

npm i @lacerity/webook

Import

  • JavaScript
const Webhook = require("@lacerity/webhook");
  • TypeScript
import Webhook from "@lacerity/webhook";

Discord or Slack Webhook

Define the webhook

// discord webhook
const DiscordWebhook = new Webook("discord", "DISCORD_WEBHOOK_URL");
// slack webhook
const SlackWebhook = new Webook("slack", "SLACK_WEBHOOK_URL");

Sending errors through webhook

try {
    // try something
} catch(error) {
    // send error
    DiscordWebhook.sendError(error); // typeof error can be Error or unknown
}

Send Custom Embeds

  • Documentation coming soon...
1.0.0

9 months ago

0.0.1

9 months ago