pyrss-ng/bot/bot.py
2025-01-15 14:17:35 +00:00

26 lines
636 B
Python

import logging
from discord import Intents
from discord.ext import commands
log = logging.getLogger(__name__)
class DiscordBot(commands.Bot):
def __init__(self):
super().__init__(
command_prefix="@",
intents=Intents.all()
)
async def on_ready(self):
await self.wait_until_ready()
await self.tree.sync()
log.info("Bot is synced and ready")
async def load_cogs(self, cog_path: str):
log.info("Loading cogs")
for path in cog_path.iterdir():
if path.suffix == ".py":
await self.load_extension(f"cogs.{path.stem}")