Apparently Uptime Robot is sending invalid requests so my bot got temporarily banned from discord.com and I cannot run it anymore. Is there any alternative to Uptime Robot that will work with Discord?
Try using my modified version of keep_alive, it doesn't require an external pinger.
from flask import Flask from threading import Thread import random import time import requests import logging app = Flask('') @app.route('/') def home(): return "You have found the home of a Python program!" def run(): app.run(host='0.0.0.0',port=random.randint(2000,9000)) def ping(target, debug): while(True): r = requests.get(target) if(debug == True): print("Status Code: " + str(r.status_code)) time.sleep(random.randint(180,300)) #alternate ping time between 3 and 5 minutes def awake(target, debug=False): log = logging.getLogger('werkzeug') log.disabled = True app.logger.disabled = True t = Thread(target=run) r = Thread(target=ping, args=(target,debug,)) t.start() r.start()
Then usage would look like:
import neverSleep neverSleep.awake(yourReplURL, False) #All your code: \/