How to keep Repl always running?

Hello, I have a Discord bot using PyCord on Replit, I need it alwais running and I’ve seen a way using Uptime Robot and this code:

# keep_alive.py
from flask import Flask
from threading import Thread

app = Flask('')

@app.route('/')
def home():
    return "Hello. I am alive!"

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

def keep_alive():
    t = Thread(target=run)
    t.start()
# bot.py
from keep_alive import keep_alive
# [...] Bot code

keep_alive()

But this don’t work, it’s right on Uptime Robot but the Repl don’t always running.

Can you help me please?

Thank you very munch!

Ping services are no longer working to keep your replay running. You should use a Reserved VM deployment for your bot.

2 Likes

Pretty sure they don’t accept requests from UptimeRobot anymore. You’ll have to use a Reserved VM Deployment.

1 Like

Oh. Thank you very munch but I can’t use a Reserved VM Deployment.

1 Like

In this case, you could try to deploy the repl on an automatic scale. I can’t guarantee that it will work, but there is a chance.

They’re new changes and you’ll have to pay for it or look into other hosting options. You can also just keep the code running on a spare computer if you have one, and it’ll act as your own server.

1 Like

I can’t pay and I havn’t other coputer. Thank you very munch. I will look into other hosting options.

1 Like

Mark the reply that helped you most as Solution, or you can wait if you’re going to come back to this topic and ask about more.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.