fix: Add missing permission wards.

This commit is contained in:
2023-08-16 23:25:12 +03:00
parent 41c0f2d094
commit fde42226ed
5 changed files with 11 additions and 5 deletions

View File

@@ -196,7 +196,7 @@ class LionBot(Bot):
extra={'action': 'BotError', 'with_ctx': True} extra={'action': 'BotError', 'with_ctx': True}
) )
try: try:
await ctx.error_rely(exception.message) await ctx.error_reply(exception.message)
except Exception: except Exception:
pass pass
except Exception: except Exception:

View File

@@ -511,6 +511,7 @@ class Economy(LionCog):
"Target user or role to view or update. Use @everyone to reset the entire guild." "Target user or role to view or update. Use @everyone to reset the entire guild."
), ),
) )
@low_management_ward
async def economy_reset_cmd( async def economy_reset_cmd(
self, self,
ctx: LionContext, ctx: LionContext,
@@ -634,7 +635,7 @@ class Economy(LionCog):
# Do not create the member row if it does not already exist. # Do not create the member row if it does not already exist.
# TODO: Audit logging trail # TODO: Audit logging trail
await ctx.bot.core.data.Member.table.update_where( await ctx.bot.core.data.Member.table.update_where(
guuildid=ctx.guild.id, guildid=ctx.guild.id,
userid=target.id, userid=target.id,
).set(coins=starting_balance) ).set(coins=starting_balance)
await ctx.reply( await ctx.reply(

View File

@@ -4,8 +4,9 @@ The dashboard shows a summary of the various registered global bot settings.
import discord import discord
import discord.ext.commands as cmds import discord.ext.commands as cmds
import discord.app_commands as appcmd
from meta import LionBot, LionCog, LionContext from meta import LionBot, LionCog, LionContext, conf
from meta.app import appname from meta.app import appname
from wards import sys_admin_ward from wards import sys_admin_ward
@@ -15,6 +16,8 @@ from settings.groups import SettingGroup
class LeoSettings(LionCog): class LeoSettings(LionCog):
depends = {'CoreCog'} depends = {'CoreCog'}
admin_guilds = conf.bog.getintlist('admin_guilds')
def __init__(self, bot: LionBot): def __init__(self, bot: LionBot):
self.bot = bot self.bot = bot
@@ -23,6 +26,7 @@ class LeoSettings(LionCog):
@cmds.hybrid_group( @cmds.hybrid_group(
name="leo" name="leo"
) )
@appcmd.guilds(*admin_guilds)
@sys_admin_ward @sys_admin_ward
async def leo_group(self, ctx: LionContext): async def leo_group(self, ctx: LionContext):
""" """

View File

@@ -376,12 +376,12 @@ class PresenceCtrl(LionCog):
name="presence", name="presence",
description="Globally set the bot status and activity." description="Globally set the bot status and activity."
) )
@sys_admin_ward
@appcmds.describe( @appcmds.describe(
status="Online status (online | idle | dnd | offline)", status="Online status (online | idle | dnd | offline)",
type="Activity type (watching | listening | playing | streaming)", type="Activity type (watching | listening | playing | streaming)",
string="Activity name, supports substitutions $in_vc, $voice_channels, $shard_guilds, $shard_members" string="Activity name, supports substitutions $in_vc, $voice_channels, $shard_guilds, $shard_members"
) )
@sys_admin_ward
async def presence_cmd( async def presence_cmd(
self, self,
ctx: LionContext, ctx: LionContext,

View File

@@ -15,7 +15,7 @@ from meta.sharding import THIS_SHARD
from meta.app import appname from meta.app import appname
from utils.lib import utc_now, error_embed from utils.lib import utc_now, error_embed
from wards import low_management_ward from wards import low_management_ward, sys_admin_ward
from . import babel, logger from . import babel, logger
from .data import TextTrackerData from .data import TextTrackerData
@@ -326,6 +326,7 @@ class TextTrackerCog(LionCog):
xp_per_period=TextTrackerGlobalSettings.XPPerPeriod._desc, xp_per_period=TextTrackerGlobalSettings.XPPerPeriod._desc,
word_xp=TextTrackerGlobalSettings.WordXP._desc, word_xp=TextTrackerGlobalSettings.WordXP._desc,
) )
@sys_admin_ward
async def leo_configure_text_tracking_cmd(self, ctx: LionContext, async def leo_configure_text_tracking_cmd(self, ctx: LionContext,
xp_per_period: Optional[appcmds.Range[int, 0, 2**15]] = None, xp_per_period: Optional[appcmds.Range[int, 0, 2**15]] = None,
word_xp: Optional[appcmds.Range[int, 0, 2**15]] = None): word_xp: Optional[appcmds.Range[int, 0, 2**15]] = None):