Files
__init__.py
bot.py
giveaway_manager.py
giveaway.py
requirements.txt
Code
5 383
/home/user/PenguinsGiveawayBot/bot.py
import discord
from discord.ext import commands
import os
from dotenv import load_dotenv
load_dotenv()
intents = discord.Intents.default()
intents.message_content = True
intents.reactions = True
intents.guilds = True
bot = commands.Bot(command_prefix="!", intents=intents, help_command=None)
@bot.event
async def on_ready():
print(f"π§ Penguin's Giveaway Bot is ready!")
print(f"Logged in as {bot.user.name}#{bot.user.discriminator}")
print(f"ID: {bot.user.id}")
print("-" * 30)
@bot.command(name="help")
async def help_command(ctx):
embed = discord.Embed(
title="π§ Penguin's Giveaway Bot - Help",
description="Here are the available commands:",
color=0x00FF00,
)
embed.add_field(
name="!gstart <duration> <winners> <prize>",
value="Start a giveaway.\nDuration: `1h30m`, `2d`, `30m`, `45s`",
inline=False,
)
embed.add_field(
name="!gend [message_id]",
value="End a giveaway early. Leave blank to end your most recent one in this channel.",
inline=False,
)
embed.add_field(
name="!greroll <message_id>",
value="Reroll winners for an ended giveaway.",
inline=False,
)
embed.add_field(
name="!glist",
value="List all active giveaways in this server.",
inline=False,
)
await ctx.send(embed=embed)
async def load():
await bot.load_extension("cogs.giveaway")
if __name__ == "__main__":
import asyncio
asyncio.run(load())
bot.run(os.getenv("DISCORD_TOKEN"))