send discord notification when someone joins the waitlist

This commit is contained in:
m5r
2021-08-30 23:05:20 +08:00
parent ab004235f6
commit 5e0c2ae643
2 changed files with 20 additions and 1 deletions

13
integrations/discord.ts Normal file
View File

@ -0,0 +1,13 @@
import got from "got";
type Params = {
id: string;
token: string;
content: string;
};
export function executeWebhook({ id, token, content }: Params) {
const url = `https://discord.com/api/webhooks/${id}/${token}`;
return got.post(url, { json: { content } });
// https://discord.com/api/webhooks/881915196245950485/woZmauH3x-qY0mzIn--66NsrAFCJFvFaYrKDCMgfemVQBzdm86GhiowMOnZ_PezXtSV4
}