1.0.1 • Published 2 years ago

dislogg v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Dislog

Dislog is a small package which sends over important logs to discord via webhooks. Initialize once and send everywhere.

Installation

Install dislog with npm

  npm install dislogg

API Reference

Initializing Dislog

const dislog = new Dislog(webhookURL, userID);
ParameterTypeDescription
webhookURLstringRequired. Your discord channel webhook URL. Can be found under Channel Settings > Integrations.
userIDstringRequired. Your discord user ID. Can be found by right clicking on your profile.

log(message)

Takes a message to be sent as a message in the discord channel.

alert(message)

Works similarly as log(), but also pings the specified user while initializing the library.

Usage

import Dislog from "dislog";

// discordUserID can be found be right-clicking on your profile.
// webhookURL can be found in channel settings under Integrations.
const dislog = new Dislog(webhookURL, discordUserID);

// Send a simple log
dislog.log("Hi, this function will log something.");

// Send a alert, will ping the user
dislog.alert("This is an alert!");