From dca8e2d82c5f20e52ce0abf69027be1de1be8732 Mon Sep 17 00:00:00 2001 From: Ramin Date: Thu, 10 Oct 2024 15:21:40 +0330 Subject: [PATCH] fix praising praise handle --- src/routes/bot.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/bot.ts b/src/routes/bot.ts index ecc93e7..6940d91 100644 --- a/src/routes/bot.ts +++ b/src/routes/bot.ts @@ -36,7 +36,7 @@ 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 isPraiseHandleReceiver = text.startsWith(`@${praiseHandle} to @${praiseHandle}`); - const praiseReceiver = isPraiseHandleReceiver ? praiseHandle : mentioned_profiles.find((profile: any) => profile.username !== praiseHandle) + const praiseReceiver = mentioned_profiles.find((profile: any) => isPraiseHandleReceiver ? profile.username === praiseHandle : profile.username !== praiseHandle) if (!praiseReceiver) { await neynarClient.publishCast( process.env.SIGNER_UUID,