22 lines
546 B
Python
22 lines
546 B
Python
"""
|
|
Converter for converting ChannelsConfigFile from version 1.0 to version 1.1
|
|
"""
|
|
|
|
from typing import Dict, Tuple
|
|
|
|
|
|
def convert(config: Dict) -> Tuple[Dict, str]:
|
|
assert config["__version__"] == "1.0"
|
|
|
|
for config_key, config_value in config.items():
|
|
# We skip the version information
|
|
if config_key == "__version__":
|
|
continue
|
|
# All the other entries are guild configuration
|
|
guild_config = config_value
|
|
if "user_config" not in guild_config:
|
|
guild_config["user_config"] = {}
|
|
|
|
config["__version__"] = "1.1"
|
|
return config, "1.1"
|