Skip to content

Commit 0271f9a

Browse files
author
Sourcery AI
committed
'Refactored by Sourcery'
1 parent dc49d17 commit 0271f9a

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

userbot/modules/chat.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,10 @@ async def fetch_info(chat, event):
266266
msg_info = None
267267
print("Exception:", e)
268268
# No chance for IndexError as it checks for msg_info.messages first
269-
first_msg_valid = True if msg_info and msg_info.messages and msg_info.messages[
270-
0].id == 1 else False
269+
first_msg_valid = bool(msg_info and msg_info.messages and msg_info.messages[
270+
0].id == 1)
271271
# Same for msg_info.users
272-
creator_valid = True if first_msg_valid and msg_info.users else False
272+
creator_valid = bool(first_msg_valid and msg_info.users)
273273
creator_id = msg_info.users[0].id if creator_valid else None
274274
creator_firstname = msg_info.users[0].first_name if creator_valid and msg_info.users[
275275
0].first_name is not None else "Akun Terhapus"
@@ -334,7 +334,7 @@ async def fetch_info(chat, event):
334334
except Exception as e:
335335
print("Exception:", e)
336336
if bots_list:
337-
for bot in bots_list:
337+
for _ in bots_list:
338338
bots += 1
339339

340340
caption = "<b>🤖 INFORMASI OBROLAN:</b>\n"
@@ -389,7 +389,6 @@ async def fetch_info(chat, event):
389389
caption += f", <code>{slowmode_time}s</code>\n\n"
390390
else:
391391
caption += "\n\n"
392-
if not broadcast:
393392
caption += f"Supergrup: {supergroup}\n\n"
394393
if hasattr(chat_obj_info, "Terbatas"):
395394
caption += f"Terbatas: {restricted}\n"
@@ -427,7 +426,6 @@ async def _(event):
427426
))
428427
except Exception as e:
429428
await event.reply(str(e))
430-
await event.edit("`Sukses Menambahkan Pengguna Ke Obrolan`")
431429
else:
432430
# https://lonamiwebs.github.io/Telethon/methods/channels/invite_to_channel.html
433431
for user_id in to_add_users.split(" "):
@@ -438,7 +436,8 @@ async def _(event):
438436
))
439437
except Exception as e:
440438
await event.reply(str(e))
441-
await event.edit("`Sukses Menambahkan Pengguna Ke Obrolan`")
439+
440+
await event.edit("`Sukses Menambahkan Pengguna Ke Obrolan`")
442441

443442
CMD_HELP.update(
444443
{

userbot/modules/help.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ async def help(event):
3939
"**❒ Main Menu ↯**\n"
4040
f"╰►| {string} ◄─")
4141
await event.reply(
42-
f"**◑» Perintah Plugin** \n\n"
43-
f"**Contoh : Ketik** `.help afk` **Untuk Informasi Pengunaan Plugin Afk\nAtau Bisa Juga Ketik** `.helpme` **Untuk Help Button Lain-Nya** \n\n"
44-
f"**USERBOT TELEGRAM** ")
42+
'**◑» Perintah Plugin** \n\n**Contoh : Ketik** `.help afk` **Untuk Informasi Pengunaan Plugin Afk\nAtau Bisa Juga Ketik** `.helpme` **Untuk Help Button Lain-Nya** \n\n**USERBOT TELEGRAM** '
43+
)
44+
4545
await asyncio.sleep(1000)
4646
await event.delete()
4747
# fixes by apis

0 commit comments

Comments
 (0)