Files
croccybot/src/modules/config/cog.py
2023-06-06 14:27:57 +03:00

33 lines
797 B
Python

import discord
from discord import app_commands as appcmds
from discord.ext import commands as cmds
from meta import LionBot, LionContext, LionCog
from . import babel
from .dashboard import GuildDashboard
_p = babel._p
class DashCog(LionCog):
def __init__(self, bot: LionBot):
self.bot = bot
async def cog_load(self):
...
async def cog_unload(self):
...
@cmds.hybrid_command(
name="dashboard",
description="At-a-glance view of the server's configuration."
)
@appcmds.guild_only
@appcmds.default_permissions(manage_guild=True)
async def dashboard_cmd(self, ctx: LionContext):
ui = GuildDashboard(self.bot, ctx.guild, ctx.author.id, ctx.channel.id)
await ui.run(ctx.interaction)
await ui.wait()