Files
cogs
bot.py
requirements.txt
Code
4 425
bot.py
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv("DISCORD_TOKEN")
if not TOKEN:
raise ValueError("DISCORD_TOKEN not found in .env file")
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents, help_command=None)
@bot.event
async def on_ready():
print(f"Logged in as {bot.user} (ID: {bot.user.id})")
print("------")
async def main():
async with bot:
await bot.load_extension("cogs.giveaway")
await bot.start(TOKEN)
if __name__ == "__main__":
import asyncio
asyncio.run(main())