Answer the question
In order to leave comments, you need to log in
Python two bots in one script?
bot1 = telebot.TeleBot("token of the first one)
bot2
= telebot.TeleBot("Token of the second one")
How
to run two bots at once in one script? swap, the first one will work, but the second one will not. I would like to run both at once
Answer the question
In order to leave comments, you need to log in
Polling is essentially an endless process, so the script may not reach the second line. Try to kick one bot from the main thread:
import threading
"""
code
"""
threading.Thread(bot2.polling).start()
bot1.polling()
If only to apply command line arguments and separately run bot.py 1& and bot.py 2&
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question