аватар question@mail.ru · 01.01.1970 03:00

Deet bot on the Heroku server

Can someone give instructions on how to expand the bot on the Heroku server (written on python )? Thanks in advance.

аватар answer@mail.ru · 01.01.1970 03:00
  • First of all, create a git repository in a folder with a bot: git init
  • Enter Heroku Heroku Login
  • Create the application: Heroku Create AppName --region EU
  • Create a file procfile with the contents: Bot: Bot: Bot: Bot: Bot: Bot: Bot: Bot: Bot: Bot: Bot: Bot: Python Main.py

    • If the bot on web-huki, replace Bot with Web . But at a free tariff, the bot will fall asleep every 30 minutes if there are no connections, which is why it is better to keep bots on Long-filling on heroku free. But the problem with falling asleep of the web application is solved with the help of.
  • now you need to pack all the dependencies of the project: pip freeze & gt; Requirements.txt

    • Now our folder looks approximately like this: procfile main.py recept
    • commimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimimmitics comimimi Changes: git add. then git comit -m 'comit'

    • heroku : git push heroku Master

    • Launch the bot: heroku ps: Scale Bot = 1

    • Watch logs: Heroku Logs -t

    that’s all.

Latest

Similar