From 77cdbf8dd6fdaf1c9f9bac3f439fff5a18342e1a Mon Sep 17 00:00:00 2001 From: Michael H Date: Tue, 22 May 2018 19:27:11 -0400 Subject: [PATCH] [V3 Alias] Add checks to alias add/del (#1676) --- redbot/cogs/alias/alias.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/redbot/cogs/alias/alias.py b/redbot/cogs/alias/alias.py index 82d230ff9..e2ba231cc 100644 --- a/redbot/cogs/alias/alias.py +++ b/redbot/cogs/alias/alias.py @@ -3,7 +3,7 @@ from re import search from typing import Generator, Tuple, Iterable import discord -from redbot.core import Config, commands +from redbot.core import Config, commands, checks from redbot.core.i18n import Translator, cog_i18n from redbot.core.utils.chat_formatting import box @@ -185,6 +185,7 @@ class Alias: if ctx.invoked_subcommand is None or isinstance(ctx.invoked_subcommand, commands.Group): await ctx.send_help() + @checks.mod_or_permissions(manage_guild=True) @alias.command(name="add") @commands.guild_only() async def _add_alias(self, ctx: commands.Context, alias_name: str, *, command): @@ -236,6 +237,7 @@ class Alias: _("A new alias with the trigger `{}`" " has been created.").format(alias_name) ) + @checks.is_owner() @global_.command(name="add") async def _add_global_alias(self, ctx: commands.Context, alias_name: str, *, command): """ @@ -312,6 +314,7 @@ class Alias: else: await ctx.send(_("There is no alias with the name `{}`").format(alias_name)) + @checks.mod_or_permissions(manage_guild=True) @alias.command(name="del") @commands.guild_only() async def _del_alias(self, ctx: commands.Context, alias_name: str): @@ -332,6 +335,7 @@ class Alias: else: await ctx.send(_("Alias with name `{}` was not found.").format(alias_name)) + @checks.is_owner() @global_.command(name="del") async def _del_global_alias(self, ctx: commands.Context, alias_name: str): """