Notification webhook for game appeals
This commit is contained in:
parent
0259d5e217
commit
34c856b2e6
@ -59,6 +59,22 @@ export async function onRequestPost(context: RequestContext) {
|
|||||||
"INSERT INTO game_appeals (created_at, id, open, user) VALUES (?, ?, ?, ?);",
|
"INSERT INTO game_appeals (created_at, id, open, user) VALUES (?, ?, ?, ?);",
|
||||||
).bind(Date.now(), appealId, 1, id);
|
).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, {
|
return new Response(null, {
|
||||||
status: 204,
|
status: 204,
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user