How Should I Keep My Bot Running If I Turn Off my PC?

deployments page, it redirects me to the main page and wants me to create a repl

Yes, you can. I currently use it. Replit just says that so you will pay them.

pay them? Like… in money?

crap, deployment require money… i can’t pay for

Yes, that is why I said use UpTimeRobot.

can you teach me how to use it in my repl? So i can keep my bot on?

What coding language are you using?

i’m using the python code language

from flask import Flask

app = Flask(__name__)


@app.route("/")
def hello_world():
    return "Hello, World!"


if __name__ == "__main__":
    app.run()

Then you should have a webserver. Put that into uptimerobot.


okay so, how do i run now?

Yes, click Save changes and your bot should be online 24/7. If my post worked, please mark it as a solution :smile:

a webview should’ve popped up in your repl when you ran the repl after editing in that code. Use the URL shown in that webview, not your repl link. Then, save changes and your bot should keep alive.

Thanks, I missed that.

webview? I confuse about that

It is the screen that shows your website.

i can’t find webview, it only displays tv mode

oh wait, a webview in your repl wouldn’t have popped up yet because you need to add this argument inside app.run()

host="0.0.0.0"

i already had that placed but it’s still not working:

from flask import Flask

app = Flask(__name__)


@app.route('/')
def home():
  return "Bot is running!"


def keep_alive():
  app.run(host='0.0.0.0', port=3000)


keep_alive()

my replit: https://replit.com/@HirukaRogue/RP-Utilities-Beta

i have no idea what i missed, it’s my server.py file

Is that code run? Or is it only your main file?

1 Like