puppywebhook
v1.1.1
Published
Queued, rate safe Discord webhook logger with automatic chunking
Maintainers
Readme
puppywebhook
On npm @ https://www.npmjs.com/package/puppywebhook
And GitHub @ https://github.com/onlypuppy7/puppywebhook
Discord webhook wrapper/helper, ported to npm. Another useless file taken out of my projects!
Install
npm install puppywebhook
Usage
import PuppyWebhook from 'puppywebhook';
const webhook = new PuppyWebhook({
webhookUrl: "https://discord.com/api/webhooks/1460782220192256031/Fkibsumk3hWg4M6F2eCmDe_ylXaJlY_z3W9XeCMWbiw4r8zcYfQJg64YeIhaHT-7tpbT",
username: 'StateFarmBot',
maxMessageLength: 1800,
//logs just for testing
logSends: true,
logErrors: true
});
console.log('Queuing some test webhook messages...');
webhook.send('Bot started');
webhook.send('Loaded config');
webhook.send('Something happened');
process.on('exit', async () => {
console.log('Flushing webhook messages before exit...');
await webhook.flush();
});