File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import sys
77from datetime import datetime
88
9- from uvloop import install
109from pathlib import Path
1110
12- install ()
11+ import uvloop
12+ uvloop .install ()
13+ asyncio .set_event_loop (asyncio .new_event_loop ())
14+
1315from aiohttp import web
1416from pyrogram import idle
1517
@@ -250,14 +252,11 @@ async def schedule_token_cleanup():
250252 logger .error (f"Token cleanup error: { e } " , exc_info = True )
251253
252254if __name__ == '__main__' :
253- loop = asyncio .get_event_loop ()
254255 try :
255- loop . run_until_complete (start_services ())
256+ asyncio . run (start_services ())
256257 except KeyboardInterrupt :
257258 print ("╔═══════════════════════════════════════════════════════════╗" )
258259 print ("║ Bot stopped by user (CTRL+C) ║" )
259260 print ("╚═══════════════════════════════════════════════════════════╝" )
260261 except Exception as e :
261262 logger .error (f"An unexpected error occurred: { e } " )
262- finally :
263- loop .close ()
You can’t perform that action at this time.
0 commit comments