Привет, пытаюсь принимать платеж через Telegram payments но выдает ошибку при подтверждении платежа
Вот сам код платежей
@bot.pre_checkout_query_handler(func=lambda query: True)
def process_pre_checkout_query(pre_checkout_query: types.PreCheckoutQuery):
print(pre_checkout_query.id)
bot.answer_pre_checkout_query(pre_checkout_query.id, ok=True)
@bot.message_handler(content_types=types.SuccessfulPayment)
def process_successful_payment(message):
bot.send_message(message.chat.id, 'Отлично!')
Сам трейс с ошибками
2020-12-10 17:37:11,370 (util.py:68 PollingThread) ERROR - TeleBot: "TypeError occurred, args=("argument of type 'type' is not iterable",)
Traceback (most recent call last):
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\util.py", line 62, in run
task(*args, **kwargs)
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 286, in __retrieve_updates
self.process_new_updates(updates)
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 332, in process_new_updates
self.process_new_messages(new_messages)
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 358, in process_new_messages
self._notify_command_handlers(self.message_handlers, new_messages)
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 2028, in _notify_command_handlers
if self._test_message_handler(message_handler, message):
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 1996, in _test_message_handler
if not self._test_filter(message_filter, filter_value, message):
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 2017, in _test_filter
return test_cases.get(message_filter, lambda msg: False)(message)
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 2011, in <lambda>
'content_types': lambda msg: msg.content_type in filter_value,
TypeError: argument of type 'type' is not iterable
"
Traceback (most recent call last):
File "D:\Рабочий стол\Beer\Bot.py", line 1124, in <module>
bot.polling(none_stop=True)
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 427, in polling
self.__threaded_polling(none_stop, interval, timeout)
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 450, in __threaded_polling
polling_thread.raise_exceptions()
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\util.py", line 81, in raise_exceptions
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
File "C:\Users\saxar\anaconda3\lib\site-packages\six.py", line 703, in reraise
raise value
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\util.py", line 62, in run
task(*args, **kwargs)
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 286, in __retrieve_updates
self.process_new_updates(updates)
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 332, in process_new_updates
self.process_new_messages(new_messages)
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 358, in process_new_messages
self._notify_command_handlers(self.message_handlers, new_messages)
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 2028, in _notify_command_handlers
if self._test_message_handler(message_handler, message):
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 1996, in _test_message_handler
if not self._test_filter(message_filter, filter_value, message):
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 2017, in _test_filter
return test_cases.get(message_filter, lambda msg: False)(message)
File "C:\Users\saxar\anaconda3\lib\site-packages\telebot\__init__.py", line 2011, in <lambda>
'content_types': lambda msg: msg.content_type in filter_value,
TypeError: argument of type 'type' is not iterable
[Finished in 1.0s]
Как я понял он пытается проитерировать types от телеграм но не понимаю что не получается, в api телеграма SuccessfulPayment имеет несколько данных на вывод
В общем я бессилен спасите пожалуйста(
Дайте ответ а не совет ;)