mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 11:40:12 +01:00
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:
@@ -1,23 +1,13 @@
|
||||
import platform
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord.ext.commands import Context
|
||||
|
||||
|
||||
class BotInfo(commands.Cog, name="botinfo"):
|
||||
def __init__(self, bot) -> None:
|
||||
self.bot = bot
|
||||
|
||||
def botinfo_command():
|
||||
@commands.hybrid_command(
|
||||
name="botinfo",
|
||||
description="Get some useful (or not) information about the bot.",
|
||||
)
|
||||
async def botinfo(self, context: Context) -> None:
|
||||
"""
|
||||
Get some useful (or not) information about the bot.
|
||||
|
||||
:param context: The hybrid command context.
|
||||
"""
|
||||
async def botinfo(self, context):
|
||||
embed = discord.Embed(
|
||||
title="Syntrel Discord Bot",
|
||||
color=0x7289DA,
|
||||
@@ -36,6 +26,5 @@ class BotInfo(commands.Cog, name="botinfo"):
|
||||
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
||||
else:
|
||||
await context.send(embed=embed)
|
||||
|
||||
async def setup(bot) -> None:
|
||||
await bot.add_cog(BotInfo(bot))
|
||||
|
||||
return botinfo
|
||||
Reference in New Issue
Block a user