Files
cogs
utils
.gitignore
bot.py
config.json
README.md
requirements.txt
Code
10 1,692
bot.py
import discord
from discord.ext import commands
import os
from dotenv import load_dotenv
import json
import asyncio
import logging
load_dotenv()
logging.basicConfig(level=logging.INFO)
intents = discord.Intents.all()
bot = commands.Bot(command_prefix='!', intents=intents, help_command=None)
@bot.event
async def on_ready():
print(f'Bot is ready! Logged in as {bot.user}')
print(f'Bot ID: {bot.user.id}')
print('------')
try:
synced = await bot.tree.sync()
print(f'Synced {len(synced)} slash commands')
except Exception as e:
print(f'Failed to sync commands: {e}')
async def load_cogs():
cogs = ['cogs.embed_builder', 'cogs.welcome', 'cogs.tickets', 'cogs.automod']
for cog in cogs:
try:
await bot.load_extension(cog)
print(f'Loaded {cog}')
except Exception as e:
print(f'Failed to load {cog}: {e}')
async def main():
async with bot:
await load_cogs()
await bot.start(os.getenv('DISCORD_TOKEN'))
if __name__ == '__main__':
asyncio.run(main())