Merge branch 'main' into feat/mongo
This commit is contained in:
@@ -50,6 +50,9 @@ class ChatBot:
|
||||
return
|
||||
self.bot = bot # 更新 bot 实例
|
||||
|
||||
if event.user_id in self.config.ban_user_id:
|
||||
return
|
||||
|
||||
# 打印原始消息内容
|
||||
'''
|
||||
print(f"\n\033[1;33m[消息详情]\033[0m")
|
||||
|
||||
@@ -27,9 +27,6 @@ model_r1_distill_probability = 0.1
|
||||
|
||||
|
||||
[groups]
|
||||
read_allowed = [
|
||||
#可以读取消息的群
|
||||
]
|
||||
|
||||
talk_allowed = [
|
||||
#可以回复消息的群
|
||||
@@ -38,3 +35,7 @@ talk_allowed = [
|
||||
talk_frequency_down = [
|
||||
#降低回复频率的群
|
||||
]
|
||||
|
||||
ban_user_id = [
|
||||
#禁止回复消息的QQ号
|
||||
]
|
||||
@@ -36,9 +36,9 @@ class BotConfig:
|
||||
MAX_CONTEXT_SIZE: int = 15 # 上下文最大消息数
|
||||
emoji_chance: float = 0.2 # 发送表情包的基础概率
|
||||
|
||||
read_allowed_groups = set()
|
||||
talk_allowed_groups = set()
|
||||
talk_frequency_down_groups = set()
|
||||
ban_user_id = set()
|
||||
|
||||
EMOJI_CHECK_INTERVAL: int = 120 # 表情包检查间隔(分钟)
|
||||
EMOJI_REGISTER_INTERVAL: int = 10 # 表情包注册间隔(分钟)
|
||||
@@ -95,9 +95,9 @@ class BotConfig:
|
||||
# 群组配置
|
||||
if "groups" in toml_dict:
|
||||
groups_config = toml_dict["groups"]
|
||||
config.read_allowed_groups = set(groups_config.get("read_allowed", []))
|
||||
config.talk_allowed_groups = set(groups_config.get("talk_allowed", []))
|
||||
config.talk_frequency_down_groups = set(groups_config.get("talk_frequency_down", []))
|
||||
config.ban_user_id = set(groups_config.get("ban_user_id", []))
|
||||
|
||||
print(f"\033[1;32m成功加载配置文件: {config_path}\033[0m")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user