Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3448559
D14092.id46270.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
D14092.id46270.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
@@ -323,11 +323,11 @@
throw new ServerError('missing_signer_uuid');
}
- const postCastResponse = await neynarClient?.postCast(
- neynarConfig.signerUUID,
- castHash,
- replyText,
- );
+ const postCastResponse = await neynarClient?.postCast({
+ signerUUID: neynarConfig.signerUUID,
+ parent: castHash,
+ text: replyText,
+ });
if (!postCastResponse?.success) {
throw new ServerError('post_cast_failed');
diff --git a/lib/utils/neynar-client.js b/lib/utils/neynar-client.js
--- a/lib/utils/neynar-client.js
+++ b/lib/utils/neynar-client.js
@@ -345,17 +345,29 @@
}
}
- async postCast(
- signerUUID: string,
- parent: string,
- text: string,
- ): Promise<NeynarPostCastResponse> {
+ async postCast(params: {
+ +signerUUID: string,
+ +parent: string,
+ +text?: ?string,
+ +embeds?: ?$ReadOnlyArray<{ +url: string }>,
+ }): Promise<NeynarPostCastResponse> {
const url = getNeynarURL('2', 'cast', {});
- const body = {
- signer_uuid: signerUUID,
- parent,
- text,
+ const body: {
+ signer_uuid: string,
+ parent: string,
+ text?: string,
+ embeds?: $ReadOnlyArray<{ +url: string }>,
+ } = {
+ signer_uuid: params.signerUUID,
+ parent: params.parent,
};
+
+ if (params.embeds) {
+ body.embeds = params.embeds;
+ }
+ if (params.text) {
+ body.text = params.text;
+ }
try {
const response = await fetch(url, {
method: 'POST',
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 13, 1:50 AM (20 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2649732
Default Alt Text
D14092.id46270.diff (1 KB)
Attached To
Mode
D14092: [lib] include embeds in neynar client's postCast method
Attached
Detach File
Event Timeline
Log In to Comment