mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 17:02:32 -05:00
* added hierarchy check for rename
added hierarchy check for rename from utils
* format and self check
changed formats and added statement if me != member
* black format
apply black formatting and fix typo
* tox style
tox i guess
* tox again
:<
* Update redbot/cogs/mod/names.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Fix styling
(cherry picked from commit 8880251749)
Co-authored-by: Enul <xchedeiklo@gmail.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: Enul <xchedeiklo@gmail.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user