VisionApp/bot.py
Mathis e44349cea9
Some checks failed
CI / lint (push) Failing after 2s
CI / test (push) Failing after 1s
feat: initial project setup — Vision Studio bot
- Python 3.12 + discord.py
- Docker + docker-compose
- Forgejo Actions CI (lint + test)
- Cog system with /hello example
- deploy.sh for auto-deployment
2026-09-19 12:11:06 +02:00

37 lines
1 KiB
Python

import logging
import discord
from discord.ext import commands
import config
logger = logging.getLogger("vision")
class VisionBot(commands.Bot):
def __init__(self):
intents = discord.Intents.default()
intents.message_content = True
intents.members = True
super().__init__(
command_prefix="!",
intents=intents,
application_id=config.APPLICATION_ID,
)
async def setup_hook(self):
logger.info("Chargement des cogs...")
await self.load_extension("commandes.hello")
logger.info("Sync des slash commands...")
await self.tree.sync()
logger.info("Slash commands synchronisées")
async def on_ready(self):
logger.info(f"Connecté en tant que {self.user} (ID: {self.user.id})")
logger.info(f"Serveurs : {len(self.guilds)}")
await self.change_presence(
activity=discord.Activity(
type=discord.ActivityType.watching,
name="Vision Studio",
)
)