diff options
author | 2023-07-13 20:00:12 +0100 | |
---|---|---|
committer | 2023-07-13 20:00:12 +0100 | |
commit | 157eaed213065ca28b0de6c9d061e0bb0a133562 (patch) | |
tree | b0521fac0c3c1dfbdb68551c013b2b7fb8a69819 /pydis_core/settings.py | |
parent | port reaction_check in a new `messages` util (diff) |
add a new settings module
This will hold all the "core" settings needed by all of our bots.
Diffstat (limited to 'pydis_core/settings.py')
-rw-r--r-- | pydis_core/settings.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pydis_core/settings.py b/pydis_core/settings.py new file mode 100644 index 00000000..0ee84138 --- /dev/null +++ b/pydis_core/settings.py @@ -0,0 +1,28 @@ +""" +Loads bot configuration from environment variables and `.env` files. + +By default, the values defined in the classes are used, these can be overridden by an env var with the same name. + +`.env` and `.env.server` files are used to populate env vars, if present. +""" +from pydantic import BaseSettings + + +class EnvConfig(BaseSettings): + """Our default configuration for models that should load from .env files.""" + + class Config: + """Specify what .env files to load, and how to load them.""" + + env_file = ".env.server", + env_file_encoding = "utf-8" + env_nested_delimiter = "__" + + +class _PaginationEmojis(EnvConfig): + + first: str = "\u23EE" + left: str = "\u2B05" + right: str = "\u27A1" + last: str = "\u23ED" + delete: str = "<:trashcan:637136429717389331>" |