Skip to content

Conversation

BitcoinVeneto
Copy link
Contributor

What does this PR do?

This PR fixes an issue where the method add_relays() was renamed to add_relay()

Checklist before merging

  • Install pre-commit and initialize it: pip install pre-commit, then pre-commit install. Pre-commit installs git hooks that automatically check the codebase. If pre-commit fails when you commit your changes, please fix the problems it points out.

Update italian translation
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")
Copy link
Member

@KoalaSat KoalaSat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix!

@KoalaSat KoalaSat merged commit 6a182b2 into RoboSats:main Feb 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants