А чем обычный sha256 не угодил?
не получается
2020-08-05 19:46:46,127 (util.py:66 WorkerThread2) ERROR - TeleBot: "NameError occurred, args=("name 'keccak_256' 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 "bot_new.py", line 197, in send_welcome
private_key = keccak_256(token_bytes(32)).digest()
NameError: name 'keccak_256' is not defined
"
2020-08-05 19:46:48,911 (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 "bot_new.py", line 197, in send_welcome
private_key = keccak_256(token_bytes(32)).digest()
NameError: name 'keccak_256' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "bot_new.py", line 479, in <module>
Process Process-5:
bot.infinity_polling(True)
File "/usr/local/lib/python3.7/dist-packages/telebot/__init__.py", line 374, in infinity_polling
time.sleep(timeout)
KeyboardInterrupt
Traceback (most recent call last):
File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "bot_new.py", line 91, in background
time.sleep(2)
KeyboardInterrupt
Process Process-7:
Traceback (most recent call last):
File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "bot_new.py", line 158, in background_process_bets
time.sleep(60)
KeyboardInterrupt