refactor(fun): cogs into one group

Combined all fun commands into a single 'fun' GroupCog with subcommands, replacing individual cogs for coinflip, eightball, minesweeper, randomfact, and rockpaperscissors. Updated bot.py to load the fun cog as a package and adjusted help.py to reflect the new command structure. This improves organization and discoverability of fun commands.
This commit is contained in:
neoarz
2025-09-28 22:48:10 -04:00
parent 6ed3b0d378
commit e7ee97074b
8 changed files with 114 additions and 93 deletions

View File

@@ -1,15 +1,10 @@
import aiohttp
import discord
from discord.ext import commands
from discord.ext.commands import Context
class RandomFact(commands.Cog, name="randomfact"):
def __init__(self, bot) -> None:
self.bot = bot
def randomfact_command():
@commands.hybrid_command(name="randomfact", description="Get a random fact.")
async def randomfact(self, context: Context) -> None:
async def randomfact(self, context):
async with aiohttp.ClientSession() as session:
async with session.get(
"https://uselessfacts.jsph.pl/random.json?language=en"
@@ -30,7 +25,5 @@ class RandomFact(commands.Cog, name="randomfact"):
)
embed.set_author(name="Fun", icon_url="https://yes.nighty.works/raw/eW5lLm.webp")
await context.send(embed=embed)
async def setup(bot) -> None:
await bot.add_cog(RandomFact(bot))
return randomfact