[V3 Admin] Correct spelling of 'hierarchy' (#1714)

This commit is contained in:
rngesus-wept 2018-05-27 16:25:26 -04:00 committed by palmtree5
parent f4b640126b
commit 537531803a

View File

@ -20,14 +20,14 @@ GENERIC_FORBIDDEN = (
HIERARCHY_ISSUE = ( HIERARCHY_ISSUE = (
"I tried to add {role.name} to {member.display_name} but that role" "I tried to add {role.name} to {member.display_name} but that role"
" is higher than my highest role in the Discord heirarchy so I was" " is higher than my highest role in the Discord hierarchy so I was"
" unable to successfully add it. Please give me a higher role and " " unable to successfully add it. Please give me a higher role and "
"try again." "try again."
) )
USER_HIERARCHY_ISSUE = ( USER_HIERARCHY_ISSUE = (
"I tried to add {role.name} to {member.display_name} but that role" "I tried to add {role.name} to {member.display_name} but that role"
" is higher than your highest role in the Discord heirarchy so I was" " is higher than your highest role in the Discord hierarchy so I was"
" unable to successfully add it. Please get a higher role and " " unable to successfully add it. Please get a higher role and "
"try again." "try again."
) )
@ -75,7 +75,7 @@ class Admin:
return self.__current_announcer.active or False return self.__current_announcer.active or False
@staticmethod @staticmethod
def pass_heirarchy_check(ctx: commands.Context, role: discord.Role) -> bool: def pass_hierarchy_check(ctx: commands.Context, role: discord.Role) -> bool:
""" """
Determines if the bot has a higher role than the given one. Determines if the bot has a higher role than the given one.
:param ctx: :param ctx:
@ -85,7 +85,7 @@ class Admin:
return ctx.guild.me.top_role > role return ctx.guild.me.top_role > role
@staticmethod @staticmethod
def pass_user_heirarchy_check(ctx: commands.Context, role: discord.Role) -> bool: def pass_user_hierarchy_check(ctx: commands.Context, role: discord.Role) -> bool:
""" """
Determines if a user is allowed to add/remove/edit the given role. Determines if a user is allowed to add/remove/edit the given role.
:param ctx: :param ctx:
@ -98,7 +98,7 @@ class Admin:
try: try:
await member.add_roles(role) await member.add_roles(role)
except discord.Forbidden: except discord.Forbidden:
if not self.pass_heirarchy_check(ctx, role): if not self.pass_hierarchy_check(ctx, role):
await self.complain(ctx, HIERARCHY_ISSUE, role=role, member=member) await self.complain(ctx, HIERARCHY_ISSUE, role=role, member=member)
else: else:
await self.complain(ctx, GENERIC_FORBIDDEN) await self.complain(ctx, GENERIC_FORBIDDEN)
@ -112,7 +112,7 @@ class Admin:
try: try:
await member.remove_roles(role) await member.remove_roles(role)
except discord.Forbidden: except discord.Forbidden:
if not self.pass_heirarchy_check(ctx, role): if not self.pass_hierarchy_check(ctx, role):
await self.complain(ctx, HIERARCHY_ISSUE, role=role, member=member) await self.complain(ctx, HIERARCHY_ISSUE, role=role, member=member)
else: else:
await self.complain(ctx, GENERIC_FORBIDDEN) await self.complain(ctx, GENERIC_FORBIDDEN)
@ -134,7 +134,7 @@ class Admin:
""" """
if user is None: if user is None:
user = ctx.author user = ctx.author
if self.pass_user_heirarchy_check(ctx, rolename): if self.pass_user_hierarchy_check(ctx, rolename):
# noinspection PyTypeChecker # noinspection PyTypeChecker
await self._addrole(ctx, user, rolename) await self._addrole(ctx, user, rolename)
else: else:
@ -152,7 +152,7 @@ class Admin:
""" """
if user is None: if user is None:
user = ctx.author user = ctx.author
if self.pass_user_heirarchy_check(ctx, rolename): if self.pass_user_hierarchy_check(ctx, rolename):
# noinspection PyTypeChecker # noinspection PyTypeChecker
await self._removerole(ctx, user, rolename) await self._removerole(ctx, user, rolename)
else: else:
@ -181,7 +181,7 @@ class Admin:
author = ctx.author author = ctx.author
reason = "{}({}) changed the colour of role '{}'".format(author.name, author.id, role.name) reason = "{}({}) changed the colour of role '{}'".format(author.name, author.id, role.name)
if not self.pass_user_heirarchy_check(ctx, role): if not self.pass_user_hierarchy_check(ctx, role):
await self.complain(ctx, USER_HIERARCHY_ISSUE) await self.complain(ctx, USER_HIERARCHY_ISSUE)
return return
@ -207,7 +207,7 @@ class Admin:
author.name, author.id, old_name, name author.name, author.id, old_name, name
) )
if not self.pass_user_heirarchy_check(ctx, role): if not self.pass_user_hierarchy_check(ctx, role):
await self.complain(ctx, USER_HIERARCHY_ISSUE) await self.complain(ctx, USER_HIERARCHY_ISSUE)
return return