Adding kick/ban/unban/purge

pull/8/head
sgoudham 4 years ago
parent 4c0ccb4317
commit abaadfaf56

@ -52,6 +52,10 @@ class Moderation(commands.Cog):
@has_guild_permissions(manage_messages=True) @has_guild_permissions(manage_messages=True)
async def purge(self, ctx, amount=100): async def purge(self, ctx, amount=100):
"""Purge Messages from Channel""" """Purge Messages from Channel"""
if amount > 100:
await ctx.send("Sorry! You can only purge up to **100** messages at a time!")
else:
channel = ctx.message.channel channel = ctx.message.channel
messages = [] messages = []
@ -59,7 +63,7 @@ class Moderation(commands.Cog):
messages.append(message) messages.append(message)
await channel.delete_messages(messages) await channel.delete_messages(messages)
await ctx.send('Messages deleted.') await ctx.send(f"{ctx.author.mention} {amount} messages deleted!")
def setup(bot): def setup(bot):

Loading…
Cancel
Save