miketromba / discord.log

Log messages to discord

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

discord.log

Install

npm i discord.log

Usage

import Discord from 'discord.log'
const discord = new Discord(/* discord webhook URL */)
discord.log('Hello world!') // returns promise (see axios docs)

Customize the bot's username

discord.log({
	username: 'Mr. Bot',
	message: 'Hello world!'
})

Why?

Logging stuff to discord can be a really useful way of alerting yourself about certain events. E.g. incoming user feedback, a new purchase, errors, etc. Writing the same webhook post code over and over gets annoying, so this module aims to make it easy.

How do I create a webhook?

  1. Find the text channel you want to create the webhook for and click the gear icon.

Discord Channel

  1. Click on the "Webhooks" tab and click "Create Webhook"

Discord Channel Settings

  1. Copy the Webhook URL

Discord Webhook

About

Log messages to discord


Languages

Language:JavaScript 100.0%