diff --git a/cogs/skyloader.py b/cogs/skyloader.py index 1d57fde..b83fd80 100644 --- a/cogs/skyloader.py +++ b/cogs/skyloader.py @@ -1,9 +1,9 @@ -# ______ __ __ __ __ ______ ______ -# /\ ___\ /\ \/ / /\ \_\ \ /\ ___\ /\ == \ -# \ \___ \ \ \ _--. \ \____ \ \ \___ \ \ \ __< +# ______ __ __ __ __ ______ ______ +# /\ ___\ /\ \/ / /\ \_\ \ /\ ___\ /\ == \ +# \ \___ \ \ \ _--. \ \____ \ \ \___ \ \ \ __< # \/\_____\ \ \_\ \_\ \/\_____\ \/\_____\ \ \_____\ # \/_____/ \/_/\/_/ \/_____/ \/_____/ \/_____/ -# +# # AGPL-3.0 license import requests @@ -27,20 +27,20 @@ def __init__(self, bot): ) async def unloadExt(self, ctx, *, name: str): await answer(ctx, self.langpack['unloadExt']['wait'].format(ext_name), delete=False) - + if os.path.exists(f"./cogs/{name}.py"): await answer(ctx, self.langpack['unloadExt']['errorsystem']) return - + if not os.path.exists(f"./modules/custom/{name}.py"): await answer(ctx, self.langpack['unloadExt']['notfound']) return - + await bot.unload_extension(f"cogs.custom.{name}") os.remove("./cogs/custom/{name}.py") - + await answer(ctx, self.langpack['unloadExt']['done'].format(name)) - + @skySB.command( aliases=["lm", "install", "le"], description=langs.getcurrent()['loader']['loadExt']['description'] @@ -51,22 +51,22 @@ async def loadExt(self, ctx, *, url: str): if not validators.Link(url): await answer(ctx, self.langpack['loadExt']['errorlink']) return - + resp = requests.get(url) if not resp.ok: await answer(ctx, self.langpack['loadExt']['errorresp']) return - + if os.path.exists(f"./cogs/custom/{ext_name}.py"): await answer(ctx, self.langpack['loadExt']['errorexists']) return - + with open(f"./cogs/custom/{ext_name}.py", "wb") as f: f.write(resp.content) - + await bot.load_extension(f"cogs.custom.{ext_name}") await answer(ctx, self.langpack['loadExt']['done'].format(ext_name)) - + @skySB.command( aliases=["reload", "rl", "reloadcogs"], description=langs.getcurrent()['loader']['reloadExt']['description'] @@ -79,12 +79,13 @@ async def reloadExt(self, ctx): extension = file[:-3] try: await self.bot.reload_extension(f"cogs.{extension}") - msg += self.langpack['reloadExt']['format'].format(extension) + msg += self.langpack['reloadExt']['format'].format( + extension) except: pass - + await answer(ctx, msg) async def setup(bot): - await bot.add_cog(Loader(bot)) \ No newline at end of file + await bot.add_cog(Loader(bot)) diff --git a/utils.py b/utils.py index ff4b160..ac38f8b 100644 --- a/utils.py +++ b/utils.py @@ -130,7 +130,7 @@ async def answer( """ responses = [] if len(message) > 2000: - chunks = [message[i : i + 2000] for i in range(0, len(message), 2000)] + chunks = [message[i: i + 2000] for i in range(0, len(message), 2000)] for chunk in chunks: responses.append(await ctx.reply(chunk)) else: