UNPKG

discord-webhook-node

Version:

Allows for easy webhook sending through discord's webhook API

14 lines (12 loc) 346 B
const fetch = require('node-fetch'); module.exports = (hookURL, payload) => new Promise((resolve, reject) => { fetch(hookURL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }) .then(res => resolve(res)) .catch(err => reject(err)); });