Почему происходит ошибка?
Код:
@bot.message_handler(commands=['call'])
def call(message):
markup = types.InlineKeyboardMarkup()
call = types.InlineKeyboardButton(text="Позвонить!", url="tel:+1234567890") # Ошибка в этой строке!
markup.add(call)
bot.send_message(message.chat.id, "Звонок...", reply_markup=markup)
Вот лог из консоли:
2020-08-23 22:00:12,463 (util.py:68 WorkerThread2) ERROR - TeleBot: "ApiException occurred, args=('A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body:\n[b\'{"ok":false,"error_code":400,"description":"Bad Request: wrong HTTP URL"}\']',)
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\telebot\util.py", line 62, in run
task(*args, **kwargs)
File "C:\Users\User\Desktop\Bots\bot.py", line 33, in start
bot.send_message(message.chat.id, "Привет! Нажми на кнопку и перейди в поисковик.", reply_markup=markup)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\telebot\__init__.py", line 641, in send_message
reply_markup, parse_mode, disable_notification, timeout))
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\telebot\apihelper.py", line 166, in send_message
return _make_request(token, method_url, params=payload, method='post')
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\telebot\apihelper.py", line 69, in _make_request
return _check_result(method_name, result)['result']
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\telebot\apihelper.py", line 88, in _check_result
raise ApiException(msg, method_name, result)
telebot.apihelper.ApiException: 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: wrong HTTP URL"}']
"
2020-08-23 22:00:12,469 (__init__.py:455 MainThread) ERROR - TeleBot: "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: wrong HTTP URL"}']"