LittlePaimon/utils/config.py

82 lines
2.8 KiB
Python
Raw Normal View History

from typing import List
2022-04-30 14:13:39 +08:00
from nonebot import get_driver
from pydantic import BaseModel
2022-04-30 14:13:39 +08:00
class PluginConfig(BaseModel):
# 群组模拟抽卡冷却(秒)
2022-06-16 20:52:09 +08:00
paimon_gacha_cd_group: int = 30
# 个人模拟抽卡冷却(秒)
2022-06-16 20:52:09 +08:00
paimon_gacha_cd_user: int = 60
# 树脂提醒停止检查时间(小时)
2022-04-30 14:13:39 +08:00
paimon_remind_start: int = 0
paimon_remind_end: int = 8
# 树脂提醒检查间隔(分钟)
2022-04-30 14:13:39 +08:00
paimon_check_interval: int = 16
# 树脂提醒每日提醒次数上限
2022-04-30 14:13:39 +08:00
paimon_remind_limit: int = 3
# 自动签到开始时间(小时)
2022-04-30 14:13:39 +08:00
paimon_sign_hour: int = 0
# 自动签到开始时间(分钟)
2022-04-30 14:13:39 +08:00
paimon_sign_minute: int = 0
# 自动米游币获取开始时间(小时)
paimon_coin_hour: int = 0
# 自动米游币获取开始时间(分钟)
paimon_coin_minute: int = 5
# 对联冷却(秒)
paimon_couplets_cd: int = 6
# 猫图冷却(秒)
2022-06-16 20:52:09 +08:00
paimon_cat_cd: int = 12
# 二次元图冷却(秒)
2022-06-16 20:52:09 +08:00
paimon_ecy_cd: int = 6
# 原神壁纸图冷却(秒)
2022-06-16 20:52:09 +08:00
paimon_ysp_cd: int = 10
2022-06-16 21:12:19 +08:00
# 派蒙聊天&机器学习开启群组
2022-06-16 20:52:09 +08:00
paimon_chat_group: List[int] = []
2022-05-28 23:30:59 +08:00
# 派蒙猜语音持续时间
paimon_guess_voice: int = 30
2022-05-27 21:13:59 +08:00
# 原神日历开启群组
2022-06-16 20:52:09 +08:00
paimon_calender_group: List[int] = []
2022-04-30 14:13:39 +08:00
2022-05-28 23:30:59 +08:00
# 以下为机器学习聊天模块配置
# mongodb数据库连接url
2022-06-16 20:52:09 +08:00
paimon_mongodb_url: str = None
2022-05-28 23:30:59 +08:00
# 派蒙聊天屏蔽用户
paimon_chat_ban: List[int] = []
# 派蒙聊天学习阈值,越小学习越快
2022-06-16 20:52:09 +08:00
paimon_answer_threshold: int = 3
2022-05-28 23:30:59 +08:00
# 派蒙聊天上限阈值
2022-06-16 20:52:09 +08:00
paimon_answer_limit_threshold: int = 25
2022-05-28 23:30:59 +08:00
# N个群有相同的回复就跨群作为全局回复
paimon_cross_group_threshold: int = 2
# 复读的阈值
paimon_repeat_threshold: int = 3
# 主动发言阈值,越小话越多
2022-06-16 20:52:09 +08:00
paimon_speak_threshold: int = 3
2022-05-28 23:30:59 +08:00
# 喝醉的概率
2022-06-16 20:52:09 +08:00
paimon_drunk_probability: float = 0.07
2022-05-28 23:30:59 +08:00
# 用文字转语音来回复的概率
2022-06-16 20:52:09 +08:00
paimon_voice_probability: float = 0.03
2022-05-28 23:30:59 +08:00
# 连续主动说话的概率
2022-06-16 20:52:09 +08:00
paimon_speak_continuously_probability: float = 0.5
2022-05-28 23:30:59 +08:00
# 主动说话加上随机戳一戳群友的概率
2022-06-16 20:52:09 +08:00
paimon_speak_poke_probability: float = 0.5
2022-05-28 23:30:59 +08:00
# 连续主动说话最多几句话
2022-06-16 20:52:09 +08:00
paimon_speak_continuously_max_len: int = 3
2022-05-28 23:30:59 +08:00
# 派蒙收到好友申请或群邀请时是否向超级管理员发通知
paimon_request_remind: bool = True
# 是否自动通过好友请求
paimon_add_friend: bool = False
# 是否自动通过群组请求
paimon_add_group: bool = False
# 禁用群新成员欢迎语和龙王提醒的群号列表
paimon_greet_ban: List[int] = []
2022-04-30 14:13:39 +08:00
driver = get_driver()
global_config = driver.config
config: PluginConfig = PluginConfig.parse_obj(global_config.dict())