1.0.0 • Published 5 years ago

webhook.space v1.0.0

Weekly downloads
12
License
MIT
Repository
github
Last release
5 years ago

Webhook.Space

A random webhook thing.

Some code is referenced from dbl-api's source code

const Space = require('webhook.space');

// options.port (?number) => The port to listen for.
// options.path (?string) => The path/endpoint to watch for POSTs.
// options.token (?string) => The bot/guild's API token to validate an upvote.
const Webhook = new Space.Webhook({ port: 1234, path: '/', token: null });

 // Deactivate/reactivate the webhook.
Webhook.close().open();

 // The upvote event.
Webhook.on('upvote', (body, headers) => {
    // Do something with the body and/or headers.
});