Моя попытка
markup = InlineKeyboardMarkup()
markup.add(InlineKeyboardButton(
text = 'Оплатить',
pay = True
))
bot.send_invoice(
chat_id = query.message.chat.id,
title = 'Подписка',
description = 'Покупка подписки',
prices = [LabeledPrice('Подписка', 50)],
provider_token = '',
invoice_payload = 'subscription mo_1',
currency = 'XTR',
reply_markup = markup
)
Текст исключения
Traceback (most recent call last):
File "d:\projects\python\LanceParseBot\.venv\Lib\site-packages\telebot\__init__.py", line 1215, in __threaded_polling
self.worker_pool.raise_exceptions()
File "d:\projects\python\LanceParseBot\.venv\Lib\site-packages\telebot\util.py", line 150, in raise_exceptions
raise self.exception_info
File "d:\projects\python\LanceParseBot\.venv\Lib\site-packages\telebot\util.py", line 93, in run
task(*args, **kwargs)
File "d:\projects\python\LanceParseBot\.venv\Lib\site-packages\telebot\__init__.py", line 8707, in _run_middlewares_and_handler
result = handler['function'](message)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "LanceParse.py", line 350, in on_other
bot.send_message(
File "d:\projects\python\LanceParseBot\.venv\Lib\site-packages\telebot\__init__.py", line 1755, in send_message
apihelper.send_message(
File "d:\projects\python\LanceParseBot\.venv\Lib\site-packages\telebot\apihelper.py", line 273, in send_message
return _make_request(token, method_url, params=payload, method='post')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\projects\python\LanceParseBot\.venv\Lib\site-packages\telebot\apihelper.py", line 168, in _make_request
json_result = _check_result(method_name, result)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\projects\python\LanceParseBot\.venv\Lib\site-packages\telebot\apihelper.py", line 195, in _check_result
raise ApiTelegramException(method_name, result, result_json)
telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "telebot.types.labeledprice" at byte offset 172
Техническая информация
- OS:
Windows 10 Pro 22H2
- Версия Python:
3.12.4
- Версия модуля:
pyTelegramBotAPI==4.21.0