Page MenuHomePhabricator

D14092.diff
No OneTemporary

D14092.diff

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

Mime Type
text/plain
Expires
Fri, Dec 13, 1:06 AM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2649732
Default Alt Text
D14092.diff (1 KB)

Event Timeline