Files
cogs
.gitignore
bot.py
requirements.txt
Code
11 1,878
bot.py
import discord
from discord.ext import commands
import os
from dotenv import load_dotenv
from datetime import datetime
import asyncio
load_dotenv()
intents = discord.Intents.all()
bot = commands.Bot(command_prefix='!', intents=intents, help_command=None)
@bot.event
async def on_ready():
print(f'โ
{bot.user} is now online!')
print(f'Bot ID: {bot.user.id}')
print(f'Connected to {len(bot.guilds)} server(s)')
print('โ' * 50)
try:
synced = await bot.tree.sync()
print(f'Synced {len(synced)} slash command(s)')
except Exception as e:
print(f'Failed to sync commands: {e}')
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="your server"))
bot.start_time = datetime.utcnow()
async def load_cogs():
cogs = [
'cogs.moderation',
'cogs.utility',
'cogs.fun',
'cogs.levels',
'cogs.music',
'cogs.economy',
'cogs.custom_commands'
]
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())