- Remove 5 redundant commands (setup, addcategory, removecategory, enable, disable) - Single /modmail config opens interactive Components V2 panel - Channel select for ticket category, role select for staff, channel select for logs - Toggle enable/disable button - Categories sub-panel: add via modal, remove via select - Fix lint (unused imports/vars, contextlib.suppress) + ruff format
38 lines
949 B
Python
38 lines
949 B
Python
import asyncio
|
|
import logging
|
|
import sys
|
|
|
|
import config
|
|
from bot import VisionBot
|
|
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format="%(asctime)s | %(levelname)-8s | %(name)s — %(message)s",
|
|
datefmt="%Y-%m-%d %H:%M:%S",
|
|
handlers=[
|
|
logging.StreamHandler(sys.stdout),
|
|
logging.FileHandler(config.LOGS_DIR / "vision.log", encoding="utf-8"),
|
|
],
|
|
)
|
|
logger = logging.getLogger("vision")
|
|
|
|
|
|
async def main():
|
|
if not config.DISCORD_TOKEN:
|
|
logger.critical("DISCORD_TOKEN manquant dans .env")
|
|
sys.exit(1)
|
|
|
|
instance = "DEV" if config.DEV else "PROD"
|
|
logger.info(f"Lancement de Vision Studio [{instance}]...")
|
|
bot = VisionBot()
|
|
|
|
try:
|
|
await bot.start(config.DISCORD_TOKEN)
|
|
except KeyboardInterrupt:
|
|
logger.info("Arrêt demandé")
|
|
except Exception as e:
|
|
logger.critical(f"Erreur fatale : {e}", exc_info=True)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|