1
0
Fork 0

Actually only print last message

This commit is contained in:
Sjors Provoost 2024-09-06 11:21:35 +02:00
parent cc3afe1eaa
commit a6e9198e86
Signed by: sjors
GPG key ID: 57FF9BDBCC301009

View file

@ -54,7 +54,7 @@ const relay = new NRelay1(relay_str);
console.log("\nAs a sanity check, here's your last message (if any):"); console.log("\nAs a sanity check, here's your last message (if any):");
for await (const msg of relay.req([{ kinds: [1], limit: 960, authors: [pubkey_hex] }])) { for await (const msg of relay.req([{ kinds: [1], limit: 1, authors: [pubkey_hex] }])) {
if (msg[0] === 'EVENT') console.log(msg[2].content); if (msg[0] === 'EVENT') console.log(msg[2].content);
if (msg[0] === 'EOSE') break; if (msg[0] === 'EOSE') break;
} }