-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.py
More file actions
47 lines (34 loc) · 1.42 KB
/
config.py
File metadata and controls
47 lines (34 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""Configuration management via pydantic-settings.
This repo is intentionally kept small: it exists to
- perform QR login to Goofish/Xianyu and export Playwright storage state
- receive ai-goofish-monitor webhooks and forward them as Discord DMs
"""
from pathlib import Path
from pydantic import Field
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
"""Application settings loaded from environment variables and .env file."""
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
extra="ignore",
)
# Discord
discord_bot_token: str = ""
discord_user_id: int = 0
# Goofish/Xianyu session
goofish_cookies_json_path: Path = Field(default=Path("./cookies.json"))
# Webhook receiver (ai-goofish-monitor -> Discord DM)
webhook_host: str = "0.0.0.0"
webhook_port: int = 8123
webhook_path: str = "/webhook/ai-goofish-monitor"
webhook_secret: str = ""
# Notification formatting
# Approx FX rate used for displaying converted EUR price in Discord embeds.
cny_to_eur_rate: float = 0.13
# Template for generating a Superbuy-compatible link.
# Must include `{url}` placeholder for the URL-encoded Goofish link.
superbuy_link_template: str = "https://www.superbuy.com/en/page/buy/?url={url}"
# Logging
log_level: str = "INFO"
settings = Settings() # type: ignore[call-arg]