Telegram bot does not work¶
Bot is used on 2 devices¶
During startup/restart, the instance can run in two copies for about a second, which can cause such an error. The error looks like this:
aiogram.utils.exceptions.TerminatedByOtherGetUpdates: Terminated by other getupdates request; make sure that only one bot instance is running
Try setting a delay of 2-5 seconds on object creation, this should help.
Example for a bot in Python using telebot¶
Before
bot = telebot.TeleBot(token) # or similar line
Register
import time
time.sleep(5)
Incorrect name of «telebot» in requirements.txt¶
The telebot in requirements.txt
should be called pyTelegramBotAPI
, not telebot
.
After replacing telebot with pyTelegramBotAPI, you need to freeze the project using the corresponding button on the tab «Settings». And only after that rebuild the application.
Freezing is necessary to ensure that the cache is cleared, in which the old dependency may remain!
No logs¶
If the application status is «Successfully launched» and the project uses the Python language, then to display the output of the print
command
You need to set the environment variable PYTHONUNBUFFERED
to 1.
Clue
If you can’t figure it out, write to support support@amverum.com. Please immediately indicate your user and project name. We will try to help.