diff --git a/bot.py b/bot.py index 95958af..6fef1e4 100644 --- a/bot.py +++ b/bot.py @@ -131,7 +131,7 @@ if __name__ == "__main__": thread.start() try: - bot.run(token, raise_exception=True) + bot.run(token) except discord.LoginFailure as e: logger.critical(f"Ошибка авторизации бота: {e}", exc_info=True) print(f"❌ Токен неверный или бот отключён. Код ошибки: {e}") diff --git a/tests/test_bot.py b/tests/test_bot.py index f3ad056..4a268a3 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -35,10 +35,8 @@ class TestBotErrorHandlingCodeExists: with open(ROOT_DIR / "bot.py", encoding="utf-8") as f: content = f.read() - # Проверяем наличие raise_exception=True - assert "raise_exception=True" in content, ( - "В bot.py должен присутствовать параметр raise_exception=True" - ) + # Проверяем обработку ошибок в bot.run() + assert "bot.run(token)" in content, "В bot.py должен быть вызов bot.run(token)" # Проверяем наличие обработки LoginFailure assert "LoginFailure" in content, "В bot.py должна быть обработка LoginFailure"