From e9d3d1fab043e162c5ce5d4a5588fcd232bd8891 Mon Sep 17 00:00:00 2001 From: Ricky8955555 Date: Mon, 12 Jun 2023 23:49:40 +0800 Subject: [PATCH] fix: create event loop for pyrogram --- pagermaid/__main__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pagermaid/__main__.py b/pagermaid/__main__.py index a8ea56b..f560086 100644 --- a/pagermaid/__main__.py +++ b/pagermaid/__main__.py @@ -1,3 +1,5 @@ +import asyncio +import contextlib from sys import path, platform from os import sep from importlib import import_module @@ -55,4 +57,5 @@ async def main(): await bot.stop() -bot.run(main()) +with contextlib.closing(asyncio.new_event_loop()): + bot.run(main())