1.0.0 • Published 9 months ago
@lacerity/webhook v1.0.0
Webhook
Send errors or custom embeds to Discord/Slack through webhooks easily.
Install
npm i @lacerity/webookImport
- 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...