Skip to content

Commit 9ed9f66

Browse files
committed
pylint: auto fixes
1 parent 2e521b3 commit 9ed9f66

31 files changed

Lines changed: 107 additions & 105 deletions

bin/cmrudl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def result(self):
238238

239239
def fetch_storage(self, url):
240240
self.log(f"Fetching storage: {url}", True)
241-
(code, headers, body) = self.request_data(self.options.url[0])
241+
code, headers, body = self.request_data(self.options.url[0])
242242
self.assert_status_code(code, 200)
243243

244244
html = self.request_data_decode(body, headers)
@@ -291,7 +291,7 @@ def fetch_storage(self, url):
291291
def fetch_token(self):
292292
url = "https://cloud.mail.ru/api/v2/tokens/download"
293293
self.log(f"Fetching token: {url}", True)
294-
(code, headers, body) = self.request_data(url)
294+
code, headers, body = self.request_data(url)
295295
self.assert_status_code(code, 200)
296296

297297
json_str = self.request_data_decode(body, headers)

stringsetup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
from telethon.sessions import StringSession
88
from telethon.sync import TelegramClient
99

10-
print(
11-
"""Please go-to my.telegram.org
10+
print("""Please go-to my.telegram.org
1211
Login using your Telegram account
1312
Click on API Development Tools
14-
Create a new application, by entering the required details"""
15-
)
13+
Create a new application, by entering the required details""")
1614
APP_ID = int(input("Enter APP ID here: "))
1715
API_HASH = input("Enter API HASH here: ")
1816

userbot/Config/catub_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Config values will be loaded from here"""
1+
"""Config values will be loaded from here"""
22

33
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# CatUserBot #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
44
# Copyright (C) 2020-2023 by TgCatUB@Github.

userbot/assistant/bot_pms.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,18 @@ async def check_bot_started_users(user, event):
5757
check = get_starter_details(user.id)
5858
if check is None:
5959
start_date = str(datetime.now().strftime("%B %d, %Y"))
60-
notification = f"👤 {_format.mentionuser(user.first_name , user.id)} has started me.\
60+
notification = (
61+
f"👤 {_format.mentionuser(user.first_name , user.id)} has started me.\
6162
\n**ID: **`{user.id}`\
6263
\n**Name: **{get_display_name(user)}"
64+
)
6365
else:
6466
start_date = check.date
65-
notification = f"👤 {_format.mentionuser(user.first_name , user.id)} has restarted me.\
67+
notification = (
68+
f"👤 {_format.mentionuser(user.first_name , user.id)} has restarted me.\
6669
\n**ID: **`{user.id}`\
6770
\n**Name: **{get_display_name(user)}"
71+
)
6872
try:
6973
add_starter_to_db(user.id, get_display_name(user), start_date, user.username)
7074
except Exception as e:

userbot/assistant/botcontrols.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939

4040
@catub.bot_cmd(pattern="^/help$", from_users=Config.OWNER_ID)
4141
async def bot_help(event):
42-
await event.reply(
43-
f"""The commands in the bot are:
42+
await event.reply(f"""The commands in the bot are:
4443
**Note : **__This commands work only in this bot__ {botusername}
4544
4645
• **Cmd : **/uinfo <reply to user message>
@@ -58,8 +57,7 @@ async def bot_help(event):
5857
• **Cmd : **/broadcast
5958
• **Info : **__Reply to a message to get broadcasted to every user who started your bot. To get list of users use__ `{cmhd}bot_users`.
6059
• **Note : **__if user stoped/blocked the bot then he will be removed from your database that is he will erased from the bot_starters list.__
61-
"""
62-
)
60+
""")
6361

6462

6563
@catub.bot_cmd(pattern="^/broadcast$", from_users=Config.OWNER_ID)

userbot/assistant/inlinefm.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,11 @@ async def send(event):
253253
mime_type=mime_type,
254254
attributes=attributes,
255255
force_file=False,
256-
thumb=await event.client.upload_file(thumb_image_path)
257-
if thumb_image_path
258-
else None,
256+
thumb=(
257+
await event.client.upload_file(thumb_image_path)
258+
if thumb_image_path
259+
else None
260+
),
259261
)
260262
await event.edit("hi", file=media)
261263

userbot/assistant/iytdl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Download Youtube Video / Audio in a User friendly interface """
1+
"""Download Youtube Video / Audio in a User friendly interface"""
22

33
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# CatUserBot #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
44
# Copyright (C) 2020-2023 by TgCatUB@Github.

userbot/core/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ async def wrapper(check): # sourcery no-metrics
169169
if Config.PRIVATE_GROUP_BOT_API_ID == 0:
170170
return
171171
date = (datetime.datetime.now()).strftime("%m/%d/%Y, %H:%M:%S")
172-
ftext = f"\nDisclaimer:\nThis file is pasted only here ONLY here,\
172+
ftext = (
173+
f"\nDisclaimer:\nThis file is pasted only here ONLY here,\
173174
\nwe logged only fact of error and date,\nwe respect your privacy,\
174175
\nyou may not report this error if you've\
175176
\nany confidential data here, no one will see your data\
@@ -180,6 +181,7 @@ async def wrapper(check): # sourcery no-metrics
180181
\n\nEvent Trigger:\n{str(check.text)}\
181182
\n\nTraceback info:\n{str(traceback.format_exc())}\
182183
\n\nError text:\n{str(sys.exc_info()[1])}"
184+
)
183185
new = {
184186
"error": str(sys.exc_info()[1]),
185187
"date": datetime.datetime.now(),
@@ -309,7 +311,8 @@ async def wrapper(check):
309311
if Config.PRIVATE_GROUP_BOT_API_ID == 0:
310312
return
311313
date = (datetime.datetime.now()).strftime("%m/%d/%Y, %H:%M:%S")
312-
ftext = f"\nDisclaimer:\nThis file is pasted only here ONLY here,\
314+
ftext = (
315+
f"\nDisclaimer:\nThis file is pasted only here ONLY here,\
313316
\nwe logged only fact of error and date,\nwe respect your privacy,\
314317
\nyou may not report this error if you've\
315318
\nany confidential data here, no one will see your data\
@@ -320,6 +323,7 @@ async def wrapper(check):
320323
\n\nEvent Trigger:\n{str(check.text)}\
321324
\n\nTraceback info:\n{str(traceback.format_exc())}\
322325
\n\nError text:\n{str(sys.exc_info()[1])}"
326+
)
323327
new = {
324328
"error": str(sys.exc_info()[1]),
325329
"date": datetime.datetime.now(),

userbot/core/cmdinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def get_data(about, ktype):
4444

4545

4646
def _format_about(
47-
about: Union[str, Dict[str, Union[str, List[str], Dict[str, str]]]]
47+
about: Union[str, Dict[str, Union[str, List[str], Dict[str, str]]]],
4848
) -> str: # sourcery no-metrics # sourcery skip: low-code-quality
4949
if not isinstance(about, dict):
5050
return about

userbot/core/inlinebot.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ def main_menu():
7474
if Config.BADCAT:
7575
switch_button = [
7676
(
77-
Button.inline(f"➕ Extra ({len(GRP_INFO['extra'])})", data="extra_menu"),
77+
Button.inline(
78+
f"➕ Extra ({len(GRP_INFO['extra'])})", data="extra_menu"
79+
),
7880
Button.inline(
7981
f"⚰️ Useless ({len(GRP_INFO['useless'])})", data="useless_menu"
8082
),
@@ -579,22 +581,26 @@ async def hide_toll_secret(event, query, match, match3):
579581
jsondata = False
580582
timestamp = int(time.time() * 2)
581583
new_msg = {
582-
str(timestamp): {"text": query}
583-
if match3
584-
else {"userid": user_list, "text": query}
584+
str(timestamp): (
585+
{"text": query} if match3 else {"userid": user_list, "text": query}
586+
)
585587
}
586588
buttons = [Button.inline(info_type[2], data=f"{info_type[0]}_{timestamp}")]
587589

588590
result = await build_article(
589591
event,
590592
title=f"{info_type[0].title()} message to {sandy}.",
591-
description="Send hidden text in chat."
592-
if match3
593-
else f"Only he/she/they {info_type[1]} open it.",
593+
description=(
594+
"Send hidden text in chat."
595+
if match3
596+
else f"Only he/she/they {info_type[1]} open it."
597+
),
594598
thumbnail=get_thumb(f"{info_type[0]}.png"),
595-
text="✖✖✖"
596-
if match3
597-
else f"🔒 A whisper message to {sandy}, Only he/she can open it.",
599+
text=(
600+
"✖✖✖"
601+
if match3
602+
else f"🔒 A whisper message to {sandy}, Only he/she can open it."
603+
),
598604
buttons=buttons,
599605
)
600606
return result, old_msg, jsondata, new_msg

0 commit comments

Comments
 (0)