Answer the question
In order to leave comments, you need to log in
Bat file works every other time how to fix it?
I am creating a telegram bot on aiogram, it executes simple commands, I launch it through a batch file. What is the problem. When I run this bat file, it can start immediately and the bot will respond instantly to one or two commands, and on the third it will already respond with a delay of about 30 seconds (sometimes more), and sometimes the batch file itself can run for 30 seconds. I don’t understand What's the problem, everything worked fine before.
Here is what is written in the batch file itself
@echo off
call %~dp0gg\venv\Scripts\activate
cd %~dp0gg
set TOKEN=my token
python tg_bot.py
pause
Answer the question
In order to leave comments, you need to log in
In the call command, as far as I remember, you need to specify the file name with the extension. It calls another external batch file. I can't check the behavior of the command now without specifying the extension.
In any case, if activate.bat should be called here, then you need to watch it the same.
For the rest of the commands, there is nothing to slow down at all, except, of course, the Python script.
Well, do not forget that at the end there is a pause command - it waits for the user to press any key. Can wait until blue in the face.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question