Skip to content

Commit

Permalink
Fixed clean cmd
Browse files Browse the repository at this point in the history
🤔
  • Loading branch information
XAOS1502 authored Dec 23, 2017
1 parent 925cc45 commit 2dc0cea
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cogs/mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,13 @@ async def purge(self, ctx, limit : int, member:discord.Member=None):
await message.delete()

@commands.command()
async def clean(self, ctx, limit : int=15):
'''Clean a number of your own messages'''
await ctx.purge(limit=limit+1, check=lambda m: m.author == ctx.author)

async def clean(self, ctx, limit: int=15):
''' Clean a number of your own messages
Usage: {prefix}clean 5 '''
async for ctx.message in ctx.channel.history(limit=limit):
if ctx.message.author == self.bot.user:
await ctx.message.delete()
await asyncio.sleep(3.0)

@commands.command()
async def bans(self, ctx):
Expand Down Expand Up @@ -297,5 +300,6 @@ async def server(self, ctx, server:discord.Guild = None, *, reason=None):
progress.delete()
await ctx.send(embed=emb)


def setup(bot):
bot.add_cog(Mod(bot))

0 comments on commit 2dc0cea

Please sign in to comment.