From 5f0b1ffe79956d2693cdb6f8068f6b2b144d50d2 Mon Sep 17 00:00:00 2001 From: Siddharth Singh Date: Tue, 2 Jul 2024 04:56:38 +0530 Subject: [PATCH] fetch profiles separately from notes --- scripts/nostr-pull.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/nostr-pull.ts b/scripts/nostr-pull.ts index 03e389cb..d215e435 100644 --- a/scripts/nostr-pull.ts +++ b/scripts/nostr-pull.ts @@ -32,9 +32,11 @@ const importUsers = async ( await Promise.all(relays.map(async (relay) => { if (!relay.startsWith('wss://')) console.error(`Invalid relay url ${relay}`); const conn = new NRelay1(relay); - const kinds = [0, 3]; - if (!profilesOnly) kinds.push(1); - const matched = await conn.query([{ kinds, authors, limit: 1000 }]); + + const matched = [ + ...await conn.query([{ kinds: [0, 3], authors, limit: 1000 }]), + ...(!profilesOnly ? [] : await conn.query([{ kinds: [1], authors, limit: 1000 }])), + ]; await conn.close(); await Promise.all( matched.map(async (event) => {