From 91731f8039e1024a595e3a82b807ec83fc8b9599 Mon Sep 17 00:00:00 2001 From: Ramin Date: Tue, 10 Sep 2024 01:11:38 +0330 Subject: [PATCH] add logs --- src/routes/bot.ts | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/routes/bot.ts b/src/routes/bot.ts index 56c7381..58c7985 100644 --- a/src/routes/bot.ts +++ b/src/routes/bot.ts @@ -69,19 +69,24 @@ Please cast in a channel to praise`, recipientName: praiseReceiver.username, praiseHash: hash, }; - - const reply = await neynarClient.publishCast( - process.env.SIGNER_UUID, - 'Woo! Let\'s mint Praise attestation to your friends account 🎉 Thanks for helping to foster a culture of on-chain gratitude!', - { - embeds: [ - { - url: process.env.APP_URL + '?' + new URLSearchParams(query), - }, - ], - replyTo: hash, - } - ); + let reply; + try { + reply = await neynarClient.publishCast( + process.env.SIGNER_UUID, + 'Woo! Let\'s mint Praise attestation to your friends account 🎉 Thanks for helping to foster a culture of on-chain gratitude!', + { + embeds: [ + { + url: process.env.APP_URL + '?' + new URLSearchParams(query), + }, + ], + replyTo: hash, + } + ); + } catch (e){ + console.log("send frame error: " + e); + return new Response('Error: ' + e); + } console.log("Replied with frame! Date: " + new Date() + ' hash: ' + reply.hash); return new Response(`Replied to the cast with hash: ${reply.hash}`); }