Skip to content

Commit

Permalink
Add integer check for message_settings.auto_delete_delay
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyscripts committed Nov 9, 2024
1 parent 418af2a commit c15feb1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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") == "":
Expand Down

0 comments on commit c15feb1

Please # to comment.