Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3448522
D14093.id46269.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14093.id46269.diff
View Options
diff --git a/keyserver/src/responders/farcaster-webhook-responders.js b/keyserver/src/responders/farcaster-webhook-responders.js
--- a/keyserver/src/responders/farcaster-webhook-responders.js
+++ b/keyserver/src/responders/farcaster-webhook-responders.js
@@ -37,6 +37,7 @@
import { getVerifiedUserIDForFID } from '../utils/farcaster-utils.js';
import { neynarClient, fcCache } from '../utils/fc-cache.js';
import { getNeynarConfig } from '../utils/neynar-utils.js';
+import { getAndAssertKeyserverURLFacts } from '../utils/urls.js';
const taggedCommFarcasterInputValidator =
neynarWebhookCastCreatedEventValidator;
@@ -215,7 +216,7 @@
const event = assertWithValidator(body, taggedCommFarcasterInputValidator);
const {
- author: { fid: eventTaggerFID },
+ author: { fid: eventTaggerFID, username: eventTaggerUsername },
text: eventText,
channel: eventChannel,
} = event.data;
@@ -316,8 +317,12 @@
neynarConfigPromise,
]);
- const introText = 'I created a thread on Comm. Join the conversation here:';
- const replyText = `${introText} ${inviteLinkURL(inviteLink.name)}`;
+ const { baseDomain, basePath } = getAndAssertKeyserverURLFacts();
+ const keyserverURL = baseDomain + basePath;
+
+ const frameEmbedURL = `${keyserverURL}frog/${encodeURIComponent(
+ inviteLinkURL(inviteLink.name),
+ )}/${eventChannelID ?? 'comm'}/${eventTaggerUsername}`;
if (!neynarConfig?.signerUUID) {
throw new ServerError('missing_signer_uuid');
@@ -326,7 +331,11 @@
const postCastResponse = await neynarClient?.postCast({
signerUUID: neynarConfig.signerUUID,
parent: castHash,
- text: replyText,
+ embeds: [
+ {
+ url: frameEmbedURL,
+ },
+ ],
});
if (!postCastResponse?.success) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 13, 12:52 AM (20 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2649631
Default Alt Text
D14093.id46269.diff (1 KB)
Attached To
Mode
D14093: [keyserver] replace farcaster bot reply text with frame
Attached
Detach File
Event Timeline
Log In to Comment