diff --git a/redbot/cogs/mod/names.py b/redbot/cogs/mod/names.py index f7f531ef6..1a89fbdda 100644 --- a/redbot/cogs/mod/names.py +++ b/redbot/cogs/mod/names.py @@ -10,6 +10,7 @@ from redbot.core.utils.common_filters import ( ) from redbot.core.utils.mod import get_audit_reason from .abc import MixinMeta +from .utils import is_allowed_by_hierarchy _ = i18n.Translator("Mod", __file__) @@ -55,6 +56,16 @@ class ModInfo(MixinMeta): "equal to me in the role hierarchy." ) ) + elif ctx.author != member and not await is_allowed_by_hierarchy( + self.bot, self.config, ctx.guild, ctx.author, member + ): + await ctx.send( + _( + "I cannot let you do that. You are " + "not higher than the user in the role " + "hierarchy." + ) + ) else: try: await member.edit(reason=get_audit_reason(ctx.author, None), nick=nickname)