TeleBot: "NameError occurred, args=("name 'message' is not defined",)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/telebot/util.py", line 60, in run
task(*args, **kwargs)
File "main2.py", line 89, in callback_processing
bot.register_next_step_handler(message, outstavkaa)
NameError: name 'message' is not defined
"
2020-07-22 16:51:07,321 (util.py:66 PollingThread) ERROR - TeleBot: "ApiException occurred, args=('A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:\n[b\'{"ok":false,"error_code":409,"description":"Conflict: terminated by other getUpdates request; make sure that only one bot instance is running"}\']',)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/telebot/util.py", line 60, in run
task(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/telebot/__init__.py", line 279, in __retrieve_updates
updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
File "/usr/local/lib/python3.7/dist-packages/telebot/__init__.py", line 249, in get_updates
json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
File "/usr/local/lib/python3.7/dist-packages/telebot/apihelper.py", line 194, in get_updates
return _make_request(token, method_url, params=payload)
File "/usr/local/lib/python3.7/dist-packages/telebot/apihelper.py", line 60, in _make_request
return _check_result(method_name, result)['result']
File "/usr/local/lib/python3.7/dist-packages/telebot/apihelper.py", line 79, in _check_result
raise ApiException(msg, method_name, result)
telebot.apihelper.ApiException: A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:
[b'{"ok":false,"error_code":409,"description":"Conflict: terminated by other getUpdates request; make sure that only one bot instance is running"}']
"
^CTraceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/telebot/__init__.py", line 372, in infinity_polling
self.polling(timeout=timeout, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/telebot/__init__.py", line 392, in polling
self.__threaded_polling(none_stop, interval, timeout)
File "/usr/local/lib/python3.7/dist-packages/telebot/__init__.py", line 416, in __threaded_polling
self.worker_pool.raise_exceptions()
File "/usr/local/lib/python3.7/dist-packages/telebot/util.py", line 109, in raise_exceptions
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
File "/usr/lib/python3/dist-packages/six.py", line 692, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.7/dist-packages/telebot/util.py", line 60, in run
task(*args, **kwargs)
File "main2.py", line 89, in callback_processing
bot.register_next_step_handler(message, outstavkaa)
NameError: name 'message' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main2.py", line 169, in <module>
bot.infinity_polling(True)
File "/usr/local/lib/python3.7/dist-packages/telebot/__init__.py", line 374, in infinity_polling
time.sleep(timeout)
KeyboardInterrupt
^CException ignored in: <module 'threading' from '/usr/lib/python3.7/threading.py'>
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 1307, in _shutdown
lock.acquire()
KeyboardInterrupt
код
https://pastebin.com/TiyXe21P
как исправить?
message = bot.send_message(call.from_user.id, "msg")
Обсуждают сегодня