2022-06-19 00:23:25 +02:00
|
|
|
from typing import Optional
|
|
|
|
|
2022-06-10 01:48:02 +02:00
|
|
|
from environs import Env
|
|
|
|
|
|
|
|
# Read the .env file (if present)
|
|
|
|
env = Env()
|
|
|
|
env.read_env()
|
|
|
|
|
2022-07-13 22:54:16 +02:00
|
|
|
__all__ = [
|
|
|
|
"SANDBOX",
|
|
|
|
"LOGFILE",
|
|
|
|
"DB_NAME",
|
|
|
|
"DB_USERNAME",
|
|
|
|
"DB_PASSWORD",
|
|
|
|
"DB_HOST",
|
|
|
|
"DB_PORT",
|
|
|
|
"DISCORD_TOKEN",
|
|
|
|
"DISCORD_READY_MESSAGE",
|
|
|
|
"DISCORD_STATUS_MESSAGE",
|
|
|
|
"DISCORD_TEST_GUILDS",
|
|
|
|
"DISCORD_BOOS_REACT",
|
|
|
|
"DISCORD_CUSTOM_COMMAND_PREFIX",
|
|
|
|
"UFORA_ANNOUNCEMENTS_CHANNEL",
|
|
|
|
"UFORA_RSS_TOKEN",
|
|
|
|
"URBAN_DICTIONARY_TOKEN",
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2022-06-10 01:48:02 +02:00
|
|
|
"""General config"""
|
|
|
|
SANDBOX: bool = env.bool("SANDBOX", True)
|
|
|
|
LOGFILE: str = env.str("LOGFILE", "didier.log")
|
2022-07-15 23:14:56 +02:00
|
|
|
SEMESTER: int = env.int("SEMESTER", 2)
|
|
|
|
YEAR: int = env.int("YEAR", 3)
|
2022-06-10 01:48:02 +02:00
|
|
|
|
|
|
|
"""Database"""
|
|
|
|
DB_NAME: str = env.str("DB_NAME", "didier")
|
|
|
|
DB_USERNAME: str = env.str("DB_USERNAME", "postgres")
|
|
|
|
DB_PASSWORD: str = env.str("DB_PASSWORD", "")
|
|
|
|
DB_HOST: str = env.str("DB_HOST", "localhost")
|
|
|
|
DB_PORT: int = env.int("DB_PORT", "5432")
|
|
|
|
|
|
|
|
"""Discord"""
|
2022-07-13 22:54:16 +02:00
|
|
|
DISCORD_TOKEN: str = env.str("DISCORD_TOKEN")
|
|
|
|
DISCORD_READY_MESSAGE: str = env.str("DISCORD_READY_MESSAGE", "I'M READY I'M READY I'M READY")
|
|
|
|
DISCORD_STATUS_MESSAGE: str = env.str("DISCORD_STATUS_MESSAGE", "with your Didier Dinks.")
|
|
|
|
DISCORD_TEST_GUILDS: list[int] = env.list("DISCORD_TEST_GUILDS", [], subcast=int)
|
2022-07-24 16:39:27 +02:00
|
|
|
DISCORD_OWNER_GUILDS: Optional[list[int]] = env.list("DISCORD_OWNER_GUILDS", [], subcast=int) or None
|
2022-07-13 22:54:16 +02:00
|
|
|
DISCORD_BOOS_REACT: str = env.str("DISCORD_BOOS_REACT", "<:boos:629603785840263179>")
|
|
|
|
DISCORD_CUSTOM_COMMAND_PREFIX: str = env.str("DISCORD_CUSTOM_COMMAND_PREFIX", "?")
|
2022-07-23 23:21:32 +02:00
|
|
|
BIRTHDAY_ANNOUNCEMENT_CHANNEL: Optional[int] = env.int("BIRTHDAY_ANNOUNCEMENT_CHANNEL", None)
|
|
|
|
ERRORS_CHANNEL: Optional[int] = env.int("ERRORS_CHANNEL", None)
|
2022-06-19 00:23:25 +02:00
|
|
|
UFORA_ANNOUNCEMENTS_CHANNEL: Optional[int] = env.int("UFORA_ANNOUNCEMENTS_CHANNEL", None)
|
|
|
|
|
|
|
|
"""API Keys"""
|
|
|
|
UFORA_RSS_TOKEN: Optional[str] = env.str("UFORA_RSS_TOKEN", None)
|
2022-07-13 22:54:16 +02:00
|
|
|
URBAN_DICTIONARY_TOKEN: Optional[str] = env.str("URBAN_DICTIONARY_TOKEN", None)
|