From cb9d798f6e408a12a6b78558bb7f363e52c12c0a Mon Sep 17 00:00:00 2001 From: Yiays Date: Sat, 7 Dec 2024 15:22:48 +1300 Subject: [PATCH] Retroactively add a migration for botmod removal --- migrations/v2_5_0_promoted.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 migrations/v2_5_0_promoted.py diff --git a/migrations/v2_5_0_promoted.py b/migrations/v2_5_0_promoted.py new file mode 100644 index 0000000..f9c25e0 --- /dev/null +++ b/migrations/v2_5_0_promoted.py @@ -0,0 +1,20 @@ +""" + This script deletes botmods (promoted) from config as this is no longer supported +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from config import Config + + +def migrate(config:Config): + print(" - Deleting all botmod data...") + + for key in config['confessions']: + if key.endswith('_promoted'): + config.remove_option('confessions', key) + + print(" - Shuffle deletion complete!")