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
This commit is contained in:
commit
e44349cea9
17 changed files with 396 additions and 0 deletions
37
bot.py
Normal file
37
bot.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
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",
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue