Skip to content

Commit fde05dd

Browse files
committed
feat: add IsTextMention to MessageEntity
1 parent 537c005 commit fde05dd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,12 @@ func (e MessageEntity) IsMention() bool {
754754
return e.Type == "mention"
755755
}
756756

757+
// IsTextMention returns true if the type of the message entity is "text_mention"
758+
// (At this time, the user field exists, and occurs when tagging a member without a username)
759+
func (e MessageEntity) IsTextMention() bool {
760+
return e.Type == "text_mention"
761+
}
762+
757763
// IsHashtag returns true if the type of the message entity is "hashtag".
758764
func (e MessageEntity) IsHashtag() bool {
759765
return e.Type == "hashtag"

0 commit comments

Comments
 (0)