Given:
- Telegram channel
- Telegram group
- Telegram bot with long polling strategy on board which handles all updates
- Messages with reply markup buttons
- Bot is based on https://github.com/rubenlagus/TelegramBots
Action:
Click any button twice (or more) in short period of time (1-2 seconds)
Problem:
When I click buttons in group - everything is ok, but when I click same buttons with same logic in channel:
The first api call executes very fast But the second api call needs about 5 seconds to get responded, which freezes business logic and gets user annoyed
Methods:
private fun updateChatMarkup(messageId: Int, votes: Map<VoteValue, Int>) =
EditMessageReplyMarkup()
.setChatId(chatId)
.setMessageId(messageId)
.setReplyMarkup(createMarkup(votes)).let { execute(it) }
private fun updateChannelMarkup(messageId: Int, votes: Map<VoteValue, Int>) =
EditMessageReplyMarkup()
.setChatId(channelId)
.setMessageId(messageId)
.setReplyMarkup(createMarkup(votes, messageId)).let { execute(it) }