Merge pull request #575 from niuhuan/text_mention

feat: add IsTextMention to MessageEntity
bot-api-6.1
Syfaro 2022-10-19 20:27:56 -04:00 committed by GitHub
commit 52781318c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -754,6 +754,12 @@ func (e MessageEntity) IsMention() bool {
return e.Type == "mention"
}
// IsTextMention returns true if the type of the message entity is "text_mention"
// (At this time, the user field exists, and occurs when tagging a member without a username)
func (e MessageEntity) IsTextMention() bool {
return e.Type == "text_mention"
}
// IsHashtag returns true if the type of the message entity is "hashtag".
func (e MessageEntity) IsHashtag() bool {
return e.Type == "hashtag"