Skip to content

Commit 1ed1929

Browse files
committed
Update farcaster.js
1 parent fd865f7 commit 1ed1929

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

farcaster.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,11 @@ class Farcaster {
7676
}
7777

7878
async sendDirectMessage(recipientFid, message ) {
79+
const recipientId = parseInt(recipientFid);
80+
const agentId = parseInt(this.agentFID);
81+
const conversationId = [recipientId, agentId].sort((a, b) => a - b).join('-');
7982
return this.#makeApiCall('/direct-cast-send', 'PUT', {
80-
conversationId: `${recipientFid}-${this.agentFID}`,
83+
conversationId,
8184
message,
8285
type: "text",
8386
recipientFids: [recipientFid],

0 commit comments

Comments
 (0)