fix: put /interaction to try catch

This commit is contained in:
xHyroM 2022-07-13 07:57:13 +02:00
parent 7e08e12fec
commit a6e7afc01d

View file

@ -24,6 +24,7 @@ const app = new Hono();
app.get('*', (c) => c.redirect('https://www.youtube.com/watch?v=FMhScnY0dME')); app.get('*', (c) => c.redirect('https://www.youtube.com/watch?v=FMhScnY0dME'));
app.post('/interaction', bodyParse(), async(c) => { app.post('/interaction', bodyParse(), async(c) => {
try {
const signature = c.req.headers.get('X-Signature-Ed25519'); const signature = c.req.headers.get('X-Signature-Ed25519');
const timestamp = c.req.headers.get('X-Signature-Timestamp'); const timestamp = c.req.headers.get('X-Signature-Timestamp');
if (!signature || !timestamp) return c.redirect('https://www.youtube.com/watch?v=FMhScnY0dME'); // fireship :D if (!signature || !timestamp) return c.redirect('https://www.youtube.com/watch?v=FMhScnY0dME'); // fireship :D
@ -75,6 +76,9 @@ app.post('/interaction', bodyParse(), async(c) => {
content: 'Beep boop. Boop beep?' content: 'Beep boop. Boop beep?'
} }
}); });
} catch(e) {
console.log(e);
}
}) })
await Bun.serve({ await Bun.serve({