diff options
author | 2023-03-12 18:35:11 +0100 | |
---|---|---|
committer | 2023-03-12 18:35:11 +0100 | |
commit | 912bcffab2a594fe014ced96c45b27ed97e8a0cb (patch) | |
tree | 48bd9f7fd9111ebbc95f37f6c36e28111cf34140 | |
parent | Merge pull request #2465 from shtlrs/fix-persistent-roles-view-bug (diff) | |
parent | Merge branch 'main' into preserve-personal-config (diff) |
Merge pull request #2463 from shtlrs/preserve-personal-config
Preserve personal config
-rw-r--r-- | bot/constants.py | 3 | ||||
-rw-r--r-- | botstrap.py | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/bot/constants.py b/bot/constants.py index 3aacd0a16..006d0e4ce 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -11,14 +11,13 @@ will default to the values passed to the `default` kwarg. """ import os from enum import Enum -from typing import Optional from pydantic import BaseModel, BaseSettings, root_validator class EnvConfig(BaseSettings): class Config: - env_file = ".env", ".env.server", + env_file = ".env.server", ".env", env_file_encoding = 'utf-8' env_nested_delimiter = '__' diff --git a/botstrap.py b/botstrap.py index 28486bd36..90a954d9b 100644 --- a/botstrap.py +++ b/botstrap.py @@ -162,4 +162,8 @@ with DiscordClient() as discord_client: 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) + config_str += "\n#Emojis\n" + config_str += "emojis_trashcan=🗑️" + + with env_file_path.open("wb") as file: + file.write(config_str.encode("utf-8")) |