mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-05-03 15:20:13 +02:00
use StringBytes() instead of String()
This commit is contained in:
parent
74c646fe21
commit
75a07daf7b
@ -17,7 +17,8 @@ func main() {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
|
||||
|
||||
// connect to relay
|
||||
url := "wss://nostr.zebedee.cloud"
|
||||
//url := "wss://nostr.zebedee.cloud"
|
||||
url := "wss://nostr-relay.nokotaro.com"
|
||||
relay, err := nostr.RelayConnect(ctx, url)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@ -116,7 +117,7 @@ func main() {
|
||||
}
|
||||
ev.Content = strings.TrimSpace(content)
|
||||
ev.Sign(sk)
|
||||
for _, url := range []string{"wss://nostr.zebedee.cloud"} {
|
||||
for _, url := range []string{"wss://nostr-relay.nokotaro.com"} {
|
||||
ctx := context.WithValue(context.Background(), "url", url)
|
||||
relay, e := nostr.RelayConnect(ctx, url)
|
||||
if e != nil {
|
||||
|
@ -62,7 +62,11 @@ func (f *Filter) UnmarshalJSON(payload []byte) error {
|
||||
}
|
||||
f.Limit = val
|
||||
case "search":
|
||||
f.Search = v.String()
|
||||
val, err := v.StringBytes()
|
||||
if err != nil {
|
||||
visiterr = fmt.Errorf("invalid 'search' field: %w", err)
|
||||
}
|
||||
f.Search = string(val)
|
||||
default:
|
||||
if strings.HasPrefix(key, "#") {
|
||||
f.Tags[key[1:]], err = fastjsonArrayToStringList(v)
|
||||
|
Loading…
x
Reference in New Issue
Block a user