From c5a72bb4590fa06f07dc116152653213a7358705 Mon Sep 17 00:00:00 2001 From: Raizel <115201759+RaizelX1@users.noreply.github.com> Date: Wed, 12 Oct 2022 07:56:23 -0700 Subject: [PATCH 1/2] Update waifu.py --- waifu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waifu.py b/waifu.py index 3bb7615..d161dbd 100644 --- a/waifu.py +++ b/waifu.py @@ -84,7 +84,7 @@ def get_data(img): @waifu.add_handler( MessageHandler( - filters.user(BOT_LIST), filters.group & ~filters.edited & ~filters.forwarded + filters.user(BOT_LIST), filters.group & ~filters.forwarded ) ) async def autoprotecc(_, message): From da4ddc24fe01bae44db9c05c3fa99c69d715d8e9 Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Wed, 12 Oct 2022 14:56:50 +0000 Subject: [PATCH 2/2] 'Refactored by Sourcery' --- waifu.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/waifu.py b/waifu.py index d161dbd..cee0b31 100644 --- a/waifu.py +++ b/waifu.py @@ -21,7 +21,7 @@ API_HASH = str(os.environ.get("API_HASH")) STRING_SESSION = str(os.environ.get("STRING_SESSION")) DELAY = int(os.environ.get("DELAY")) - BOT_LIST = int(x for x in os.environ.get("BOT_LIST").split()) + BOT_LIST = int(iter(os.environ.get("BOT_LIST").split())) else: from config import config @@ -88,18 +88,19 @@ def get_data(img): ) ) async def autoprotecc(_, message): - if message.photo: - if "add" in message.caption.lower(): - img = await message.download() - fetchUrl = await get_data(img) - match = await ParseSauce(fetchUrl + "&preferences?hl=en&fg=1#languages") - guess = match["best_guess"] - if not guess: - return await message.reply_text("Failed to protecc this waifu.") - guess = guess.replace("Results for", "") - await time.sleep(DELAY) - kek = await message.reply_text(f"/protecc {guess}") - await kek.delete() + if not message.photo: + return + if "add" in message.caption.lower(): + img = await message.download() + fetchUrl = await get_data(img) + match = await ParseSauce(f"{fetchUrl}&preferences?hl=en&fg=1#languages") + guess = match["best_guess"] + if not guess: + return await message.reply_text("Failed to protecc this waifu.") + guess = guess.replace("Results for", "") + await time.sleep(DELAY) + kek = await message.reply_text(f"/protecc {guess}") + await kek.delete() waifu.start()