Skip to content

miketromba/discord.log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published