🤖 自动格式化代码 [skip ci]
This commit is contained in:
@@ -164,7 +164,7 @@ class MuteAction(BaseAction):
|
||||
success = await self.send_command(
|
||||
command_name="GROUP_BAN",
|
||||
args={"qq_id": str(user_id), "duration": str(duration_int)},
|
||||
display_message=f"发送禁言命令",
|
||||
display_message="发送禁言命令",
|
||||
)
|
||||
|
||||
if success:
|
||||
@@ -180,8 +180,8 @@ class MuteAction(BaseAction):
|
||||
"user_id": user_id,
|
||||
"duration": duration_int,
|
||||
"duration_str": time_str,
|
||||
"reason": reason
|
||||
}
|
||||
"reason": reason,
|
||||
},
|
||||
)
|
||||
return True, f"成功禁言 {target},时长 {time_str}"
|
||||
else:
|
||||
@@ -389,7 +389,7 @@ class MutePlugin(BasePlugin):
|
||||
"mute": "核心禁言功能配置",
|
||||
"smart_mute": "智能禁言Action的专属配置",
|
||||
"mute_command": "禁言命令Command的专属配置",
|
||||
"logging": "日志记录相关配置"
|
||||
"logging": "日志记录相关配置",
|
||||
}
|
||||
|
||||
# 配置Schema定义
|
||||
@@ -398,17 +398,21 @@ class MutePlugin(BasePlugin):
|
||||
"name": ConfigField(type=str, default="mute_plugin", description="插件名称", required=True),
|
||||
"version": ConfigField(type=str, default="2.0.0", description="插件版本号"),
|
||||
"enabled": ConfigField(type=bool, default=False, description="是否启用插件"),
|
||||
"description": ConfigField(type=str, default="群聊禁言管理插件,提供智能禁言功能", description="插件描述", required=True)
|
||||
"description": ConfigField(
|
||||
type=str, default="群聊禁言管理插件,提供智能禁言功能", description="插件描述", required=True
|
||||
),
|
||||
},
|
||||
"components": {
|
||||
"enable_smart_mute": ConfigField(type=bool, default=True, description="是否启用智能禁言Action"),
|
||||
"enable_mute_command": ConfigField(type=bool, default=False, description="是否启用禁言命令Command")
|
||||
"enable_mute_command": ConfigField(type=bool, default=False, description="是否启用禁言命令Command"),
|
||||
},
|
||||
"mute": {
|
||||
"min_duration": ConfigField(type=int, default=60, description="最短禁言时长(秒)"),
|
||||
"max_duration": ConfigField(type=int, default=2592000, description="最长禁言时长(秒),默认30天"),
|
||||
"default_duration": ConfigField(type=int, default=300, description="默认禁言时长(秒),默认5分钟"),
|
||||
"enable_duration_formatting": ConfigField(type=bool, default=True, description="是否启用人性化的时长显示(如 '5分钟' 而非 '300秒')"),
|
||||
"enable_duration_formatting": ConfigField(
|
||||
type=bool, default=True, description="是否启用人性化的时长显示(如 '5分钟' 而非 '300秒')"
|
||||
),
|
||||
"log_mute_history": ConfigField(type=bool, default=True, description="是否记录禁言历史(未来功能)"),
|
||||
"templates": ConfigField(
|
||||
type=list,
|
||||
@@ -418,9 +422,9 @@ class MutePlugin(BasePlugin):
|
||||
"明白了,禁言 {target} {duration},原因是{reason}",
|
||||
"哇哈哈哈哈哈,已禁言 {target} {duration},理由:{reason}",
|
||||
"哎呦我去,对 {target} 执行禁言 {duration},因为{reason}",
|
||||
"{target},你完蛋了,我要禁言你 {duration} 秒,原因:{reason}"
|
||||
"{target},你完蛋了,我要禁言你 {duration} 秒,原因:{reason}",
|
||||
],
|
||||
description="成功禁言后发送的随机消息模板"
|
||||
description="成功禁言后发送的随机消息模板",
|
||||
),
|
||||
"error_messages": ConfigField(
|
||||
type=list,
|
||||
@@ -430,26 +434,30 @@ class MutePlugin(BasePlugin):
|
||||
"禁言时长必须是正数哦~",
|
||||
"禁言时长必须是数字哦~",
|
||||
"找不到 {target} 这个人呢~",
|
||||
"查找用户信息时出现问题~"
|
||||
"查找用户信息时出现问题~",
|
||||
],
|
||||
description="执行禁言过程中发生错误时发送的随机消息模板"
|
||||
)
|
||||
description="执行禁言过程中发生错误时发送的随机消息模板",
|
||||
),
|
||||
},
|
||||
"smart_mute": {
|
||||
"strict_mode": ConfigField(type=bool, default=True, description="LLM判定的严格模式"),
|
||||
"keyword_sensitivity": ConfigField(type=str, default="normal", description="关键词激活的敏感度", choices=["low", "normal", "high"]),
|
||||
"allow_parallel": ConfigField(type=bool, default=False, description="是否允许并行执行(暂未启用)")
|
||||
"keyword_sensitivity": ConfigField(
|
||||
type=str, default="normal", description="关键词激活的敏感度", choices=["low", "normal", "high"]
|
||||
),
|
||||
"allow_parallel": ConfigField(type=bool, default=False, description="是否允许并行执行(暂未启用)"),
|
||||
},
|
||||
"mute_command": {
|
||||
"max_batch_size": ConfigField(type=int, default=5, description="最大批量禁言数量(未来功能)"),
|
||||
"cooldown_seconds": ConfigField(type=int, default=3, description="命令冷却时间(秒)")
|
||||
"cooldown_seconds": ConfigField(type=int, default=3, description="命令冷却时间(秒)"),
|
||||
},
|
||||
"logging": {
|
||||
"level": ConfigField(type=str, default="INFO", description="日志记录级别", choices=["DEBUG", "INFO", "WARNING", "ERROR"]),
|
||||
"level": ConfigField(
|
||||
type=str, default="INFO", description="日志记录级别", choices=["DEBUG", "INFO", "WARNING", "ERROR"]
|
||||
),
|
||||
"prefix": ConfigField(type=str, default="[MutePlugin]", description="日志记录前缀"),
|
||||
"include_user_info": ConfigField(type=bool, default=True, description="日志中是否包含用户信息"),
|
||||
"include_duration_info": ConfigField(type=bool, default=True, description="日志中是否包含禁言时长信息")
|
||||
}
|
||||
"include_duration_info": ConfigField(type=bool, default=True, description="日志中是否包含禁言时长信息"),
|
||||
},
|
||||
}
|
||||
|
||||
def get_plugin_components(self) -> List[Tuple[ComponentInfo, Type]]:
|
||||
|
||||
Reference in New Issue
Block a user