You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.0 KiB

"""全局配置"""
from __future__ import annotations
from dataclasses import dataclass, field
@dataclass
class Config:
"""监听运行配置"""
# ---- 微信窗口 ----
wechat_exe: str = "WeChat.exe" # 微信进程名
wechat_title: str = "微信" # 微信主窗口标题关键字
# ---- 轮询 ----
poll_interval: float = 1.0 # 消息轮询间隔(秒)
idle_poll_interval: float = 3.0 # 空闲时的轮询间隔
# ---- 消息 ----
max_message_length: int = 10_000 # 单条消息最大字符数
dedup_window: int = 300 # 消息去重窗口(秒)
# ---- 存储 ----
sqlite_path: str = "wechat_messages.db"
redis_url: str = "" # 为空则不启用 Redis
# ---- 日志 ----
log_level: str = "INFO"
log_file: str = "wechat_monitor.log"
# ---- 监控目标 ----
watch_conversations: list[str] = field(default_factory=list) # 为空则监控所有