Skip to content

Commit

Permalink
pylint: auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TgCat committed Sep 11, 2024
1 parent 670acda commit 054ee05
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
4 changes: 3 additions & 1 deletion userbot/plugins/corecmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
28 changes: 14 additions & 14 deletions userbot/plugins/nekos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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$",
Expand Down Expand Up @@ -328,33 +328,33 @@ 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:
url = f"{url}/search/?included_tags={choose}"
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()

await catevent.delete()

0 comments on commit 054ee05

Please sign in to comment.