mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-10-10 23:22:38 +02:00
Update nostr_utils.py
This commit is contained in:
@@ -166,8 +166,9 @@ async def send_event_outbox(event: Event, client, dvm_config) -> EventId:
|
||||
# 4. If we don't find inbox relays (e.g. because the user didn't announce them, we just send to our default relays
|
||||
if len(relays) == 0:
|
||||
print("[" + dvm_config.NIP89.NAME + "] No Inbox found, replying to generic relays")
|
||||
eventid = await send_event(event, client, dvm_config)
|
||||
return eventid
|
||||
relays = dvm_config.RELAY_LIST
|
||||
#eventid = await send_event(event, client, dvm_config)
|
||||
#return eventid
|
||||
|
||||
# 5. Otherwise, we create a new Outbox client with the inbox relays and send the event there
|
||||
relaylimits = RelayLimits.disable()
|
||||
@@ -188,16 +189,15 @@ async def send_event_outbox(event: Event, client, dvm_config) -> EventId:
|
||||
print("[" + dvm_config.NIP89.NAME + "] " + relay + " couldn't be added to outbox relays")
|
||||
|
||||
await outboxclient.connect()
|
||||
try:
|
||||
event_id = await outboxclient.send_event(event)
|
||||
except:
|
||||
event_id = await send_event(event, client, dvm_config)
|
||||
|
||||
event_id = await outboxclient.send_event(event)
|
||||
await outboxclient.shutdown()
|
||||
|
||||
return event_id
|
||||
|
||||
|
||||
|
||||
|
||||
async def send_event(event: Event, client: Client, dvm_config, blastr=False) -> EventId:
|
||||
try:
|
||||
relays = []
|
||||
|
Reference in New Issue
Block a user