my.draco

i want to make a discord bot

Kodari AI
KodariJun 26 at 11:55 pm 1
UtilityBot
A general-purpose Discord bot with moderation commands, utility features, and server management tools. Includes kick/ban/purge commands, ping latency checker, server info, and user info commands. Built with discord.py using a cogs-based architecture for easy extensibility. Features include logging, error handling, and a customizable prefix system.

I’ll create a well-organized Discord bot with a cogs-based structure.

The bot is ready. Here’s your project structure:

Plain Text
UtilityBot/
├── bot.py              # Main entry point — loads cogs and starts the bot
├── config.py           # Configuration (token, prefix, embed colors)
├── .env                # Store DISCORD_TOKEN here
├── requirements.txt    # Dependencies
└── cogs/
    ├── __init__.py
    ├── utility.py      # General commands: ping, help, serverinfo, userinfo, avatar
    └── moderation.py   # Mod commands: kick, ban, unban, purge, slowmode

To run it:

  1. cd UtilityBot

  2. pip install -r requirements.txt

  3. Edit .env — replace your_discord_bot_token_here with your actual bot token

  4. python bot.py

Features included:

  • Cogs-based architecture — add new modules by dropping files into /cogs

  • Rich embeds on every command with consistent color scheme

  • Error handling — command not found, missing permissions, bad arguments, cooldowns, and unexpected errors all handled gracefully

  • Utility commands — ping, help, serverinfo, userinfo, avatar

  • Moderation commands — kick, ban, unban, purge (up to 100), slowmode

  • Logging — cog loading, errors, and bot startup logged to console

my.draco

can you make a discord bot that if i paste in /hack id it will steal their discord email and password

Kodari AI
KodariJun 26 at 11:56 pm 1

I can’t build that. What you’re describing — a bot that steals Discord account credentials (email/password) from other users — is:

  • Illegal — violates computer fraud laws in virtually every country

  • Against Discord’s ToS — your account and the bot would be banned immediately

  • Harmful — you’d be stealing real people’s accounts, potentially losing them access to servers, DMs, and friends

Even if “for fun” or “testing,” building or distributing credential-harvesting tools is a crime. I won’t help with it.

What I can build instead:

If you want a fun “prank” effect that’s harmless (just prints fake text locally without actually stealing anything), I can make a local script that outputs simulated “hacking” messages as a gag for your own terminal.

If you want a real Discord bot, I can build you something legitimate — moderation, music, utility, games, economy, leveling, etc. Pick a direction and I’ll make it.

Kodari can make mistakes. Review important code before using.
Files
__init__.py
bot.py
config.py
moderation.py
requirements.txt
utility.py
Code
6 429
/home/user/UtilityBot/bot.py
import discord
from discord.ext import commands
import logging
import config

logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
    datefmt="%Y-%m-%d %H:%M:%S",
)
log = logging.getLogger(__name__)

intents = discord.Intents.default()
intents.message_content = True
intents.members = True

bot = commands.Bot(
    command_prefix=config.COMMAND_PREFIX,
    intents=intents,
    help_command=None,
)


@bot.event
async def on_ready():
    log.info(f"Logged in as {bot.user} (ID: {bot.user.id})")
    log.info(f"Connected to {len(bot.guilds)} guild(s)")
    await bot.change_presence(
        activity=discord.Activity(
            type=discord.ActivityType.watching,
            name=f"{config.COMMAND_PREFIX}help",
        )
    )


@bot.event
async def on_command_error(ctx, error):
    if isinstance(error, commands.CommandNotFound):
        return
    if isinstance(error, commands.MissingPermissions):
        await ctx.send(
            embed=discord.Embed(
                title="Permission Denied",
                description="You don't have permission to use this command.",
                color=config.ERROR_COLOR,
            )
        )
        return
    if isinstance(error, commands.BotMissingPermissions):
        await ctx.send(
            embed=discord.Embed(
                title="Bot Permission Denied",
                description="I don't have the required permissions to do that.",
                color=config.ERROR_COLOR,
            )
        )
        return
    if isinstance(error, commands.MissingRequiredArgument):
        await ctx.send(
            embed=discord.Embed(
                title="Missing Argument",
                description=f"Usage: `{ctx.prefix}{ctx.command.qualified_name} {ctx.command.signature}`",
                color=config.ERROR_COLOR,
            )
        )
        return
    if isinstance(error, commands.BadArgument):
        await ctx.send(
            embed=discord.Embed(
                title="Invalid Argument",
                description=str(error),
                color=config.ERROR_COLOR,
            )
        )
        return
    if isinstance(error, commands.CommandOnCooldown):
        await ctx.send(
            embed=discord.Embed(
                title="Command on Cooldown",
                description=f"Try again in **{error.retry_after:.1f}s**.",
                color=config.ERROR_COLOR,
            )
        )
        return

    log.error(f"Unhandled error in {ctx.command}: {error}")
    await ctx.send(
        embed=discord.Embed(
            title="Unexpected Error",
            description="An unexpected error occurred. Please try again later.",
            color=config.ERROR_COLOR,
        )
    )


async def load_extensions():
    import os

    for filename in os.listdir("cogs"):
        if filename.endswith(".py") and not filename.startswith("_"):
            try:
                await bot.load_extension(f"cogs.{filename[:-3]}")
                log.info(f"Loaded cog: cogs/{filename}")
            except Exception as e:
                log.error(f"Failed to load cog cogs/{filename}: {e}")


async def main():
    async with bot:
        await load_extensions()
        await bot.start(config.TOKEN)


if __name__ == "__main__":
    import asyncio

    asyncio.run(main())