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:
20 files changed
+29
-57
No files matched your search
@@ -15,6 +15,7 @@
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import asyncio
|
||||
import contextlib
|
||||
import os
|
||||
|
||||
import requests
|
||||
@@ -101,10 +102,8 @@ async def delete_search_data(client, chat_id, message_id):
|
||||
search_key = f'{chat_id}_{key}'
|
||||
if search_key in search_results and search_results[search_key]['message_id'] == message_id:
|
||||
del search_results[search_key]
|
||||
try:
|
||||
with contextlib.suppress(BaseException):
|
||||
await client.delete_messages(chat_id, message_id)
|
||||
except:
|
||||
pass
|
||||
break
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user