W
W
Windyay2022-04-20 15:26:04
Bots
Windyay, 2022-04-20 15:26:04

How to correctly deploy a bot to Heroku?

I wrote a bot - it parses information about tracks . For the
first time in my life, I upload a project to Heroku, several questions arose
1. If I have a package.json, do I not need requirements.txt? development time)
2. How can I restart the bot (parse data again and again) to do this using the task scheduler in the bot itself or using the task scheduler on heroku or through a set interval
3. I read that the bot falls asleep every 30 minutes if there is no activity , if I restart it (by interval, scheduler), then it will not fall asleep?
4.From personal experience, does Heroku often have some kind of problem, due to which the application may not be available? (it is critical that the application does not stand idle for more than 30 minutes)
Thanks in advance for the answers

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
krax1337, 2022-04-25
@krax1337

1) package.jsonis for JS and npm. requirements.txt- for python.
2) I didn’t quite understand the question, if it’s about a bot. Then there are two options for obtaining data, these are webhook and polling. polling is when your program asks if there are new messages. webhook is when the telegram service itself sends you a notification about a new message. The difference is described here - https://grammy.dev/guide/deployment-types.html#how... .
3-4) About 30 minutes, the bot just falls asleep. That is, after 30 minutes of sleep, it will simply respond longer. More details can be found on the Heroku website. https://towardsdatascience.com/how-to-deploy-a-tel... - at the end of this article there is information on Heroku.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question