Skip to content

Commit edae083

Browse files
committed
event: add Has method for Mentions
1 parent 4e180ee commit edae083

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

event/message.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ func (m *Mentions) Add(userID id.UserID) {
220220
}
221221
}
222222

223+
func (m *Mentions) Has(userID id.UserID) bool {
224+
return m != nil && slices.Contains(m.UserIDs, userID)
225+
}
226+
223227
type EncryptedFileInfo struct {
224228
attachment.EncryptedFile
225229
URL id.ContentURIString `json:"url"`

0 commit comments

Comments
 (0)