Answer the question
In order to leave comments, you need to log in
Where to run the code?
Good afternoon! I am new to programming and the question arose, where to run the codes? Let's say there is a discord bot code. When I run it through the command line, does it not eat up the resources of my device? And if I need to make the bot active 24/7, but when the device is turned off, the code stops. Through what then it is necessary to start the codes? Hosting or something else? Can you recommend :0
Answer the question
In order to leave comments, you need to log in
First of all, register an account on Heroku
Then you should install Heroku CLI and Git
After that, follow the instructions:
Create a runtime.txt file in the root directory of your bot, where you specify the version of python
Example:
python-3.9.0
Create a requirements.txt file, and through Enter you specify all the modules that needed for the bot to work
Example:
discord
config
requests
youtube_dl
asyncio
PyNaCl
ffmpeg
colorama
worker: python main.py
\ heroku login (откроется страничка для авторизации)
cd path/to/your/directory/with/your/bot
git init
git add .
git commit -m "First release"
heroku create <любое слово, в будующем это будет название бота>
git remote -v
git push heroku master
heroku ps:scale worker=1
cd your/bot/folder
git add .
git commit -am "your comment"
git push heroku master
Raspberry Pi
I am new to programming and the question arose, where to run the codes? Let's say there is a discord bot code.You will go far!
Heroku .
There is a free shooting range for which x hours per month are available (560, like, 23 days in total), but if you add card data (I entered data from kiwi virualka), the number will increase to 1000.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question