I have such replying keyboard:
keyboard = [
[
InlineKeyboardButton("Play with a bot", callback_data=str(ONE)),
InlineKeyboardButton("Results", callback_data=str(TWO)),
]
]
reply_markup = InlineKeyboardMarkup(keyboard)
update.message.reply_text(None, reply_markup=reply_markup)
It gives me such a result:
How can I get rid of the first "null" string?
2
Answers
You’re passing
None
as the Title, resulting innull
, you should pass a message as it’s required for thesend_message
andreply_text
method:So, since you’re required to add some text, pass it as the a extra argument to the function:
As described in my comment, sending a separate message also requires some text
You cannot send an inline keyboard without text or any type of media supported by Telegram (photos, videos, audios etc). If instead you only want to update the inline keyboard without changing the message content, use the editMessageReplyMarkup method. This will update the inline keyboard leaving the original message intact.