How to keep your discord bot running 24/7 without the Hacker Plan
I personally don't make discord bots but I helped my friend make one run all the time and it can be done in two simple steps.
Once you finish your discord bot, attach a simple web server into it. If using discord.js, set up a simple "Hello World" web server and if using discord.py, simply make a flask server.
Add a simple express server at the end of the code.
Make sure you run
npm install express in the terminal!!
How to do it in python.
To set up a flask server, simply add this code to the end of your python file:
pip install flask in the terminal.
After that's done, your repl will still fall asleep. To fix that, make an account at uptimerobot and add your repl domain or link. It should look like
After that, make sure you RUN your repl
and everything should be up and running.
@WillingDude yes there is a way. You just need to import flask(python) or express(node.js) and set it to a port. Once you go to that port, set a ip/port monitor on uptimerobot.com and your done! Also copy the code above in the post. You might actually need to assign this to a domain if you want.