-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* drawing works fine * ref cleaning * fixing bug with image and better config * placeholder image
- Loading branch information
1 parent
59e8a9b
commit ca180c2
Showing
11 changed files
with
371 additions
and
60 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,48 @@ | ||
import os | ||
from pathlib import Path | ||
from pydantic import Field | ||
from pydantic_settings import BaseSettings, SettingsConfigDict | ||
from typing import Tuple | ||
from pathlib import Path | ||
|
||
from dotenv import load_dotenv | ||
|
||
load_dotenv() | ||
|
||
class AppConfig(BaseSettings): | ||
# Define each configuration item with type annotations | ||
telegram_bot_token: str | None = Field(default=None, env="TELEGRAM_BOT_TOKEN") | ||
developer_chat_id: str | None = Field(default=None, env="DEVELOPER_CHAT_ID") | ||
sqlite_db_file_path: Path | str = Field( | ||
default=Path().resolve() / "db.sqlite", env="SQLITE_DB_FILE_PATH" | ||
) | ||
date_format: str = "%d.%m.%Y %H:%M:%S" | ||
|
||
TELEGRAM_BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN", None) | ||
DEVELOPER_CHAT_ID = os.getenv("DEVELOPER_CHAT_ID", None) | ||
# Game constants | ||
max_votes: int = 10 | ||
max_hitler_voters: int = 1 | ||
min_hitler_voters: int = 1 | ||
max_liberal_voters: int = 6 | ||
min_liberal_voters: int = 3 | ||
max_fascist_voters: int = 3 | ||
min_fascist_voters: int = 1 | ||
|
||
# Database constants | ||
SQLITE_DB_FILE_PATH = os.getenv("SQLITE_DB_FILE_PATH", Path().resolve() / "db.sqlite") | ||
DATE_FORMAT = "%d.%m.%Y %H:%M:%S" | ||
# Game poll outcomes | ||
game_poll_outcomes: Tuple[str, ...] = ( | ||
"👀 SPECTATOR | NOT A PLAYER 👀", | ||
"I'm Canceler Hitler", | ||
"I'm Dead Hitler", | ||
"I'm Hitler Loser", | ||
"I'm Hitler Winner", | ||
"I'm Liberal Winner", | ||
"I'm Liberal Loser", | ||
"I'm Fascistic Winner", | ||
"I'm Fascistic Loser", | ||
) | ||
|
||
# Game constants | ||
MAX_VOTES = 10 | ||
MAX_HITLER_VOTERS = 1 | ||
MIN_HITLER_VOTERS = 1 | ||
MAX_LIBERAL_VOTERS = 6 | ||
MIN_LIBERAL_VOTERS = 3 | ||
MAX_FASCIST_VOTERS = 3 | ||
MIN_FASCIST_VOTERS = 1 | ||
# Colors | ||
liberal_color: str = "#61C8D9" | ||
liberal_color_stroke: str = "#38586D" | ||
fascist_color: str = "#E66443" | ||
fascist_color_stroke: str = "#7A1E16" | ||
stroke_size: str = "12" # TODO: pydantic int setter, str getter | ||
|
||
GAME_POLL_OUTCOMES: Tuple = ( | ||
"👀 SPECTATOR | NOT A PLAYER 👀", | ||
"I'm Canceler Hitler", | ||
"I'm Dead Hitler", | ||
"I'm Hitler Loser", | ||
"I'm Hitler Winner", | ||
"I'm Liberal Winner", | ||
"I'm Liberal Loser", | ||
"I'm Fascistic Winner", | ||
"I'm Fascistic Loser", | ||
) | ||
class Config: | ||
# Optional: control the source of environment variables | ||
env_file = ".env" | ||
env_file_encoding = "utf-8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.