rewrite: help command and ui.

This commit is contained in:
2023-06-05 12:09:24 +03:00
parent eeff0f5042
commit 68fb0e9c62
8 changed files with 348 additions and 1 deletions

36
src/modules/meta/cog.py Normal file
View File

@@ -0,0 +1,36 @@
from typing import Optional
import asyncio
import discord
from discord.ext import commands as cmds
from discord import app_commands as appcmds
from wards import low_management
from meta import LionBot, LionCog, LionContext
from utils.ui import AButton, AsComponents
from . import babel
from .helpui import HelpUI
_p = babel._p
class MetaCog(LionCog):
def __init__(self, bot: LionBot):
self.bot = bot
@cmds.hybrid_command(
name=_p('cmd:help', "help"),
description=_p(
'cmd:help|desc',
"See a brief summary of my commands and features."
)
)
async def help_cmd(self, ctx: LionContext):
ui = HelpUI(
ctx.bot,
ctx.author,
ctx.guild,
show_admin=await low_management(ctx),
)
await ui.run(ctx.interaction)