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:
+1
-4
@@ -47,10 +47,7 @@ async def afk_handler(_, message: types.Message):
|
||||
|
||||
@Client.on_message(filters.command('afk', prefix) & filters.me)
|
||||
async def afk(_, message):
|
||||
if len(message.text.split()) >= 2:
|
||||
reason = message.text.split(' ', maxsplit=1)[1]
|
||||
else:
|
||||
reason = 'None'
|
||||
reason = message.text.split(' ', maxsplit=1)[1] if len(message.text.split()) >= 2 else 'None'
|
||||
|
||||
afk_info['start'] = int(datetime.datetime.now().timestamp())
|
||||
afk_info['is_afk'] = True
|
||||
|
||||
Reference in New Issue
Block a user