Me when new webhook

This commit is contained in:
Regalijan 2024-02-19 19:47:36 -05:00
parent dad288ca56
commit 1e7fab9a38
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -76,6 +76,22 @@ export async function onRequestPost(context: RequestContext) {
)
.run();
await fetch(context.env.EVENTS_WEBHOOK, {
body: JSON.stringify({
embeds: [
{
title: "Event Submitted",
color: 3756250,
description: `${context.data.user.username} submitted an event for ${currentYear}-${currentMonth}-${day}. See it at https://carcrushers.cc/events-team`,
},
],
}),
headers: {
"content-type": "application/json",
},
method: "POST",
});
return new Response(null, {
status: 204,
});