diff --git a/bot.py b/bot.py index bc36f3d..6883ee5 100755 --- a/bot.py +++ b/bot.py @@ -265,7 +265,4 @@ class MyBot(commands.Bot): return if isinstance(error, commands.CheckFailure): return - kuby_logger.error(f"Command error in {ctx.command}: {str(error)}", exc_info=True) - - -bot = MyBot() \ No newline at end of file + kuby_logger.error(f"Command error in {ctx.command}: {str(error)}", exc_info=True) \ No newline at end of file diff --git a/kuby.py b/kuby.py index ff01fee..d73ca48 100755 --- a/kuby.py +++ b/kuby.py @@ -2,7 +2,7 @@ import asyncio import os import sys from dotenv import load_dotenv -from bot import bot +from bot import MyBot # Modification ici : on importe la classe from src.logger import kuby_logger, log_performance kuby_logger.info("🚀 Lancement du bot Kuby...") @@ -28,6 +28,9 @@ kuby_logger.info("✅ Token Discord chargé avec succès") async def main(): kuby_logger.info("🔄 Démarrage de la connexion Discord...") try: + # Modification majeure : l'objet bot est instancié ici, au sein de la boucle active + bot = MyBot() + await bot.do_async_setup() kuby_logger.info("🔗 Connexion établie avec Discord...") await bot.start(TOKEN)