telegram-bot-api icon indicating copy to clipboard operation
telegram-bot-api copied to clipboard

feat: add IsTextMention to MessageEntity

Open niuhuan opened this issue 3 years ago • 0 comments

This works when we tag a member without a username, It is different from a mention.

for _, entity := range message.Entities {
	if entity.IsTextMention() {
		println(entity.User.ID)
	}
	if entity.IsMention() {
		println(message.Text[entity.Offset:entity.Offset+entity.Length])
	}
}

niuhuan avatar Aug 12 '22 03:08 niuhuan