From 225bebff0a99fdfb494a2363f5f92969bbd3850b Mon Sep 17 00:00:00 2001 From: Myned Date: Sat, 14 Oct 2017 15:28:00 -0400 Subject: [PATCH] Removed redundant "./" from file declarations, changed d.errors to err. --- src/main/cogs/management.py | 9 +++++---- src/main/utils/utils.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/cogs/management.py b/src/main/cogs/management.py index ad225e8..44eef9a 100644 --- a/src/main/cogs/management.py +++ b/src/main/cogs/management.py @@ -2,6 +2,7 @@ import asyncio import traceback as tb import discord as d +from discord import errors as err from discord.ext import commands from misc import exceptions as exc @@ -80,7 +81,7 @@ class Administration: for channel in channels: try: ref = await channel.get_message(reference) - except d.errors.NotFound: + except err.NotFound: continue history = [] try: @@ -135,7 +136,7 @@ class Administration: try: if not message.pinned: await message.delete() - except d.errors.NotFound: + except err.NotFound: pass async def on_message(self, channel): @@ -153,7 +154,7 @@ class Administration: await self.queue.put(message) except exc.Abort: u.tasks['management']['auto_delete'].remove(channel.id) - u.dump(u.tasks, './cogs/tasks.pkl') + u.dump(u.tasks, 'cogs/tasks.pkl') print('Stopped looping {}'.format(channel.id)) await channel.send('✅ **Stopped deleting messages in** {}**.**'.format(channel.mention), delete_after=5) except AttributeError: @@ -168,7 +169,7 @@ class Administration: try: if channel.id not in u.tasks.setdefault('management', {}).setdefault('auto_delete', []): u.tasks['management']['auto_delete'].append(channel.id) - u.dump(u.tasks, './cogs/tasks.pkl') + u.dump(u.tasks, 'cogs/tasks.pkl') self.bot.loop.create_task(self.on_message(channel)) self.bot.loop.create_task(self.delete()) print('Looping #{}'.format(channel.name)) diff --git a/src/main/utils/utils.py b/src/main/utils/utils.py index cf23394..45806af 100644 --- a/src/main/utils/utils.py +++ b/src/main/utils/utils.py @@ -42,7 +42,7 @@ def dump(obj, filename): pkl.dump(obj, outfile) -tasks = setdefault('./cogs/tasks.pkl', {}) +tasks = setdefault('cogs/tasks.pkl', {}) async def clear(obj, interval=10 * 60, replace=None):