elif(message.text == "Оформить заказ"):
send = bot.reply_to(message, text="Введите свои данные: \n Ваше имя \n Ваш номер телефона \n Адрес Доставки \n Ваш заказ \n ЗАПИШИТЕ ВСЕ 1 СООБЩЕНИЕМ")
bot.register_next_step_handler(send, email_create)
def email_create(message):
bot.send_message(message.chat.id, text="Заказ оформлен")
name_user = [0]
adress_user = [1]
num_user = [2]
zacaz_user = [3]
Traceback (most recent call last):
File "C:\Users\Katana\Desktop\Доставка бот\test_22.py", line 91, in <module>
bot.polling(none_stop=True, interval=1)
File "C:\Users\Katana\AppData\Roaming\Python\Python310\site-packages\telebot\__init__.py", line 1043, in polling
self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout,
File "C:\Users\Katana\AppData\Roaming\Python\Python310\site-packages\telebot\__init__.py", line 1118, in __threaded_polling
raise e
File "C:\Users\Katana\AppData\Roaming\Python\Python310\site-packages\telebot\__init__.py", line 1074, in __threaded_polling
self.worker_pool.raise_exceptions()
File "C:\Users\Katana\AppData\Roaming\Python\Python310\site-packages\telebot\util.py", line 156, in raise_exceptions
raise self.exception_info
File "C:\Users\Katana\AppData\Roaming\Python\Python310\site-packages\telebot\util.py", line 100, in run
task(*args, **kwargs)
File "C:\Users\Katana\AppData\Roaming\Python\Python310\site-packages\telebot\__init__.py", line 6395, in _run_middlewares_and_handler
result = handler['function'](message)
File "C:\Users\Katana\Desktop\Доставка бот\test_22.py", line 70, in button
bot.register_next_step_handler(send, email_create)
UnboundLocalError: local variable 'email_create' referenced before assignment
[Finished in 5.4s with exit code 1]
[shell_cmd: python -u "C:\Users\Katana\Desktop\Доставка бот\test_22.py"]
[dir: C:\Users\Katana\Desktop\Доставка бот]
[path: C:\Program Files\Python310\Scripts\;C:\Program Files\Python310\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\dotnet\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\Borland\Delphi7\Bin;C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl;C:\Users\Katana\AppData\Local\Microsoft\WindowsApps]