khatru: update docs again, now it seems to be mostly up to date.

This commit is contained in:
fiatjaf
2025-10-20 18:22:08 -03:00
parent e1fbd09407
commit 8cf120c08f
10 changed files with 40 additions and 27 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ These are lists of functions that will be called in order every time an `EVENT`
The next step is adding some protection, because maybe we don't want to allow _anyone_ to write to our relay. Maybe we want to only allow people that have a pubkey starting with `"a"`, `"b"` or `"c"`:
```go
relay.OnEvent = func (ctx context.Context, event *nostr.Event) (reject bool, msg string) {
relay.OnEvent = func (ctx context.Context, event nostr.Event) (reject bool, msg string) {
firstHexChar := event.PubKey.Hex()[0:1]
if firstHexChar == "a" || firstHexChar == "b" || firstHexChar == "c" {
return false, "" // allow