Skip to content

Commit

Permalink
hmm
Browse files Browse the repository at this point in the history
Signed-off-by: CyberFlame <[email protected]>
  • Loading branch information
CyberFlameGO authored Oct 27, 2024
1 parent 7c4742e commit b5726ed
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
});

Expand Down

0 comments on commit b5726ed

Please sign in to comment.