From 054ee05a4c6391f91b66f21fba2545b0afc521ba Mon Sep 17 00:00:00 2001 From: TgCat <99109058+TgCat@users.noreply.github.com> Date: Wed, 11 Sep 2024 22:23:38 +0000 Subject: [PATCH] pylint: auto fixes --- userbot/plugins/corecmds.py | 4 +++- userbot/plugins/nekos.py | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/userbot/plugins/corecmds.py b/userbot/plugins/corecmds.py index 562d4c8979..27082bfe68 100644 --- a/userbot/plugins/corecmds.py +++ b/userbot/plugins/corecmds.py @@ -270,7 +270,9 @@ async def app_log(event): flag = event.pattern_match.group(1) flag = [*flag] thumb = thumb_image_path if os.path.exists(thumb_image_path) else None - if flag and (flag[0] != "-" or any(i not in ["-", "f", "r", "t", "o"] for i in flag)): + if flag and ( + flag[0] != "-" or any(i not in ["-", "f", "r", "t", "o"] for i in flag) + ): return await edit_delete(event, "**Invalid flag...**") with open("catub.log", "r") as file: diff --git a/userbot/plugins/nekos.py b/userbot/plugins/nekos.py index f35aa37b2f..a6b03b25d8 100644 --- a/userbot/plugins/nekos.py +++ b/userbot/plugins/nekos.py @@ -91,17 +91,17 @@ async def neko(event): if await age_verification(event, reply_to): return try: - catevent = await edit_or_reply(event, "`Processing Nekos...`") - target = useless.nekos(choose) - await catevent.delete() - nohorny = await event.client.send_file( + catevent = await edit_or_reply(event, "`Processing Nekos...`") + target = useless.nekos(choose) + await catevent.delete() + nohorny = await event.client.send_file( event.chat_id, file=target, caption=f"**{choose}**", reply_to=reply_to ) - + except Exception as e: await edit_delete(event, e) - await unsavegif(event, nohorny) - + await unsavegif(event, nohorny) + @catub.cat_cmd( pattern="dva$", @@ -328,7 +328,7 @@ async def _(event): choose = args[0] if args else "" is_nsfw = "-n" in args url = "https://api.waifu.im" - + if choose == "": url = f"{url}/search/" else: @@ -336,25 +336,25 @@ async def _(event): if is_nsfw: url += "&" if "?" in url else "?" url += "is_nsfw=True" - + if choose not in waifu_help: return await edit_delete( event, "**Wrong Category!!**\nDo `.help nm` for Category list (*_*)`" ) - + if await age_verification(event, reply_to): return - + catevent = await edit_or_reply(event, "`Processing...`") resp = requests.get(url).json() target = resp["images"][0]["url"] nohorny = await event.client.send_file( event.chat_id, file=target, caption=f"**{choose}**", reply_to=reply_to ) - + try: await unsavegif(event, nohorny) except Exception: pass - - await catevent.delete() \ No newline at end of file + + await catevent.delete()