Fixed not throwing errors when arguments for moderation commands

pull/8/head
sgoudham 4 years ago
parent 9843898045
commit a0af4668b8

@ -57,7 +57,7 @@ async def send_to_modlogs(self, ctx, target, reason, action):
await channel.send(embed=embed) await channel.send(embed=embed)
async def check(self, ctx, members): async def check(ctx, members):
""" """
Check Function Check Function
@ -69,11 +69,11 @@ async def check(self, ctx, members):
if not len(members): if not len(members):
desc = f"Not Correct Syntax!\nUse **{ctx.prefix}help** to find how to use **{ctx.command}**", desc = f"Not Correct Syntax!\nUse **{ctx.prefix}help** to find how to use **{ctx.command}**",
await self.bot.generate_embed(ctx, desc=desc) await ctx.bot.generate_embed(ctx, desc=desc)
return True return True
elif ctx.author in members: elif ctx.author in members:
await self.bot.generate_embed(ctx, desc="**❌ Forbidden Action ❌**") await ctx.bot.generate_embed(ctx, desc="**❌ Forbidden Action ❌**")
return True return True
@ -273,7 +273,7 @@ class Moderation(Cog):
Multiple Members can be Kicked at Once Multiple Members can be Kicked at Once
""" """
if not await check(self, ctx, members): if not await check(ctx, members):
with ctx.typing(): with ctx.typing():
# Send embed of the kicked member # Send embed of the kicked member
await kick_members(self, ctx, members, reason) await kick_members(self, ctx, members, reason)
@ -287,7 +287,7 @@ class Moderation(Cog):
Multiple Members can be Muted At Once Multiple Members can be Muted At Once
""" """
if not await check(self, ctx, members): if not await check(ctx, members):
with ctx.typing(): with ctx.typing():
# Get muted role from the server # Get muted role from the server
@ -300,7 +300,7 @@ class Moderation(Cog):
await channel.set_permissions(muted, read_messages=False) await channel.set_permissions(muted, read_messages=False)
await mute_members(self, ctx, members, reason, muted) await mute_members(self, ctx, members, reason, muted)
else: else:
await mute_members(self, ctx, members, reason, role) await mute_members(self, ctx, members, reason, role)
@ -314,7 +314,7 @@ class Moderation(Cog):
""" """
unmute = False unmute = False
if not await check(self, ctx, members): if not await check(ctx, members):
with ctx.typing(): with ctx.typing():
role = discord.utils.get(ctx.guild.roles, name="Muted") role = discord.utils.get(ctx.guild.roles, name="Muted")
@ -346,7 +346,7 @@ class Moderation(Cog):
Multiple Members can be banned at once Multiple Members can be banned at once
""" """
if not await check(self, ctx, members): if not await check(ctx, members):
with ctx.typing(): with ctx.typing():
await ban_members(self, ctx, members, reason) await ban_members(self, ctx, members, reason)
@ -360,7 +360,7 @@ class Moderation(Cog):
Unban Member(s) from Server Unban Member(s) from Server
Multiple Members can be Unbanned At Once Multiple Members can be Unbanned At Once
""" """
if not await check(self, ctx, members): if not await check(ctx, members):
with ctx.typing(): with ctx.typing():
await unban_members(self, ctx, members, reason) await unban_members(self, ctx, members, reason)

Loading…
Cancel
Save