Files
cogs
utils
config.json
main.py
requirements.txt
Code
11 774
main.py
import discord
from discord.ext import commands
import os
import json
from dotenv import load_dotenv
load_dotenv()
with open("config.json") as f:
config = json.load(f)
intents = discord.Intents.all()
bot = commands.Bot(command_prefix=commands.when_mentioned, intents=intents)
@bot.event
async def on_ready():
print(f"SlurpyDuelsBot logged in as {bot.user}")
try:
synced = await bot.tree.sync()
print(f"Synced {len(synced)} slash commands")
except Exception as e:
print(f"Command sync failed: {e}")
async def load_cogs():
for cog in ["duels", "panels", "profile", "admin"]:
await bot.load_extension(f"cogs.{cog}")
print(f"Loaded cog: {cog}")
if __name__ == "__main__":
import asyncio
asyncio.run(load_cogs())
bot.run(os.getenv("DISCORD_TOKEN"))