import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
export async function handleDiscordNewUser(req: Request): Promise<Response> {
if (req.headers.get("auth") !== Deno.env.get("clerkNonSensitive"))
return new Response("Unauthorized", { "status": 401 });
const body = await req.json();
await discordWebhook({
url: Deno.env.get("discordUserEvents"),
content: body.data.email_addresses[0].email_address
+ " "
+ body.data.profile_image_url,
});
return new Response("Success");
}