all repos — telegram-bot-api @ 52781318c69c967474efcf0c95cfd6487a72a282

Golang bindings for the Telegram Bot API

Merge pull request #575 from niuhuan/text_mention

feat: add IsTextMention to MessageEntity
Syfaro syfaro@huefox.com
Wed, 19 Oct 2022 20:27:56 -0400
commit

52781318c69c967474efcf0c95cfd6487a72a282

parent

e404d8bf5e706c521788ab59082f289a3afb551e

1 files changed, 6 insertions(+), 0 deletions(-)

jump to
M types.gotypes.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"