Fix nostr-sdk method usage

This commit is contained in:
thePR0M3TH3AN
2025-06-30 23:29:00 -04:00
parent 87ab2ac3b6
commit c51b0d7567

View File

@@ -90,7 +90,7 @@ class NostrClient:
# Use the EventBuilder to create and sign the event # Use the EventBuilder to create and sign the event
event = ( event = (
EventBuilder.text_note(content, []) EventBuilder.text_note(content)
.build(self.keys.public_key()) .build(self.keys.public_key())
.sign_with_keys(self.keys) .sign_with_keys(self.keys)
) )
@@ -116,14 +116,13 @@ class NostrClient:
f = ( f = (
Filter() Filter()
.author(pubkey) .author(pubkey)
.kind(Kind.from_standard(KindStandard.TEXT_NOTE)) .kind(Kind.from_std(KindStandard.TEXT_NOTE))
.limit(1) .limit(1)
) )
# Use the simple, synchronous get_events_of method # Use the synchronous fetch_events method
# Set a reasonable timeout
timeout = timedelta(seconds=10) timeout = timedelta(seconds=10)
events = self.client.get_events_of([f], timeout) events = self.client.fetch_events(f, timeout).to_vec()
if not events: if not events:
logger.warning("No events found on relays for this user.") logger.warning("No events found on relays for this user.")