Skip to content

Commit

Permalink
[Automod] Add stricter permission requirements to commands
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustyJAID committed Oct 22, 2023
1 parent ee4dfc6 commit 6ca39d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions automod/automod.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ async def view_automod(self, ctx: commands.Context):
await BaseMenu(pages, self).start(ctx)

@automod.command(name="actions", aliases=["action"])
@commands.mod_or_permissions(manage_guild=True)
async def view_automod_actions(self, ctx: commands.Context):
"""View the servers saved automod actions"""
actions_dict = await self.config.guild(ctx.guild).actions()
Expand All @@ -91,6 +92,7 @@ async def view_automod_actions(self, ctx: commands.Context):
await BaseMenu(pages, self).start(ctx)

@automod.command(name="triggers", aliases=["trigger"])
@commands.mod_or_permissions(manage_guild=True)
async def view_automod_triggers(self, ctx: commands.Context):
"""View the servers saved automod triggers"""
triggers_dict = await self.config.guild(ctx.guild).triggers()
Expand All @@ -111,6 +113,7 @@ async def create(self, ctx: commands.Context):

@create.command(name="rule")
@commands.bot_has_permissions(manage_guild=True)
@commands.admin_or_permissions(manage_guild=True)
async def create_automod_rule(
self, ctx: commands.Context, name: str, *, rule: AutoModRuleFlags
):
Expand Down Expand Up @@ -144,6 +147,7 @@ async def create_automod_rule(
await BaseMenu(pages, self).start(ctx)

@create.command(name="action", aliases=["a"])
@commands.admin_or_permissions(manage_guild=True)
async def create_automod_action(
self, ctx: commands.Context, name: str, *, action: AutoModActionFlags
):
Expand Down Expand Up @@ -184,6 +188,7 @@ async def create_automod_action(
await ctx.send(f"Saving action `{name}` with the following settings:\n{action.to_str()}")

@create.command(name="trigger")
@commands.admin_or_permissions(manage_guild=True)
async def create_automod_trigger(
self, ctx: commands.Context, name: str, *, trigger: AutoModTriggerFlags
):
Expand Down

0 comments on commit 6ca39d9

Please sign in to comment.