reo7sp / tgbot-cpp

C++ library for Telegram bot API
http://reo7sp.github.io/tgbot-cpp
MIT License
995 stars 238 forks source link

Bug: Api method editMessageText should only take InlineKeboardMarkup #297

Closed paulusel closed 5 months ago

paulusel commented 5 months ago

Telegram's Api method editMessageText expects its keyboard markup to be only InlineKeyboardMarkup as it is explicitly said so in here.

https://core.telegram.org/bots/api#editmessagetext

But right now tgbot-cpp's implementation of the editMessageText takes GenericReply which can take all keyboard markup types. I for one erroneously thought I could send ForceReply type since it is also derived from GenericReply. Compiler didn't complain as the current tgbot-cpp implementation accepts all types. But telegram's api rejected the request which ended in crash due to exception thrown(yes, I should probably start catching exceptions :).