diff --git a/keyserver/src/responders/farcaster-webhook-responders.js b/keyserver/src/responders/farcaster-webhook-responders.js index 9040e7a28..6d60dd8c3 100644 --- a/keyserver/src/responders/farcaster-webhook-responders.js +++ b/keyserver/src/responders/farcaster-webhook-responders.js @@ -1,20 +1,28 @@ // @flow import type { $Request } from 'express'; import { neynarWebhookCastCreatedEventValidator } from 'lib/types/validators/farcaster-webhook-validators.js'; import { assertWithValidator } from 'lib/utils/validation-utils.js'; const taggedCommFarcasterInputValidator = neynarWebhookCastCreatedEventValidator; +const threadHashTagRegex = /\B#createathread\b/i; async function taggedCommFarcasterResponder(request: $Request): Promise { const event = assertWithValidator( request.body, taggedCommFarcasterInputValidator, ); + const { text: eventText } = event.data; + const foundCreateThreadHashTag = threadHashTagRegex.test(eventText); + + if (!foundCreateThreadHashTag) { + return; + } + console.log(event); } export { taggedCommFarcasterResponder, taggedCommFarcasterInputValidator };