Skip to content

Commit

Permalink
add nip14.GetSubject()
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Jan 1, 2025
1 parent a4bae38 commit ef0717a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions nip14/subject.go
Original file line number Diff line number Diff line change
@@ -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 ""
}

0 comments on commit ef0717a

Please sign in to comment.