@loldonut/discord-webhooks
v1.0.0
Published
'discord-webhooks' manages Discord's Webhooks.
Downloads
3
Readme
discord-webhooks
discord-webhooks
manages Discord's Webhooks
Installation
npm install loldonut/discord-webhooks
Example
const { Webhook } = require('discord-webhooks');
// You can also pass a string with URL instead.
const webhook = new Webhook({
id: ID,
token: TOKEN,
});
webhook.once('ready', async (w) => {
await w.send({
content: 'Hello, World.'
});
});
You can pass the URL in a string instead of an Object for the webhook credentials.
Note that you must use Websocket#send()
inside the ready
event
so the function will have your webhook's ID and Token.