Skip to content
← Back to Community
running forever
Profile icon
azadkumar

hello,
is there any way through which I can make my script run 24*7 without logging in to Replit.

Voters
Profile icon
theamazingrpm
Profile icon
qiyaoye2
Profile icon
Craftyboy
Profile icon
Tuner-discordDEV
Profile icon
azadkumar
Comments
hotnewtop
Profile icon
CosmicBear

use a pinger such as https://ping.matdoes.dev.
Edit: so that is only for websites. Instead, make another file and insert this code:

from flask import Flask from threading import Thread app = Flask(__name__) @app.route('/') def home(): return "hello world" def run(): app.run(host='0.0.0.0',port=8080) def keep_alive(): t = Thread(target=run) t.start()

Then import the keep_alive function and run it before the rest of your code. Then, add the url to the pinger thingy.
Edit 2: it seems that you already have this in your code.

Profile icon
azadkumar

@CosmicBear which url should i add to pinger

Profile icon
CosmicBear
Profile icon
azadkumar

@CosmicBear i am trying to run my code ,it does not even create any server it says repl is running at ip(localhost), please see if i have any changes to do with my code

Profile icon
FishballNooodle

Hi please check my pinned repl named forever
For full instructions
I also have a series of discord bot tutorials

Profile icon
InvisibleOne

There is a way to do it without Always on repls, take a look at this: https://stackoverflow.com/questions/54722596/keep-discord-bot-online-on-repl-it

Profile icon
FloCal35

Replit has something called Always on repls, but it's a hacker feature. If you want it, you need to upgrade