About keeping a discord bot online 24/7
I have hosted my discord bots (in js and in py) and i have never ran in to a problem until now with my discord.py bot. I am using keep_alive and uptimerobot is pinging it everything runs fine but when i close my tab then the bot stops working, in uptimerobot there are no errors.
My keep_alive.py file:
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def main(): return "alive" def run(): app.run(host="0.0.0.0", port=8080) def keep_alive(): server = Thread(target=run) server.start()