rewrite: Ward refactor.

This commit is contained in:
2023-06-06 14:27:57 +03:00
parent e1a23695ee
commit 4bfc240530
21 changed files with 154 additions and 59 deletions

View File

@@ -25,6 +25,7 @@ class DashCog(LionCog):
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)

View File

@@ -13,7 +13,7 @@ from discord import app_commands as appcmds
from meta import LionBot, LionCog, LionContext, ctx_bot
from meta.errors import UserInputError
from wards import low_management
from wards import low_management_ward
from settings import ModelData
from settings.setting_types import TimezoneSetting
from settings.groups import SettingGroup
@@ -101,7 +101,8 @@ class GeneralSettingsCog(LionCog):
timezone=GeneralSettings.Timezone._desc
)
@appcmds.guild_only()
@cmds.check(low_management)
@appcmds.default_permissions(manage_guild=True)
@low_management_ward
async def cmd_configure_general(self, ctx: LionContext,
timezone: Optional[str] = None):
t = self.bot.translator.t