Всем привет. Имеется следующий код:
bot = telebot.TeleBot(token)
class Bot:
def __init__(self, four_digits=None, amount='1 390,00 руб.', platform=None):
self.four_digits = four_digits
self.amount = amount
self.platform = platform
@bot.message_handler(commands=['start'])
def start(self, message):
bot.send_animation(message.chat.id, 'CAACAgIAAxkBAAJ7kV_QyCsjcwiMuROqR-cyXPuBy16OAAJMAgACygMGCxJWY4NsIlRSHgQ')
msg = bot.send_message(message.chat.id, START_TEXT, reply_markup=keyboard1)
bot.register_next_step_handler(msg, self.process_step)
bot.clear_step_handler(msg)
def main():
kino_bot = KinoBot()
bot.polling(none_stop=True)
if __name__ == '__main__':
main()
При отправке /start боту ловлю следующую ошибку:
2020-12-14 20:20:22,603 (util.py:68 WorkerThread3) ERROR - TeleBot: "TypeError occurred, args=("start() missing 1 required positional argument: 'message'",)
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\telebot\util.py", line 62, in run
task(*args, **kwargs)
TypeError: start() missing 1 required positional argument: 'message'
"
Traceback (most recent call last):
File "D:/Projects/pythonProject1/main.py", line 246, in <module>
main()
File "D:/Projects/pythonProject1/main.py", line 242, in main
bot.polling(none_stop=True)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\telebot\__init__.py", line 427, in polling
self.__threaded_polling(none_stop, interval, timeout)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\telebot\__init__.py", line 451, in __threaded_polling
self.worker_pool.raise_exceptions()
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\telebot\util.py", line 111, in raise_exceptions
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\six.py", line 703, in reraise
raise value
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\telebot\util.py", line 62, in run
task(*args, **kwargs)
TypeError: start() missing 1 required positional argument: 'message'
Уверен в том, что я как то не правильно собираю Class бота. Не могу найти ошибку. Помогите плиз.