Files
zhenxun_bot/configs/config.py
T

37 lines
1000 B
Python
Raw Normal View History

import platform
2021-11-04 16:11:50 +08:00
from pathlib import Path
from typing import Optional
2021-11-04 16:11:50 +08:00
from .utils import ConfigsManager
2021-05-20 18:37:51 +08:00
2022-06-23 17:57:47 +08:00
if platform.system() == "Linux":
import os
hostip = (
os.popen("cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'")
.read()
.replace("\n", "")
)
2021-08-06 19:42:02 +08:00
2021-08-17 23:17:08 +08:00
# 回复消息名称
2021-09-05 02:21:38 +08:00
NICKNAME: str = "小真寻"
2021-05-20 18:37:51 +08:00
# 数据库(必要)
2021-06-23 15:57:03 +08:00
# 如果填写了bind就不需要再填写后面的字段了#)
2023-02-18 22:57:40 +08:00
# 示例:"bind": "postgres://user:password@127.0.0.1:5432/database"
2021-08-06 19:47:01 +08:00
bind: str = "" # 数据库连接链接
sql_name: str = "postgres"
2021-07-30 21:21:51 +08:00
user: str = "" # 数据用户名
password: str = "" # 数据库密码
address: str = "" # 数据库地址
port: str = "" # 数据库端口
database: str = "" # 数据库名称
2021-05-20 18:37:51 +08:00
2021-12-16 11:16:28 +08:00
# 代理,例如 "http://127.0.0.1:7890"
2022-06-23 17:57:47 +08:00
# 如果是WLS 可以 f"http://{hostip}:7890" 使用寄主机的代理
2021-12-16 11:16:28 +08:00
SYSTEM_PROXY: Optional[str] = None # 全局代理
2021-09-05 02:21:38 +08:00
2021-09-09 10:47:26 +08:00
2021-11-04 16:11:50 +08:00
Config = ConfigsManager(Path() / "data" / "configs" / "plugins2config.yaml")