0.4.0 • Published 8 months ago

discord-webhook-util v0.4.0

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

discord-webhook-util

A tiny utility package for posting messages to Discord via webhooks.

Installing

npm install discord-webhook-util

Basic usage

import {registerWebhookInCategory, sendMessageToCategory} from 'discord-webhook-util';

// Add a webhook to a category
// registerWebhookInCategory(categoryName, url)
registerWebhookInCategory('category-1', 'https://discord.com/api/webhooks/123456789/abcdefghijklmnopqrstuvwxyz');

// Send message to all webhooks that are in a category
sendMessageToCategory('category-1', {
    content: 'Test',
})
    .then(() => {
        console.log('Message sent successfully!');
    })
    .catch(err => {
        console.error(err);
    });
0.4.0

8 months ago

0.3.1

8 months ago

0.2.9

8 months ago

0.2.7

8 months ago

0.2.6

8 months ago

0.2.5

8 months ago

0.2.4

8 months ago

0.2.3

8 months ago

0.2.0

8 months ago

0.1.0

8 months ago