Answer the question
In order to leave comments, you need to log in
How to run 2 or more bots at the same time?
I decided to write Telegram bots interacting with each other in python.
I decided to use pyrogram for this, since one of the bots is a user account!
How to simultaneously run 2 or more bots in one program?
banal:
first_client.run()
second_client.run()
does not work
Tell me what to do
Answer the question
In order to leave comments, you need to log in
This is an asynchronous framework, you need to run separate tasks for clients. And run starts a task with this client and waits for it to complete, so the first client is launched, and the second one is not.
Accordingly, you need to do this:
first_client.start()
second_client.run()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question