Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32167829
D14092.1765054228.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14092.1765054228.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
Sat, Dec 6, 8:50 PM (13 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5840732
Default Alt Text
D14092.1765054228.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