diff --git a/README.md b/README.md index db3c5d0..c4a7b0a 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ go func() { for ev := range sub.Events { // handle returned event. // channel will stay open until the ctx is cancelled (in this case, by calling cancel()) - + fmt.Println(ev.ID) } ``` @@ -86,7 +86,7 @@ pub, _ := nostr.GetPublicKey(sk) ev := nostr.Event{ PubKey: pub, - CreatedAt: time.Now(), + CreatedAt: nostr.Now(), Kind: 1, Tags: nil, Content: "Hello World!", diff --git a/example/example.go b/example/example.go index 6eed9c0..cfc6de4 100644 --- a/example/example.go +++ b/example/example.go @@ -52,7 +52,7 @@ func main() { // create a subscription and submit to relay // results will be returned on the sub.Events channel - sub := relay.Subscribe(ctx, filters) + sub, _ := relay.Subscribe(ctx, filters) // we will append the returned events to this slice evs := make([]nostr.Event, 0) @@ -101,7 +101,7 @@ func main() { panic(e) } - ev.CreatedAt = time.Now() + ev.CreatedAt = nostr.Now() ev.Kind = 1 var content string fmt.Fprintln(os.Stderr, "enter content of note, ending with an empty newline (ctrl+d):") @@ -123,6 +123,7 @@ func main() { fmt.Println(e) continue } - fmt.Println("posting to: ", url, relay.Publish(ctx, ev)) + fmt.Println("posting to: ", url) + relay.Publish(ctx, ev) } }