edinst_27205

Develop an interactive fun bot utilizing Discord.js that features at least 10 distinct command categories, each containing a minimum of 5 commands, such as games, trivia, and memes. The bot should implement a /menu command that dynamically generates an organized list of all commands and their respective categories, leveraging embed messages for enhanced visual appeal. Additionally, ensure that the bot includes a help command that provides detailed descriptions and usage examples for each command, and incorporate user feedback mechanisms to continually improve the bot's functionality.

Kodari AI
KodariApr 22 at 2:01 pm 35,023 (v2)

Iโ€™ll build a feature-rich interactive Discord bot with 10 command categories, a dynamic /menu, detailed /help, and feedback system using discord.py with slash commands and cogs.

FunBot
A feature-rich interactive Discord bot with 10 distinct command categories (Games, Trivia, Memes, Fun, Economy, Utility, Moderation, Social, Math, and Anime) each containing 5+ slash commands. Features a dynamic /menu with categorized embeds, a detailed /help system with usage examples, and a /feedback command for user input. Built with discord.py using a cog-based architecture for clean modularity.

Plan:

  • main.py โ€” Bot entry point, loads all cogs, syncs slash commands

  • cogs/ โ€” One file per category (games, trivia, memes, fun, economy, utility, moderation, social, math, anime) + menu/help/feedback cog

  • data/ โ€” JSON files for economy persistence, trivia questions, feedback log

  • .env + requirements.txt


Hereโ€™s a summary of everything created:

  • main.py โ€” Bot entry point using a FunBot class that loads 11 cogs and auto-syncs slash commands on startup

  • utils/helpers.py โ€” Shared utilities: embed builder, economy persistence (JSON), feedback I/O, trivia loader, color constants

  • data/ โ€” economy.json, feedback.json, trivia.json (20 questions across 10 categories)

  • 10 feature cogs:

    • cogs/games.py โ€” 7 commands including interactive Blackjack with Hit/Stand buttons and persistent number-guess sessions

    • cogs/trivia.py โ€” 6 commands including a 5-round streak mode with live button-driven flow

    • cogs/memes.py โ€” 6 commands pulling live memes from Reddit via aiohttp

    • cogs/fun.py โ€” 8 commands: 8-ball, facts, quotes, rating, countdown, etc.

    • cogs/economy.py โ€” 8 commands with a full JSON-backed coin economy, shop, inventory, and leaderboard

    • cogs/utility.py โ€” 7 commands: ping, server/user info, avatar, poll, uptime, botinfo

    • cogs/moderation.py โ€” 8 commands: kick, ban, unban, timeout, warn system, purge

    • cogs/social.py โ€” 9 commands with GIF embeds, ship % calculator, and compliments

    • cogs/math.py โ€” 7 commands: safe eval calculator, unit converter, BMI, Fibonacci, prime factorization

    • cogs/anime.py โ€” 7 commands using waifu.pics and Jikan APIs for images and anime search

  • cogs/menu.py โ€” /menu (dropdown category navigator), /help (60+ command entries with usage examples), /feedback (typed + persisted), /viewfeedback (admin)

Kodari can make mistakes. Review important code before using.
Files
cogs
data
utils
main.py
requirements.txt
Code
17 2,166
main.py
import discord
from discord.ext import commands
import os
import logging
from dotenv import load_dotenv

load_dotenv()

logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s [%(levelname)s] %(name)s: %(message)s"
)
log = logging.getLogger("FunBot")

COGS = [
    "cogs.games",
    "cogs.trivia",
    "cogs.memes",
    "cogs.fun",
    "cogs.economy",
    "cogs.utility",
    "cogs.moderation",
    "cogs.social",
    "cogs.math",
    "cogs.anime",
    "cogs.menu",
]

class FunBot(commands.Bot):
    def __init__(self):
        intents = discord.Intents.all()
        super().__init__(command_prefix="!", intents=intents, help_command=None)

    async def setup_hook(self):
        for cog in COGS:
            try:
                await self.load_extension(cog)
                log.info(f"Loaded cog: {cog}")
            except Exception as e:
                log.error(f"Failed to load cog {cog}: {e}")
        synced = await self.tree.sync()
        log.info(f"Synced {len(synced)} slash commands.")

    async def on_ready(self):
        await self.change_presence(
            activity=discord.Activity(
                type=discord.ActivityType.playing,
                name="/menu for commands"
            )
        )
        log.info(f"Logged in as {self.user} ({self.user.id})")

    async def on_command_error(self, ctx, error):
        log.error(f"Command error: {error}")

bot = FunBot()
bot.run(os.getenv("DISCORD_TOKEN"))