Changed small typo for unmuting modlog embed

pull/8/head
sgoudham 4 years ago
parent a0d2002d0d
commit e794f0d7de

@ -12,6 +12,30 @@ from db import connection
from settings import enso_embedmod_colours, get_modlog_for_guild, storeRoles, clearRoles from settings import enso_embedmod_colours, get_modlog_for_guild, storeRoles, clearRoles
async def check(ctx, members, action):
"""
Check Function
- Checks if all arguments are given
- Checks if user mentions themselves
Error will be thrown in these two cases
"""
if not len(members):
embed = Embed(description="Not Correct Syntax!"
f"\nUse **{ctx.prefix}help** to find how to use **{ctx.command}**",
colour=enso_embedmod_colours)
await ctx.send(embed=embed)
return True
elif ctx.author in members:
embed = Embed(description=f"**❌ You Can't {action} Yourself Baka! ❌**",
colour=enso_embedmod_colours)
await ctx.send(embed=embed)
return True
async def ummute_members(message, targets, reason): async def ummute_members(message, targets, reason):
""" """
@ -59,7 +83,7 @@ async def ummute_members(message, targets, reason):
else: else:
channel = message.guild.get_channel(int(modlog)) channel = message.guild.get_channel(int(modlog))
embed = Embed(title="Member Muted", embed = Embed(title="Member Unmuted",
colour=enso_embedmod_colours, colour=enso_embedmod_colours,
timestamp=datetime.datetime.utcnow()) timestamp=datetime.datetime.utcnow())
@ -250,19 +274,10 @@ class Moderation(Cog):
Multiple Members can be Kicked at Once Multiple Members can be Kicked at Once
""" """
# When no members are entered. Throw an error with ctx.typing():
if not len(members): if await check(ctx, members, action="Kick"):
embed = Embed(description="Not Correct Syntax!" return
"\nUse **{}help** to find how to use **{}**".format(ctx.prefix, ctx.command),
colour=enso_embedmod_colours)
await ctx.send(embed=embed)
# Throw error when user tries to kick themselves
elif ctx.author in members:
embed = Embed(description="**❌ You Can't Kick Yourself Baka! ❌**",
colour=enso_embedmod_colours)
await ctx.send(embed=embed)
# As long as all members are valid
else:
# Send embed of the kicked member # Send embed of the kicked member
await kick_members(ctx.message, members, reason) await kick_members(ctx.message, members, reason)
@ -275,18 +290,9 @@ class Moderation(Cog):
Multiple Members can be Muted At Once Multiple Members can be Muted At Once
""" """
with ctx.typing(): with ctx.typing():
# When no members are entered. Throw an error if await check(ctx, members, action="Mute"):
if not len(members): return
embed = Embed(description="Not Correct Syntax!"
"\nUse **{}help** to find how to use **{}**".format(ctx.prefix, ctx.command),
colour=enso_embedmod_colours)
await ctx.send(embed=embed)
# Throw error when user tries to mute themselves
elif ctx.author in members:
embed = Embed(description="**❌ You Can't Mute Yourself Baka! ❌**",
colour=enso_embedmod_colours)
await ctx.send(embed=embed)
else:
role = discord.utils.get(ctx.guild.roles, name="Muted") role = discord.utils.get(ctx.guild.roles, name="Muted")
if role is None: if role is None:
# Setting up the role permissions for the Muted Role # Setting up the role permissions for the Muted Role
@ -312,19 +318,8 @@ class Moderation(Cog):
unmute = False unmute = False
with ctx.typing(): with ctx.typing():
if await check(ctx, members, action="Unmute"):
# When no members are entered. Throw an error return
if not len(members):
embed = Embed(description="Not Correct Syntax!"
"\nUse **{}help** to find how to use **{}**".format(ctx.prefix, ctx.command),
colour=enso_embedmod_colours)
await ctx.send(embed=embed)
# Throw error when user tries to unmute themselves
elif ctx.author in members:
embed = Embed(description="**❌ You Can't Unmute Yourself Baka! ❌**",
colour=enso_embedmod_colours)
await ctx.send(embed=embed)
role = discord.utils.get(ctx.guild.roles, name="Muted") role = discord.utils.get(ctx.guild.roles, name="Muted")
if role is None: if role is None:
@ -353,19 +348,10 @@ class Moderation(Cog):
Multiple Members can be banned at once Multiple Members can be banned at once
""" """
# When no members are entered. Throw an error with ctx.typing():
if not len(members): if await check(ctx, members, action="Ban"):
embed = Embed(description="Not Correct Syntax!" return
"\nUse **{}help** to find how to use **{}**".format(ctx.prefix, ctx.command),
colour=enso_embedmod_colours)
await ctx.send(embed=embed)
# Throw error when user tries to kick themselves
elif ctx.author in members:
embed = Embed(description="**❌ You Can't Ban Yourself Baka! ❌**",
colour=enso_embedmod_colours)
await ctx.send(embed=embed)
# As long as all members are valid
else:
# Send embed of the Banned member # Send embed of the Banned member
await ban_members(ctx.message, members, reason) await ban_members(ctx.message, members, reason)

Loading…
Cancel
Save