Skip to content

Commit

Permalink
fix praising praise handle
Browse files Browse the repository at this point in the history
  • Loading branch information
RamRamez committed Oct 10, 2024
1 parent abaaf55 commit fcfb660
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routes/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Add your reason for giving praise at the end of the comment and double check tha
}
const praiseHandle = process.env.PRAISE_FARCASTER_HANDLE;
// TODO: Should consider only first mention as praise receiver
const praiseReceiver = mentioned_profiles.find((profile: any) => profile.username !== praiseHandle)
const isPraiseHandleReceiver = text.startsWith(`@${praiseHandle} to @${praiseHandle}`);
const praiseReceiver = isPraiseHandleReceiver ? praiseHandle : mentioned_profiles.find((profile: any) => profile.username !== praiseHandle)
if (!praiseReceiver) {
await neynarClient.publishCast(
process.env.SIGNER_UUID,
Expand Down

0 comments on commit fcfb660

Please sign in to comment.