add nip14.GetSubject()

This commit is contained in:
fiatjaf 2024-12-31 22:45:14 -03:00
parent a4bae38f68
commit ef0717afb6

12
nip14/subject.go Normal file
View File

@ -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 ""
}