ebeneditos / telegram.bot

Develop a Telegram Bot with R
https://ebeneditos.github.io/telegram.bot/
GNU General Public License v3.0
108 stars 24 forks source link

editMessageReplyMarkup not working with reply_markup (InlineKeyboardMarkup) #9

Closed dtaytson closed 5 years ago

dtaytson commented 5 years ago

I tryed to run this code with editMessageReplyMarkup and failed with "Unsupported value type for form field"

`## Not run:

Initialize bot

bot <- Bot(token = "TOKEN") chat_id <- "CHAT_ID" message_id <- "MESSAGE ID"

Create Inline Keyboard

text <- "Could you type their phone number, please?" IKM <- InlineKeyboardMarkup( inline_keyboard = list( list(InlineKeyboardButton(1), InlineKeyboardButton(2), InlineKeyboardButton(3)), list(InlineKeyboardButton(4), InlineKeyboardButton(5), InlineKeyboardButton(6)), list(InlineKeyboardButton(7), InlineKeyboardButton(8), InlineKeyboardButton(9)), list(InlineKeyboardButton("*"), InlineKeyboardButton(0), InlineKeyboardButton("#")) ) )

Send Inline Keyboard

bot$editMessageReplyMarkup(chat_id,
                           message_id, reply_markup = IKM)

End(Not run)`

Error in curl::handle_setform(handle, .list = req$fields) : Unsupported value type for form field 'reply_markup'. Calls: ... -> -> request_perform -> Execution halted

ebeneditos commented 5 years ago

There was a little bug. I reviewed the code and it only affects to editMessageReplyMarkup. It is fixed since version 2.3.1.

Thanks for the report!