Page MenuHomePhabricator

D14092.id46265.diff
No OneTemporary

D14092.id46265.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,
+ const body: {
+ signer_uuid: string,
+ parent: string,
+ text?: string,
+ embeds?: $ReadOnlyArray<{ +url: string }>,
+ } = {
+ signer_uuid: params.signerUUID,
parent,
- text,
};
+
+ 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:43 AM (20 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2649796
Default Alt Text
D14092.id46265.diff (1 KB)

Event Timeline