Original message does not get deleted

pull/8/head
sgoudham 4 years ago
parent 5a1ddb2d0c
commit ae31716729

@ -377,7 +377,7 @@ class Moderation(Cog):
colour=enso_embedmod_colours) colour=enso_embedmod_colours)
await ctx.send(embed=embed) await ctx.send(embed=embed)
else: else:
await ctx.message.delete()
for member in members: for member in members:
if role in member.roles: if role in member.roles:
await ummute_members(ctx.message, members, reason) await ummute_members(ctx.message, members, reason)
@ -415,7 +415,6 @@ class Moderation(Cog):
""" """
if not await check(ctx, members): if not await check(ctx, members):
with ctx.typing(): with ctx.typing():
await ctx.message.delete()
await unban_members(self, ctx.message, members, reason) await unban_members(self, ctx.message, members, reason)
@command(name="purge", aliases=["Purge"]) @command(name="purge", aliases=["Purge"])
@ -433,7 +432,7 @@ class Moderation(Cog):
# Delete the message sent and then the amount specified # Delete the message sent and then the amount specified
# (Only messages sent within the last 14 days) # (Only messages sent within the last 14 days)
await ctx.message.delete()
deleted = await ctx.channel.purge(limit=amount, deleted = await ctx.channel.purge(limit=amount,
after=datetime.datetime.utcnow() - timedelta(days=14)) after=datetime.datetime.utcnow() - timedelta(days=14))
@ -448,7 +447,7 @@ class Moderation(Cog):
# Delete the message sent and then the amount specified # Delete the message sent and then the amount specified
# (Only messages sent within the last 14 days) # (Only messages sent within the last 14 days)
await ctx.message.delete()
deleted = await ctx.channel.purge(limit=50, deleted = await ctx.channel.purge(limit=50,
after=datetime.datetime.utcnow() - timedelta(days=14)) after=datetime.datetime.utcnow() - timedelta(days=14))

Loading…
Cancel
Save