diff options
-rw-r--r-- | bot/constants.py | 5 | ||||
-rw-r--r-- | botstrap.py | 3 |
2 files changed, 4 insertions, 4 deletions
diff --git a/bot/constants.py b/bot/constants.py index 6a08e02ff..a4d5761be 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -20,6 +20,7 @@ class EnvConfig(BaseSettings): class Config: env_file = ".env", ".env.server", env_file_encoding = 'utf-8' + env_nested_delimiter = '__' class _Miscellaneous(EnvConfig): @@ -257,12 +258,11 @@ class ThreadArchiveTimes(Enum): class Webhook(BaseModel): id: int - channel: Optional[int] + channel: int class _Webhooks(EnvConfig): EnvConfig.Config.env_prefix = "webhooks_" - EnvConfig.Config.env_nested_delimiter = '_' big_brother: Webhook = Webhook(id=569133704568373283, channel=Channels.big_brother) dev_log: Webhook = Webhook(id=680501655111729222, channel=Channels.dev_log) @@ -364,7 +364,6 @@ class Rules(BaseModel): class _AntiSpam(EnvConfig): EnvConfig.Config.env_prefix = 'anti_spam_' - EnvConfig.Config.env_nested_delimiter = '_' cache_size = 100 diff --git a/botstrap.py b/botstrap.py index 2b34dad81..28486bd36 100644 --- a/botstrap.py +++ b/botstrap.py @@ -159,6 +159,7 @@ with DiscordClient() as discord_client: webhook_id = create_webhook(webhook_name, webhook_channel_id, client=discord_client) else: webhook_id = webhook_model.id - config_str += f"webhooks_{webhook_name}_id={webhook_id}\n" + config_str += f"webhooks_{webhook_name}__id={webhook_id}\n" + config_str += f"webhooks_{webhook_name}__channel={all_channels[webhook_name]}\n" env_file_path.write_text(config_str) |