Message Reactions in Telegram

Ok, I was looking where to share, and recall I still pay for this blog’s hosting monthly. So I deceided to drop it here, just in case someone will ever find this via Google and say thanks.

Situation: I have a Telegram bot created 5-6 years ago for testing and I’ve used it to develop some logic. It works. I register new bot for production run via BotFather, put all same settings and new bot is not getting any message reactions, despite it get all other notifications – topics created, files uploaded, etc…
I am using Telegram via Python library, so I am not polling updates manually, but have a thread loop which callbacks my handlers on each message received by bot. I start reading API docs and discover that

Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.

Looks like this is default behaviour and I need find a way to pass at least message_reaction to getUpdates to start polling those. I even forked the library, when another idea came to my mind: I can quickly update the last settings:


$ ipython

import telepotpro
from server.settings import BOT_TOKEN
bot = telepotpro.Bot(BOT_TOKEN)
needed_updates = [ "message", "edited_message", "channel_post", "message_reaction", "message_reaction_count", "chat_member", ]
bot.getUpdates(allowed_updates=needed_updates)

This made my bot set to receive only specific set of updates, but more important – it started to receive message_reaction type of events, which I was interested in.

Blog Update

Мой блог указан, везде где только можно, но актуальной информации с 2012 года тут не появлялось. Это как-бы не очень хорошо, надо вернуться обратно к практике делать здесь небольшие технические заметки о ruby и не только. Интересно, заходил ли сюда кто-нибудь из старых подписчиков или все забыли и забили?