Traceback (most recent call last):
File "C:\Users\семейный\Desktop\btcbot\run.py", line 90, in
bot.send_document(config.ADMINS_ID[0], doc)
File "C:\Users\семейный\AppData\Local\Programs\Python\Python36\lib\site-packages\telebot\__init__.py", line 1171, in send_document
disable_content_type_detection = disable_content_type_detection, visible_file_name = visible_file_name))
File "C:\Users\семейный\AppData\Local\Programs\Python\Python36\lib\site-packages\telebot\apihelper.py", line 856, in send_data
return _make_request(token, method_url, params=payload, files=files, method='post')
File "C:\Users\семейный\AppData\Local\Programs\Python\Python36\lib\site-packages\telebot\apihelper.py", line 145, in _make_request
json_result = _check_result(method_name, result)
File "C:\Users\семейный\AppData\Local\Programs\Python\Python36\lib\site-packages\telebot\apihelper.py", line 172, in _check_result
raise ApiTelegramException(method_name, result, result_json)
telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: file must be non-empty
if __name__ == "__main__":
install_my_libs("myqiwi")
logger("Начало работы")
while True:
error = run_bot_loop()
logger("Перезапуск")
with open("etc\\data\\error.txt", "w", encoding="utf-8") as f: f.write(error)
doc = open("etc\\data\\error.txt", "rb")
bot.send_document(config.ADMINS_ID[0], doc)
doc.close()
doc = open(config.PATH_2_LOG, "rb")
bot.send_document(config.ADMINS_ID[0], doc)
doc.close()
time.sleep(0)
очень странно,что до этого он работал идеально.