add NIP65 relay announcement, add blastr option to send_event function

This commit is contained in:
Believethehype
2024-06-03 17:04:08 +02:00
parent dd1ba27708
commit f3d894e4dc
5 changed files with 58 additions and 28 deletions

View File

@@ -104,7 +104,7 @@ def get_referenced_event_by_id(event_id, client, dvm_config, kinds) -> Event | N
return None
def send_event(event: Event, client: Client, dvm_config) -> EventId:
def send_event(event: Event, client: Client, dvm_config, blastr=False) -> EventId:
try:
relays = []
@@ -118,12 +118,16 @@ def send_event(event: Event, client: Client, dvm_config) -> EventId:
if relay not in dvm_config.RELAY_LIST:
client.add_relay(relay)
if blastr:
client.add_relay("wss://nostr.mutinywallet.com")
event_id = client.send_event(event)
for relay in relays:
if relay not in dvm_config.RELAY_LIST:
client.remove_relay(relay)
if blastr:
client.remove_relay("wss://nostr.mutinywallet.com")
return event_id
except Exception as e:
print(e)