diff --git a/nip14/subject.go b/nip14/subject.go new file mode 100644 index 0000000..84c9ddf --- /dev/null +++ b/nip14/subject.go @@ -0,0 +1,12 @@ +package nip14 + +import "github.com/nbd-wtf/go-nostr" + +func GetSubject(tags nostr.Tags) string { + for _, tag := range tags { + if len(tag) >= 2 && tag[0] == "subject" { + return tag[1] + } + } + return "" +}