- Python 3.12 + discord.py - Docker + docker-compose - Forgejo Actions CI (lint + test) - Cog system with /hello example - deploy.sh for auto-deployment
37 lines
1 KiB
Python
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",
|
|
)
|
|
)
|