refactor(general): commands into GroupCog

Migrated general commands (ping, uptime, botinfo, serverinfo, feedback) into a single GroupCog in cogs/general/__init__.py for better organization and maintainability. Converted individual command files to export command functions instead of Cogs. Updated bot.py to load the new general extension. Renamed help.py for consistency.
This commit is contained in:
neoarz
2025-09-28 22:53:25 -04:00
parent e7ee97074b
commit 72cdd9b403
8 changed files with 81 additions and 80 deletions

View File

@@ -1,7 +1,5 @@
import discord
from discord.ext import commands
from discord.ext.commands import Context
class UptimeView(discord.ui.View):
def __init__(self, bot):
@@ -18,21 +16,12 @@ class UptimeView(discord.ui.View):
embed.set_author(name="Uptime", icon_url="https://yes.nighty.works/raw/y5SEZ9.webp")
await interaction.response.edit_message(embed=embed, view=self)
class Uptime(commands.Cog, name="uptime"):
def __init__(self, bot) -> None:
self.bot = bot
def uptime_command():
@commands.hybrid_command(
name="uptime",
description="Check how long the bot has been running.",
)
async def uptime(self, context: Context) -> None:
"""
Check how long the bot has been running.
:param context: The hybrid command context.
"""
async def uptime(self, context):
embed = discord.Embed(
title="Bot Uptime",
description=f"The bot has been running for **{self.bot.get_uptime()}**",
@@ -48,7 +37,5 @@ class Uptime(commands.Cog, name="uptime"):
await inter.followup.send(embed=embed, view=view, ephemeral=True)
else:
await context.send(embed=embed, view=view)
async def setup(bot) -> None:
await bot.add_cog(Uptime(bot))
return uptime