strfry icon indicating copy to clipboard operation
strfry copied to clipboard

Needing help about "created_at too early" problem

Open papiche opened this issue 8 months ago • 0 comments

I am willing to use "nostr-ai-bot", to try an IA auto replier

https://github.com/papiche/nostr-ai-bot/blob/main/main.py

uses pynostr method for sending event

resp = respond(content)
note_event = Event(kind=EventKind.TEXT_NOTE, content=resp)

# Reply is Not working :
note_event.add_event_ref(event.id)
note_event.add_pubkey_ref(event.pubkey)
note_event.sign(private_key.hex())

print(f"Constructed note_event: {json.dumps(note_event.to_dict(), indent=2)}") # Log note_event JSON

try: # ADD TRY-EXCEPT BLOCK AROUND PUBLISH
    print("--> Publishing public reply event to relays...")
    relay_manager.publish_event(note_event)
    print("<-- Public reply event published to relays.") 

but i got problem : it Is rejected by strfry


avril 08 16:39:24 relay.copylaradio.com start.sh[1400977]: 2025-04-08 16:39:24.222 (6685.881s) [Websocket       ]INFO| HTTP request for [/]
avril 08 16:39:25 relay.copylaradio.com start.sh[1400977]: 2025-04-08 16:39:25.104 (6686.763s) [Ingester 0      ]INFO| Rejected invalid event: created_at too early

How could i get more log with strfry ?

Client & server are time sync, but with 1h UTC different zone, is it a problem? I am posting this issue because I am stuck in front of a wall, and may be someone here could help me understanding what is the real problem ?

Thanks

papiche avatar Apr 08 '25 15:04 papiche