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:
@@ -39,6 +39,7 @@
|
||||
# "pySmartDL",
|
||||
# ]
|
||||
# ///
|
||||
import contextlib
|
||||
import logging
|
||||
import os
|
||||
import platform
|
||||
@@ -151,10 +152,8 @@ async def main():
|
||||
'restart': '<b>Restart completed!</b>',
|
||||
'update': '<b>Update process completed!</b>',
|
||||
}[info['type']]
|
||||
try:
|
||||
with contextlib.suppress(errors.RPCError):
|
||||
await app.edit_message_text(info['chat_id'], info['message_id'], text)
|
||||
except errors.RPCError:
|
||||
pass
|
||||
db.remove('core.updater', 'restart_info')
|
||||
|
||||
# required for sessionkiller module
|
||||
|
||||
Reference in New Issue
Block a user