Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Notification webhook for game appeals
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 0259d5e commit 34c856b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions functions/api/game-appeals/submit.ts
Expand Up @@ -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,
});
Expand Down

0 comments on commit 34c856b

Please sign in to comment.