Notification webhook for game appeals

This commit is contained in:
regalijan 2023-10-19 16:51:04 -04:00
parent 0259d5e217
commit 34c856b2e6
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -59,6 +59,22 @@ export async function onRequestPost(context: RequestContext) {
"INSERT INTO game_appeals (created_at, id, open, user) VALUES (?, ?, ?, ?);",
).bind(Date.now(), appealId, 1, id);
await fetch(context.env.REPORTS_WEBHOOK, {
body: JSON.stringify({
embeds: [
{
color: 3756250,
description: `${username} has pleaded for forgiveness! Head to https://carcrushers.cc/mod-queue?id=${appealId}&type=gma`,
title: "Appeal Submitted",
},
],
}),
headers: {
"content-type": "application/json",
},
method: "POST",
});
return new Response(null, {
status: 204,
});