Skip to content

Commit

Permalink
Merge pull request #259 from The-4th-Hokage/deepsource-transform-a283…
Browse files Browse the repository at this point in the history
…5b4e

Format code with yapf, black, autopep8 and isort
  • Loading branch information
Dhruvacube authored Oct 24, 2021
2 parents 4443726 + aa72a89 commit 0b9dd08
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions minato_namikaze/bot_files/lib/classes/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ async def convert(self, ctx, argument):
)()

if not can_execute_action(ctx, ctx.author, member):
raise commands.BadArgument("You cannot do this action on this user due to role hierarchy.")
raise commands.BadArgument(
"You cannot do this action on this user due to role hierarchy."
)
return member


Expand All @@ -72,13 +74,17 @@ async def convert(self, ctx, argument):
try:
return await ctx.guild.fetch_ban(discord.Object(id=member_id))
except discord.NotFound:
raise commands.BadArgument("This member has not been banned before.") from None
raise commands.BadArgument(
"This member has not been banned before."
) from None

ban_list = await ctx.guild.bans()
entity = discord.utils.find(lambda u: str(u.user) == argument, ban_list)
entity = discord.utils.find(
lambda u: str(u.user) == argument, ban_list)

if entity is None:
raise commands.BadArgument("This member has not been banned before.")
raise commands.BadArgument(
"This member has not been banned before.")
return entity


Expand All @@ -88,7 +94,9 @@ async def convert(self, ctx, argument):

if len(ret) > 512:
reason_max = 512 - len(ret) + len(argument)
raise commands.BadArgument(f"Reason is too long ({len(argument)}/{reason_max})")
raise commands.BadArgument(
f"Reason is too long ({len(argument)}/{reason_max})"
)
return ret


Expand Down

0 comments on commit 0b9dd08

Please sign in to comment.