python-nostr icon indicating copy to clipboard operation
python-nostr copied to clipboard

How to get all replies of an event

Open steveboi123 opened this issue 2 years ago • 1 comments

Let's say I have an event id, How can I find all the replies for that post

steveboi123 avatar Feb 25 '23 22:02 steveboi123

You can do that using the README.md example named "Receive events from relays", but you need to use two filters:

filters = Filters([
    Filter(event_ids=[event_id], kinds=[EventKind.TEXT_NOTE]),
    Filter(event_refs=[event_id], kinds=[EventKind.TEXT_NOTE])
])

I really don't know if it's the most appropriate way but it worked for me. I'm just starting to explore this library.

lndrkzts avatar Feb 27 '23 01:02 lndrkzts