aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2022-02-05 18:19:18 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2022-02-05 18:19:18 +0300
commit6f4cd5547a4ba1b01e966404eb6985b3c1dbf503 (patch)
treec7cd21a88ecd90594d032fa80640c3c81b86aafd
parentab1af4524754f8fc4d0b40927ea58a30a9d2001f (diff)
Support animated emoji messages
-rw-r--r--telegram/utils.go7
1 files 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 "<BIG EMOJI>"
+ log.Warnf("Unknown message: %#v", message)
+ return "<empty message>"
}
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: