fix(userbot): add missing safone.py imports, apply ruff --unsafe-fixes
- Add missing aiohttp, PIL, BytesIO imports to safone.py (F821 runtime bugs) - Apply ruff --unsafe-fixes (27 fixes): ternary operators, .get() patterns, contextlib.suppress, enumerate(), collapsible if/else, remove .keys()
This commit is contained in:
+2
-8
@@ -108,10 +108,7 @@ async def imposter_cmd(client: Client, message: Message):
|
||||
text = f'{user.first_name} {choice(imps)}.'
|
||||
else:
|
||||
args = message.text.split()[1:]
|
||||
if args:
|
||||
text = ' '.join(args)
|
||||
else:
|
||||
text = f'{message.from_user.first_name} {choice(imps)}.'
|
||||
text = ' '.join(args) if args else f'{message.from_user.first_name} {choice(imps)}.'
|
||||
|
||||
text += f'\n{remain} impostor(s) remain.'
|
||||
imposter_file = await get_imposter_img(text)
|
||||
@@ -128,10 +125,7 @@ async def imp_animation(client: Client, message: Message):
|
||||
name = ' '.join(message.command[1:]) if len(message.command) > 1 else ''
|
||||
if not name:
|
||||
reply = message.reply_to_message
|
||||
if reply:
|
||||
name = reply.from_user.first_name
|
||||
else:
|
||||
name = message.from_user.first_name
|
||||
name = reply.from_user.first_name if reply else message.from_user.first_name
|
||||
cmd = message.command[0].lower()
|
||||
|
||||
text1 = await edit_or_reply(message, 'Uhmm... Something is wrong here!!')
|
||||
|
||||
Reference in New Issue
Block a user