Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

Latest commit

 

History

History
22 lines (16 loc) · 774 Bytes

File metadata and controls

22 lines (16 loc) · 774 Bytes

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.
});