Files
croccybot/src/modules/meta/cog.py
JetRaidz 1946077ded Fix help command not working in DMs
The `help` application command now functions as expected in DMs.
This shows both member-level and admin-level commands.

- Fixed `shop open` appearing in the DM slash command list
- Fixed `support_guild` not being included in `example-bot.conf`
- The following wards now require the `Guild` context to be passed to them:
	- `low_management`
	- `high_management`
2023-09-19 18:32:29 +12:00

38 lines
952 B
Python

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):
await ctx.interaction.response.defer(thinking=True, ephemeral=True)
ui = HelpUI(
ctx.bot,
ctx.author,
ctx.guild,
show_admin=await low_management(ctx.bot, ctx.author, ctx.guild),
)
await ui.run(ctx.interaction)