From fde05dd128a5e2c022eb2236bfa1c99f6f8e1d82 Mon Sep 17 00:00:00 2001 From: niuhuan Date: Fri, 12 Aug 2022 11:43:40 +0800 Subject: [PATCH] feat: add IsTextMention to MessageEntity --- types.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types.go b/types.go index cb77528..2ef6207 100644 --- a/types.go +++ b/types.go @@ -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"