diff --git a/src/server.ts b/src/server.ts index 6c307c2..91519b2 100644 --- a/src/server.ts +++ b/src/server.ts @@ -249,9 +249,23 @@ router.post('/webhooks', async (c) => { const interaction = await c.req.json(); switch (interaction["type"]) { - case "PING": { - return new Response({status: 204}) - } + case 0: + return new Response(null, { status: 204 }) + + case 1: + switch (interaction["event"]["type"]) { + switch (event.data.integration_type) { + case 0: /*Guild Install*/ break; + case 1: /*User Install*/ break; + // Default case for things like website login + } + break; + case 'ENTITLEMENT_CREATE': break; + case 'QUEST_USER_ENROLLMENT': break; + } + return new Response(null, { status: 204 }); + default: + return new Response('invalid request', { status: 400 }); } });