Skip to content
← Back to Community
24/7
Profile icon
StrawBester

I need help to making it 24/7, i want a discord bot to be on 24/7.

Voters
Profile icon
AhmetCorbaciogl
Profile icon
TXDEMO
Profile icon
Desi081
Profile icon
ArifRifai2
Profile icon
scorpion-dev
Profile icon
trouble987
Profile icon
JOKERGAMING16
Profile icon
tonystark300306
Profile icon
MegaBlood
Profile icon
zeckbatata
Comments
hotnewtop
Profile icon
Nayoar

Python: use a Flask keepalive
JS: make an express server
For both of them, you also need to set up uptimerobot to ping the webpage that is created

Profile icon
VFDan

@minx28 How do you set up uptimerobot?

Profile icon
Nayoar

@VFDan @TheDrone7 has made a nice tutorial on it - on his profile page, select the posts tab and it's one of his most recent ones

Profile icon
Patu

@minx28 Sorry for being late, but how can I find the right flask keepalive script that I need to put on my code? I could only find in http

Profile icon
Nayoar

@Patu

from flask import Flask from threading import Thread app=Flask("") @app.route("/") def index(): return "<h1>Bot is running</h1>" Thread(target=app.run,args=("0.0.0.0",8080)).start()
Profile icon
Patu

@minx28 Sorry for this, but I had already solved this. Thanks anyway!

Profile icon
Nayoar
Profile icon
[deleted]

@minx28 What is an express server?

Profile icon
Nayoar

@Reckston86 no idea

Profile icon
ShefkiBerisha

its a server in js
like this but its in node.js

Profile icon
Dats360

Use the Packege DoteEnv And Page hhtps://uptimetobot.com ...

Profile icon
rexhall

same lol

Profile icon
AlohaMilona

I know how, but you must host it with a code runner 24 hours a day, seven days a week. 1v1 lol unblocked

Profile icon
Loxy2
Profile icon
RaymondEdward

I know how but you have to host it with a 24/7 code runner lul

Profile icon
AzureScripts

I recommend getting a VPS or anything that'll run the script for you.
Although it costs money

Can't you just run your Discord Bot's code on repl.it and not close the page?

Profile icon
Nayoar

@AzureScripts two problems with that. one, even if you don't close the page, it can still be unreliable. two, having tabs that need to keep running is very very annoying...

Profile icon
FluxedScript

@minx28 Just pin them or on windows edge hide them

Profile icon
Nayoar

@FluxedScript regardless, repl.it is still unreliable

Profile icon
FluxedScript

@minx28 I find more reliable than my own network

Profile icon
[deleted]

@minx28 just slap the discord.py's code inside an iframe! you only need one tab that way, but you have segmented code!