From 668e62af91f987bca9232588fd4cce551e1b7f10 Mon Sep 17 00:00:00 2001 From: BitcoinVeneto Date: Sun, 23 Feb 2025 12:08:54 +0100 Subject: [PATCH] Update nostr.py Fix: Update add_relays() to add_relay() in nostr.py Description This PR fixes an issue , the method add_relays() was renamed to add_relay() and now accepts a single string instead of a list. Error Message AttributeError: 'Client' object has no attribute 'add_relays'. Did you mean: 'add_relay'? After changing the code to use add_relay(), another error occurred: The error occurred because the updated add_relay() method expects a string but was passed a list. This was due to the previous usage of add_relays() which accepted a list of URLs. await client.add_relays(["ws://localhost:7777"]) To: await client.add_relay("ws://localhost:7777") --- api/nostr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/nostr.py b/api/nostr.py index 75b442ee..481a2916 100644 --- a/api/nostr.py +++ b/api/nostr.py @@ -25,7 +25,7 @@ class Nostr: client = Client(signer) # Add relays and connect - await client.add_relays(["ws://localhost:7777"]) + await client.add_relay("ws://localhost:7777") await client.connect() robot_name = await self.get_robot_name(order)