Actually only print last message
This commit is contained in:
		
							parent
							
								
									cc3afe1eaa
								
							
						
					
					
						commit
						a6e9198e86
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		
							
								
								
									
										2
									
								
								main.ts
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								main.ts
									
									
									
									
									
								
							|  | @ -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; | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue