I got my buttons working in ReplyKeyboardMarkup and i changed it into InlineKeyboardMarkup with the following code
mark_up = InlineKeyboardMarkup(
[[InlineKeyboardButton('inline button')]]
)
And i get the following error
telegram.error.NetworkError: Error : 400 : Bad Request: Can't parse inline keyboard button: Text buttons are unallowed in the inline keyboard
Below is the documentation of the InlineKeyboardMarkup and as you can see it is refering to a list of InlineKeyboardMarkup and not InlineKeyboardButton.
"""This object represents a Telegram InlineKeyboardMarkup.
Attributes:
inline_keyboard (List[List[:class:telegram.InlineKeyboardMarkup]]):
Args:
inline_keyboard (List[List[:class:telegram.InlineKeyboardMarkup]]):
"""
From telegram api docs: "You must use exactly one of the optional fields."
So you have to pass either url, callback_data or switch_inline_query
Edit: The button would be useless if you don't pass any of those fields
Reopening because I overlooked the documentation part of this issue - you're right about that
Fixed, thank you for reporting :)
why can not i edit a text and send replykeyboardmarkup but i can in InilneKeyboard???
Most helpful comment
From telegram api docs: "You must use exactly one of the optional fields."
So you have to pass either
url,callback_dataorswitch_inline_queryEdit: The button would be useless if you don't pass any of those fields