Discord webhooks wrapper
Go to file
Navy 34afc658e7 Bugfix
* Fixed buggy ratelimit handler
2024-11-23 14:51:01 +02:00
.yarn/releases Bugfix 2024-11-23 14:51:01 +02:00
scripts switch to node-fetch@2 to remain compatible w/ cjs 2023-04-12 21:27:17 +03:00
src Bugfix 2024-11-23 14:51:01 +02:00
test linter pass + export types 2023-07-16 00:37:52 +03:00
.eslintrc.json Bugfix 2024-11-23 14:51:01 +02:00
.gitignore Bugfix 2024-11-23 14:51:01 +02:00
.yarnrc.yml Bugfix 2024-11-23 14:51:01 +02:00
eslint.config.mjs Bugfix 2024-11-23 14:51:01 +02:00
index.ts linter pass + export types 2023-07-16 00:37:52 +03:00
package.json Bugfix 2024-11-23 14:51:01 +02:00
README.md
tsconfig.cjs.json switch to node-fetch@2 to remain compatible w/ cjs 2023-04-12 21:27:17 +03:00
tsconfig.json linter pass + export types 2023-07-16 00:37:52 +03:00
yarn.lock Bugfix 2024-11-23 14:51:01 +02: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');