From f29750a78f57f96c1979863fa46822463af4223f Mon Sep 17 00:00:00 2001 From: Myned Date: Wed, 11 Oct 2017 11:15:26 -0400 Subject: [PATCH] Exception error change and pass for NotFound --- src/main/cogs/management.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/cogs/management.py b/src/main/cogs/management.py index 6860623..97f12ba 100644 --- a/src/main/cogs/management.py +++ b/src/main/cogs/management.py @@ -135,7 +135,8 @@ class Administration: while True: message = await self.queue.get() await asyncio.sleep(RATE_LIMIT) - await message.delete() + try: await message.delete() + except d.errors.NotFound: pass async def on_message(self, channel): def check(msg): @@ -150,8 +151,6 @@ class Administration: while True: message = await self.bot.wait_for('message', check=check) await self.queue.put(message) - except d.errors.NotFound: - pass except exc.Abort: u.background['management']['auto_delete'].remove(channel.id) u.update(u.background, 'background.json') @@ -178,4 +177,4 @@ class Administration: print('Looping {}'.format(channel.id)) await ctx.send('✅ **Auto-deleting all messages in this channel.**', delete_after=5) else: raise exc.Exists - except exc.Exists: await ctx.send('❌ **Already deleting in this channel.**') + except exc.Exists: await ctx.send('❌ **Already deleting in this channel.** Type `stop` to stop deleting.')