Ask coding questions

← Back to all posts
need to make my discord bot stay up
TDR9000 (0)

In short, i need my discord bot to stay up and running, even if the tab has closed, or my computer is off. Its a simple information bot that doesnt do much at the moment. The repl uses Python.
Thankyou.

(Im really new to repl.it, so please dont comment on my simple coding)

Comments
hotnewtop
RYANTADIPARTHI (6010)

you could try using the uptimers.

AloegelhiPlaysR (109)

I would make a http server (request) and use uptimerobot to ping the .co link

def run(server_class=HTTPServer, handler_class=BaseHTTPRequestHandler):
    server_address = ('', 8000)
    httpd = server_class(server_address, handler_class)
    httpd.serve_forever()
TDR9000 (0)

@AloegelhiPlaysR Would you mind explaining that? Im really new to this kind of coding. If you could possibly give me some instructions as to how to set it up, the HTTPS server request thing i mean. Many thanks.

AloegelhiPlaysR (109)

Place at the bottom of your code, the code I gave above. Replace the empty ' ' with `'0.0.0.0' and then go to uptime robot => Create Monitor => HTTPS => Friendly Name = Anything => URL = https://YOUR_REPL_NAME.YOUR_NAME.repl.co
@TDR9000

TDR9000 (0)

@AloegelhiPlaysR Ok, done all that. Thankyou so much! Really hope it works.

AloegelhiPlaysR (109)

Thats how I always did it, Hopefully it works for you :) @TDR9000