Skip to content

Commit

Permalink
enhance error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
RamRamez committed Aug 23, 2024
1 parent 4dde37f commit 4798ff6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/routes/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ Please mention a Farcaster account to praise for`,
console.log("Replied with error: no Farcaster account mentioned!");
return new Response(`Replied to the cast with error: no Farcaster account mentioned`);
}
if (!channel?.name) {
await neynarClient.publishCast(
process.env.SIGNER_UUID,
`GM ${author.username}!
Please cast in a channel to praise`,
{
replyTo: hash,
}
);
console.log("Replied with error: no channel mentioned!");
return new Response(`Replied to the cast with error: no channel mentioned`);
}
let forIndex = text.indexOf('for');
let reason
if (forIndex !== -1) {
Expand Down

0 comments on commit 4798ff6

Please sign in to comment.