Ask coding questions

← Back to all posts
StrawBester (13)

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

Dats360 (1)

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

Nayoar (574)

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

VFDan (3)

@minx28 How do you set up uptimerobot?

Nayoar (574)

@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

Patu (2)

@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

Nayoar (574)


from flask import Flask
from threading import Thread


def index():
    return "<h1>Bot is running</h1>"

Patu (2)

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


@minx28 What is an express server?

RaymondEdward (0)

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

AzureScripts (184)

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 and not close the page?

Nayoar (574)

@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...

FluxedScript (1)

@minx28 Just pin them or on windows edge hide them

Nayoar (574)

@FluxedScript regardless, is still unreliable

FluxedScript (1)

@minx28 I find more reliable than my own network


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