1.1.0 • Published 4 years ago

discord-logger v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

discord logger

Dependency

  • request library for sending requests

Installation

Using npm:

$ npm install discord-logger

How to use

In Node.js:

const DiscordLogger = require('discord-logger');
const options = {
  endpoint: process.env.DISCORD_WEBHOOK,
  botUsername: 'my app logger'
  infoPrefix: ':information_source:' // optional, default value is :information_source:,
  successPrefix: ':white_check_mark:' // optional, default value is :white_check_mark:,
  errorPrefix: ':sos:' // optional, default value is :sos:
}

const logger = new DiscordLogger(options);

// Send message to discord channel associated with provided hook
logger.info('This is regular info message.');
logger.success('Another message, but very successful this time.');
logger.error('Oops! Something is wrong!');

Output: npm.io

Author

maleta

Licence

MIT