pythontelegramtelegram-botpython-telegram-bot

Telegram bot error - "Bad Request: BUTTON_URL_INVALID"


Write bot for telegram on python and use PyTelegramBot lib.

Code:

markup_city = telebot.types.InlineKeyboardMarkup(row_width=2)
b1  = 
telebot.types.InlineKeyboardButton(text='Москва',callback_data='Москва')
markup_city.add(b1)

bot.send_message(message.chat.id,texts.strat_message,reply_markup=markup_city)

And Error:

A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body: [b'{"ok":false,"error_code":400,"description":"Bad Request: BUTTON_URL_INVALID"}']

its very strange error... I don't understand what is.

How do you think, what it can be?


Solution

  • As we can see in Bot API docs, InlineKeyboardButton have an optional parameter url. There is no problem to skip it in the request as you are doing, but implementation of InlineKeyboardButton type in the library you have used may be a cause of such behavior. Take a part in contributing with this issue on the project page at GitHub and it will be helpful for many people.