From 736480c156d14178bb0fc88d2edab34cbc825264 Mon Sep 17 00:00:00 2001 From: Thor Harald Johansen Date: Sun, 18 Jul 2021 17:15:59 +0200 Subject: [PATCH] Remove redundant state variables --- cringebot.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cringebot.py b/cringebot.py index 4c1f284..6185344 100644 --- a/cringebot.py +++ b/cringebot.py @@ -249,16 +249,9 @@ class CringeBotClient(BotClient): def on_load_state(self): state = { "deletion_queue": {}, - "cringe": [], - "based": [], - "unsure": [], "own": {}, **super().on_load_state()} - state["cringe"] = set(state["cringe"]) - state["based"] = set(state["based"]) - state["unsure"] = set(state["unsure"]) - for status_id, params in state["deletion_queue"].items(): # Load deletion queue into scheduler params["scheduler_event"] = self.deletion_scheduler.enterabs(datetime.fromisoformat(params["time"]).timestamp(), 1, self.queued_delete, argument=(status_id,)) @@ -266,10 +259,6 @@ class CringeBotClient(BotClient): return state def on_save_state(self, state): - state["cringe"] = list(state["cringe"]) - state["based"] = list(state["based"]) - state["unsure"] = list(state["unsure"]) - # Transform deletion scheduler queue to a JSON friendly format state["deletion_queue"] = {event.argument[0]: {"time": datetime.fromtimestamp(event.time, timezone.utc).isoformat()} for event in self.deletion_scheduler.queue}