Skip to content

Commit

Permalink
delete the messages
Browse files Browse the repository at this point in the history
  • Loading branch information
fourjr committed Nov 15, 2017
1 parent 2a35755 commit 5821c90
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cogs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1150,15 +1150,18 @@ def agreecheck(self, message):

@cc.command()
async def wipe(self, ctx):
await ctx.send('Are you sure you want to delete all your custom commands?')
message1 = await ctx.send('Are you sure you want to delete all your custom commands?')
try:
await self.bot.wait_for('message', check=self.agreecheck, timeout=5)
message2 = await self.bot.wait_for('message', check=self.agreecheck, timeout=5)
except asyncio.TimeoutError:
await message1.delete()
return
else:
await message1.delete()
await message2.delete()
await ctx.send('Wiping...', delete_after=2)
if await ctx.updatedata('data/cc.json', json.dumps({"pycc":{},"textcc":{}}, indent=4), f'Wipe custom commands'):
await ctx.send('Wiped all commands.')
await ctx.send('Wiped all commands.', delete_after=2)

#reading cc
async def on_message(self, message):
Expand Down

0 comments on commit 5821c90

Please sign in to comment.