We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc62b3f commit d7be2c9Copy full SHA for d7be2c9
1 file changed
pyrogram/methods/utilities/run.py
@@ -17,6 +17,7 @@
17
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
18
19
import asyncio
20
+import inspect
21
22
from pyrogram.methods.utilities.idle import idle
23
from pyrogram.scaffold import Scaffold
@@ -52,6 +53,11 @@ def run(self, coroutine=None):
52
53
if coroutine is not None:
54
run(coroutine)
55
else:
- self.start()
56
- run(idle())
57
- self.stop()
+ if inspect.iscoroutinefunction(self.start):
+ run(self.start())
58
+ run(idle())
59
+ run(self.stop())
60
+ else:
61
+ self.start()
62
63
+ self.stop()
0 commit comments