khatru: update docs again, now it seems to be mostly up to date.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user