From 6f4cd5547a4ba1b01e966404eb6985b3c1dbf503 Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Sat, 5 Feb 2022 10:19:18 -0500 Subject: [PATCH] Support animated emoji messages --- telegram/utils.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/telegram/utils.go b/telegram/utils.go index 5b0e2ca..00bf93f 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -376,8 +376,8 @@ func (c *Client) formatLocation(location *client.Location) string { func (c *Client) messageToText(message *client.Message) string { if message.Content == nil { - log.Warnf("Unknown message (big emoji?): %#v", message) - return "" + log.Warnf("Unknown message: %#v", message) + return "" } markupFunction := formatter.EntityToXEP0393 @@ -385,6 +385,9 @@ func (c *Client) messageToText(message *client.Message) string { case client.TypeMessageSticker: sticker, _ := message.Content.(*client.MessageSticker) return sticker.Sticker.Emoji + case client.TypeMessageAnimatedEmoji: + animatedEmoji, _ := message.Content.(*client.MessageAnimatedEmoji) + return animatedEmoji.Emoji case client.TypeMessageBasicGroupChatCreate, client.TypeMessageSupergroupChatCreate: return "has created chat" case client.TypeMessageChatJoinByLink: