Discord webhooks wrapper
Go to file
2023-04-12 21:10:26 +03:00
src Allow sending embeds 2023-04-12 17:22:36 +03:00
test Allow sending embeds 2023-04-12 17:22:36 +03:00
.eslintrc.json Project files 2023-04-12 16:37:37 +03:00
.gitignore Project files 2023-04-12 16:37:37 +03:00
index.ts readme 2023-04-12 16:43:56 +03:00
package.json v1.1.1 2023-04-12 21:10:26 +03:00
README.md readme 2023-04-12 16:43:56 +03:00
tsconfig.json Project files 2023-04-12 16:37:37 +03:00
yarn.lock Project files 2023-04-12 16:37:37 +03:00

Discord Webhook

Wrapper for Discord's webhooks.
Doesn't do much, takes care of rate limits, allows sending of messages to Discord webhooks.

Example

import WebhookClient from '@navy.gif/discord-webhook';

const webhook = new WebhookClient({url: 'https://discord.com/api/webhooks/ID/TOKEN'});  
// or  
const webhook = new WebhookClient({id: 'ID', token: 'TOKEN'});  

// Ensure webhook exists, discord doesn't like you if you try to send a request to webhooks that don't exist  
// Throws an error if it doesn't exist  
await webhook.fetch();  

// send message
await webhook.send('Hello from Node.js');