Skip to content

Commit

Permalink
pylint: auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TgCat committed Jan 31, 2024
1 parent a003b6f commit b50b492
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 29 deletions.
8 changes: 5 additions & 3 deletions userbot/assistant/inlinefm.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,11 @@ async def send(event):
mime_type=mime_type,
attributes=attributes,
force_file=False,
thumb=await event.client.upload_file(thumb_image_path)
if thumb_image_path
else None,
thumb=(
await event.client.upload_file(thumb_image_path)
if thumb_image_path
else None
),
)
await event.edit("hi", file=media)

Expand Down
26 changes: 16 additions & 10 deletions userbot/core/inlinebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def main_menu():
if Config.BADCAT:
switch_button = [
(
Button.inline(f"➕ Extra ({len(GRP_INFO['extra'])})", data="extra_menu"),
Button.inline(
f"➕ Extra ({len(GRP_INFO['extra'])})", data="extra_menu"
),
Button.inline(
f"⚰️ Useless ({len(GRP_INFO['useless'])})", data="useless_menu"
),
Expand Down Expand Up @@ -579,22 +581,26 @@ async def hide_troll_secret(event, query, match, match3):
jsondata = False
timestamp = int(time.time() * 2)
new_msg = {
str(timestamp): {"text": query}
if match3
else {"userid": user_list, "text": query}
str(timestamp): (
{"text": query} if match3 else {"userid": user_list, "text": query}
)
}
buttons = [Button.inline(info_type[2], data=f"{info_type[0]}_{timestamp}")]

result = await build_article(
event,
title=f"{info_type[0].title()} message to {sandy}.",
description="Send hidden text in chat."
if match3
else f"Only he/she/they {info_type[1]} open it.",
description=(
"Send hidden text in chat."
if match3
else f"Only he/she/they {info_type[1]} open it."
),
thumbnail=get_thumb(f"{info_type[0]}.png"),
text="✖✖✖"
if match3
else f"🔒 A whisper message to {sandy}, Only he/she can open it.",
text=(
"✖✖✖"
if match3
else f"🔒 A whisper message to {sandy}, Only he/she can open it."
),
buttons=buttons,
)
return result, old_msg, jsondata, new_msg
Expand Down
6 changes: 3 additions & 3 deletions userbot/helpers/functions/utube.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ def download_button(vid: str, body: bool = False): # sourcery no-metrics
if video.get("acodec") != "none":
bitrrate = int(video.get("abr", 0))
if bitrrate != 0:
audio_dict[
bitrrate
] = f"🎵 {bitrrate}Kbps ({humanbytes(fr_size) or 'N/A'})"
audio_dict[bitrrate] = (
f"🎵 {bitrrate}Kbps ({humanbytes(fr_size) or 'N/A'})"
)

video_btns = []
for frmt in qual_list:
Expand Down
8 changes: 5 additions & 3 deletions userbot/plugins/fedutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,11 @@ async def fetch_fedinfo(event):
response = await conv.get_response()
await edit_or_reply(
catevent,
f"**Fedid:** ```{input_str}```\n\n{response.text}"
if input_str
else response.text,
(
f"**Fedid:** ```{input_str}```\n\n{response.text}"
if input_str
else response.text
),
)
except Exception as e:
await edit_delete(
Expand Down
4 changes: 1 addition & 3 deletions userbot/plugins/gadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,7 @@ async def gablist(event):
if a_user.reason:
GBANNED_LIST += f"👉 [{a_user.chat_id}](tg://user?id={a_user.chat_id}) for {a_user.reason}\n"
else:
GBANNED_LIST += (
f"👉 [{a_user.chat_id}](tg://user?id={a_user.chat_id}) Reason None\n"
)
GBANNED_LIST += f"👉 [{a_user.chat_id}](tg://user?id={a_user.chat_id}) Reason None\n"
else:
GBANNED_LIST = "no Gbanned Users (yet)"
await edit_or_reply(event, GBANNED_LIST)
Expand Down
6 changes: 4 additions & 2 deletions userbot/plugins/greetings.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ async def cheer(event):
async def getwell(event):
"Get Well art."
await edit_or_reply(
event, "🌹🌹🌹🌹🌹🌹🌹🌹 \n🌹😷😢😓😷😢💨🌹\n🌹💝💉🍵💊💐💝🌹\n🌹 GetBetter Soon! 🌹\n🌹🌹🌹🌹🌹🌹🌹🌹"
event,
"🌹🌹🌹🌹🌹🌹🌹🌹 \n🌹😷😢😓😷😢💨🌹\n🌹💝💉🍵💊💐💝🌹\n🌹 GetBetter Soon! 🌹\n🌹🌹🌹🌹🌹🌹🌹🌹",
)


Expand All @@ -319,7 +320,8 @@ async def getwell(event):
async def luck(event):
"Luck art."
await edit_or_reply(
event, "💚~🍀🍀🍀🍀🍀\n🍀╔╗╔╗╔╗╦╗✨🍀\n🍀║╦║║║║║║👍🍀\n🍀╚╝╚╝╚╝╩╝。 🍀\n🍀・・ⓁⓊⒸⓀ🍀\n🍀🍀🍀 to you💚"
event,
"💚~🍀🍀🍀🍀🍀\n🍀╔╗╔╗╔╗╦╗✨🍀\n🍀║╦║║║║║║👍🍀\n🍀╚╝╚╝╚╝╩╝。 🍀\n🍀・・ⓁⓊⒸⓀ🍀\n🍀🍀🍀 to you💚",
)


Expand Down
6 changes: 4 additions & 2 deletions userbot/plugins/groupdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ async def fetch_info(chat, event): # sourcery skip: low-code-quality
caption += " <b>-</b> "
caption += "\n <b>-</b> ".join(reactionslist)
else:
caption += "🙂 <b>Enabled Reactions: </b><code>Reactions are not enabled.</code>"
caption += (
"🙂 <b>Enabled Reactions: </b><code>Reactions are not enabled.</code>"
)

if description:
caption += f"\n💬 <b>Description: </b>\n<code>{description}</code>\n"
Expand Down Expand Up @@ -484,7 +486,7 @@ async def info(event):
"-f": "To select only Documents(files)",
"-t": "To select only text messages",
"-m": "To select only media files(Photos+Videos)",
"-b": "To show bots also in the result."
"-b": "To show bots also in the result.",
# TODO: "-t": "To filter only messages which mentioned you",
},
"usage": [
Expand Down
4 changes: 3 additions & 1 deletion userbot/plugins/logo.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,9 @@ async def cat(event):
elif cmd == "d":
delgvar(var)
await edit_delete(
event, f"📑 Value of **{var}** is now deleted & set to default.", time=60
event,
f"📑 Value of **{var}** is now deleted & set to default.",
time=60,
)
elif not input_str and cmd == "r":
delgvar("LOGO_BACKGROUND")
Expand Down
4 changes: 3 additions & 1 deletion userbot/plugins/pastebin.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ async def rayso_by_pro_odi(event): # By @feelded
text_list = text_chunk_list(text, 28000)
user = (await catub.get_me()).first_name
for i, text in enumerate(text_list, start=1):
await edit_or_reply(catevent, f"**⏳ Pasting on image : {i}/{len(text_list)} **")
await edit_or_reply(
catevent, f"**⏳ Pasting on image : {i}/{len(text_list)} **"
)
outfile, error = chromeDriver.get_rayso(
text, file_name=f"rayso{i}.png", title=user, theme=theme, darkMode=darkMode
)
Expand Down
4 changes: 3 additions & 1 deletion userbot/plugins/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,9 @@ async def spotify_inline_article():
else:
media, tittle, dic, lyrics, symbol = await get_spotify(response)
thumb = "https://github.com/TgCatUB/CatUserbot-Resources/raw/master/Resources/Inline/spotify_on.png"
query = f'**🎶 Track :- ** `{tittle}`\n**🎤 Artist :- ** `{dic["interpret"]}`'
query = (
f'**🎶 Track :- ** `{tittle}`\n**🎤 Artist :- ** `{dic["interpret"]}`'
)
buttons = [
(
Button.url("🎧 Spotify", dic["link"]),
Expand Down

0 comments on commit b50b492

Please sign in to comment.