request
library for sending requests
Using npm:
$ npm install discord-logger
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!');
maleta
MIT