This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Code for a webhook api | |
Example usage:*/ | |
// http://localhost:3000/webhook?url=https://canary.discord.com/api/webhooks/hook-id/hook-token&message=xdd&username=yoo``` | |
js | |
const express = require("express"); | |
const app = express(); | |
const { WebhookClient: hook } = require("discord.js"); //webhook client sounds shit so i renamed it to hook! | |
app.get("/webhook", async (req, res) => { | |
//destructred query params | |
const { url, message, avatarUrl, username } = req.query; |