diff --git a/discordbot.py b/discordbot.py index 30157a19..a2dc0331 100644 --- a/discordbot.py +++ b/discordbot.py @@ -614,7 +614,8 @@ song_special_messages = { "linkin park": ":arrow_forward: Crawling in my {song}!", "magicite": "⚠️ Warning: {song} contiene numerosi bug.", "papers please": ":arrow_forward: Glory to Arstotzka! {song}!", - "we are number one": ":arrow_forward: Now paying respect to Robbie Rotten: {song}" + "we are number one": ":arrow_forward: Now paying respect to Robbie Rotten: {song}", + "jump up superstar": ":arrow_forward: Is {song} the Tengen Toppa Guren Lagann opening?" } diff --git a/update.py b/update.py index 20588c84..232e37a8 100644 --- a/update.py +++ b/update.py @@ -88,21 +88,21 @@ try: sleep_time = 1 - time.clock() + t time.sleep(sleep_time if sleep_time > 0 else 0) # Update Overwatch - # print("OVERWATCH") - # for user in session.query(db.Overwatch).all(): - # t = time.clock() - # print(f"Updating {user.royal.username}", end="\t\t", flush=True) - # try: - # user.update() - # except errors.RequestError: - # print("Request Error") - # except errors.NotFoundError: - # print("Not Found Error (?)") - # else: - # print("OK") - # finally: - # sleep_time = 1 - time.clock() + t - # time.sleep(sleep_time if sleep_time > 0 else 0) + print("OVERWATCH") + for user in session.query(db.Overwatch).all(): + t = time.clock() + print(f"Updating {user.royal.username}", end="\t\t", flush=True) + try: + user.update() + except errors.RequestError: + print("Request Error") + except errors.NotFoundError: + print("Not Found Error (?)") + else: + print("OK") + finally: + sleep_time = 1 - time.clock() + t + time.sleep(sleep_time if sleep_time > 0 else 0) print("Committing...\t\t") session.commit() print("OK")