Answer the question
In order to leave comments, you need to log in
How to run multiple copies of telegram bot on Aiogram?
The question is the following, I have a Telegram bot script written in Python using the Aiogram library. As soon as I start the second copy of the bot, the following error appears in the console:
aiogram.utils.exceptions.TerminatedByOtherGetUpdates: Terminated by other getupdates request; make sure that only one bot instance is running
import aiogram
__connect_key__ = 'token'
__admin_id__ = 'id'
TelegramSession = aiogram.Dispatcher(aiogram.Bot(token=__connect_key__))
@TelegramSession.message_handler()
async def Messages(message: aiogram.types.Message):
if message['from']['id'] == __admin_id__:
Hendler(message.text)
def Hendler(Data):
print(Data)
if __name__ == '__main__':
aiogram.executor.start_polling(TelegramSession, skip_updates=False)
Answer the question
In order to leave comments, you need to log in
Or it would be more convenient to write your own library for interacting with the bot via the API, because in this way you don’t have to face this error, but it’s wildly inconvenient
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question