Не работает Telegram БОТ. После ввода номера телефона крашится бот, в чём ошибка?
Вот код?
@bot.message_handler(commands=['start'])
def handle_text (message):
bot.send_message(message.chat.id, "Введите ваше ФИО")
@bot.message_handler(content_types=['text'])
def user_n(message):
db_name = message.text
bot.register_next_step_handler(user_phone(message))
def user_phone(message):
bot.send_message(message.chat.id, "Введите ваш Номер Телефона")
@bot.message_handler(content_types=['text'])
def user_na(message):
db_phone = message.text
bot.register_next_step_handler(user_email(message))
def user_email(message):
bot.send_message(message.chat.id, "Введите ваш Эл.Почту")
@bot.message_handler(content_types=['text'])
def user_nam(message):
db_email = message.text
bot.register_next_step_handler(user_msg(message))
def user_msg(message):
bot.send_message(message.chat.id, "Введите ваше сообщение")
@bot.message_handler(content_types=['text'])
def user_name(message):
db_msg = message.text
bot.register_next_step_handler(test(message))
def test(message):
bot.send_message(message.chat.id, 'ФИО:', db_name, '\nТел:', db_phone, '\nПочта:', db_email, '\nСообщение', db_msg)
Код из консоли:
2020-08-21 17:24:52,334 (util.py:68 WorkerThread2) ERROR - TeleBot: "TypeError occurred, args=("register_next_step_handler() missing 1 required positional argument: 'callback'",)
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\My_Info_Bot\bot-db-2.py", line 25, in user_n
bot.register_next_step_handler(user_phone(message))
TypeError: register_next_step_handler() missing 1 required positional argument: 'callback'
"
Traceback (most recent call last):
File "C:\Users\User\Desktop\My_Info_Bot\bot-db-2.py", line 65, in <module>
bot.polling(none_stop=True)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\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\Python37\lib\site-packages\telebot\__init__.py", line 451, in __threaded_polling
self.worker_pool.raise_exceptions()
File "C:\Users\User\AppData\Local\Programs\Python\Python37\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\Python37\lib\site-packages\six.py", line 703, in reraise
raise value
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\My_Info_Bot\bot-db-2.py", line 25, in user_n
bot.register_next_step_handler(user_phone(message))
TypeError: register_next_step_handler() missing 1 required positional argument: 'callback'