mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-17 13:22:56 +01:00
37 lines
696 B
Go
37 lines
696 B
Go
package nip29
|
|
|
|
import (
|
|
"slices"
|
|
|
|
"github.com/nbd-wtf/go-nostr"
|
|
)
|
|
|
|
type Role struct {
|
|
Name string
|
|
Description string
|
|
}
|
|
|
|
type KindRange []int
|
|
|
|
var ModerationEventKinds = KindRange{
|
|
nostr.KindSimpleGroupPutUser,
|
|
nostr.KindSimpleGroupRemoveUser,
|
|
nostr.KindSimpleGroupEditMetadata,
|
|
nostr.KindSimpleGroupDeleteEvent,
|
|
nostr.KindSimpleGroupCreateGroup,
|
|
nostr.KindSimpleGroupDeleteGroup,
|
|
nostr.KindSimpleGroupCreateInvite,
|
|
}
|
|
|
|
var MetadataEventKinds = KindRange{
|
|
nostr.KindSimpleGroupMetadata,
|
|
nostr.KindSimpleGroupAdmins,
|
|
nostr.KindSimpleGroupMembers,
|
|
nostr.KindSimpleGroupRoles,
|
|
}
|
|
|
|
func (kr KindRange) Includes(kind int) bool {
|
|
_, ok := slices.BinarySearch(kr, kind)
|
|
return ok
|
|
}
|