From c15feb1b883fd104f14aab3bc1d62b1ed470643e Mon Sep 17 00:00:00 2001 From: Ben Tettmar Date: Sat, 9 Nov 2024 00:21:41 +0000 Subject: [PATCH] Add integer check for message_settings.auto_delete_delay --- utils/config.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/config.py b/utils/config.py index 73c8aa3..b6b1714 100644 --- a/utils/config.py +++ b/utils/config.py @@ -190,6 +190,13 @@ def check(self): if key not in self.config: self.config[key] = DEFAULT_CONFIG[key] + for key in self.config: + if key == "message_settings": + auto_delete_delay = self.config[key]["auto_delete_delay"] + + if not isinstance(auto_delete_delay, int): + self.config[key]["auto_delete_delay"] = int(auto_delete_delay) if auto_delete_delay.isdigit() else DEFAULT_CONFIG[key]["auto_delete_delay"] + json.dump(self.config, open("config.json", "w"), indent=4) if self.get("token") == "":