init auth and main function
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
from pydantic_settings import BaseSettings
|
||||
from typing import Optional
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""Application settings."""
|
||||
|
||||
# Bot
|
||||
BOT_TOKEN: str = ""
|
||||
|
||||
# Telethon/MTProto settings
|
||||
API_ID: int = 12345
|
||||
API_HASH: str = "abc123"
|
||||
|
||||
# IRC Configuration
|
||||
IRC_SERVER: str = "irc.chat.twitch.tv"
|
||||
IRC_PORT: int = 6697 # SSL port
|
||||
IRC_USERNAME: str = "justinfan12345"
|
||||
IRC_OAUTH: str = "oauth:12345"
|
||||
|
||||
# Browser Configuration
|
||||
VIEWPORT_WIDTH: int = 1366
|
||||
VIEWPORT_HEIGHT: int = 768
|
||||
|
||||
# Default values
|
||||
DEFAULT_MIN_DELAY: int = 10
|
||||
DEFAULT_MAX_DELAY: int = 30
|
||||
DEFAULT_MIN_READING: int = 10
|
||||
DEFAULT_MAX_READING: int = 30
|
||||
DEFAULT_MONITOR_MINUTES: int = 10
|
||||
DEFAULT_VISITS_PER_LINK: int = 5
|
||||
MTPROTO_SECRET: str = "00000000000000000000000000000000"
|
||||
# Timing
|
||||
MAX_REDIRECT_WAIT: int = 30
|
||||
MAX_RECONNECTS: int = 10
|
||||
PONG_TIMEOUT: int = 300
|
||||
SOCKET_TIMEOUT: int = 30
|
||||
RECV_TIMEOUT: float = 5.0
|
||||
|
||||
# Proxy
|
||||
PROXY_FILE: str = "proxies.txt"
|
||||
PROXY_COOLDOWN_TIME: int = 30
|
||||
PROXY_MAX_USAGE_BEFORE_COOLDOWN: int = 5
|
||||
|
||||
# Screenshots
|
||||
SCREENSHOTS_DIR: str = ""
|
||||
|
||||
# Logging
|
||||
LOG_LEVEL: str = "INFO"
|
||||
LOG_FILE: str = "logs/bot.log"
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
env_file_encoding = "utf-8"
|
||||
case_sensitive = True
|
||||
extra = "ignore" # Игнорировать лишние поля из .env
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user