Rename module and add init file to conform to ruff.
build_develop / build (push) Successful in 21s

This commit is contained in:
2025-03-18 10:03:51 -04:00
parent 6af2476339
commit 34cd2f9975
14 changed files with 2 additions and 1 deletions
+41
View File
@@ -0,0 +1,41 @@
"""File contains classes defining off-cooldown-bot settings structure."""
from dataclasses import dataclass
from dataclass_wizard import YAMLWizard
CONFIG_LOCATION = "conf/config.yaml"
@dataclass
class ChannelIds:
"""Class holds all channel ids needed by bot."""
general: int
@dataclass
class Params:
"""Class defines start parameters that shouldn't be changed."""
discord_token: str
guild_id: int
@dataclass
class Settings(YAMLWizard):
"""Class defines all configs required for off-cooldown-bot."""
channel_ids: ChannelIds
params: Params
def save(self) -> None:
"""Save settings to the yaml file."""
self.to_yaml_file(CONFIG_LOCATION)
settings = Settings.from_yaml_file(CONFIG_LOCATION)
# I'm not expecting a list to be returned.
if isinstance(settings, list):
settings = settings[0]