Merge branch 'dev' of https://github.com/MoFox-Studio/MoFox-Core into dev
This commit is contained in:
@@ -1129,6 +1129,10 @@ class DefaultReplyer:
|
||||
if reply_to:
|
||||
# 兼容旧的reply_to
|
||||
sender, target = self._parse_reply_target(reply_to)
|
||||
# 回退逻辑:为 'reply_to' 路径提供 platform 和 user_id 的回退值,以修复 UnboundLocalError
|
||||
# 这样就不再强制要求必须有 user_id,解决了QQ空间插件等场景下的崩溃问题
|
||||
platform = chat_stream.platform
|
||||
user_id = ""
|
||||
else:
|
||||
# 对于 respond 动作,reply_message 可能为 None(统一回应未读消息)
|
||||
# 对于 reply 动作,reply_message 必须存在(针对特定消息回复)
|
||||
|
||||
@@ -50,6 +50,8 @@ class NapcatAdapter(BaseAdapter):
|
||||
host = config_api.get_plugin_config(plugin.config, "napcat_server.host", "localhost")
|
||||
port = config_api.get_plugin_config(plugin.config, "napcat_server.port", 8095)
|
||||
access_token = config_api.get_plugin_config(plugin.config, "napcat_server.access_token", "")
|
||||
mode_str = config_api.get_plugin_config(plugin.config, "napcat_server.mode", "reverse")
|
||||
ws_mode = "client" if mode_str == "direct" else "server"
|
||||
|
||||
ws_url = f"ws://{host}:{port}"
|
||||
headers = {}
|
||||
@@ -58,10 +60,11 @@ class NapcatAdapter(BaseAdapter):
|
||||
else:
|
||||
ws_url = "ws://127.0.0.1:8095"
|
||||
headers = {}
|
||||
ws_mode = "server"
|
||||
|
||||
# 配置 WebSocket 传输
|
||||
transport = WebSocketAdapterOptions(
|
||||
mode="server",
|
||||
mode=ws_mode,
|
||||
url=ws_url,
|
||||
headers=headers if headers else None,
|
||||
)
|
||||
|
||||
@@ -79,7 +79,7 @@ class MessageHandler:
|
||||
|
||||
# 获取群聊配置
|
||||
group_list_type = features_config.get("group_list_type", "blacklist")
|
||||
group_list = features_config.get("group_list", [])
|
||||
group_list = [str(item) for item in features_config.get("group_list", [])]
|
||||
|
||||
if group_list_type == "blacklist":
|
||||
# 黑名单模式:如果在黑名单中就过滤
|
||||
@@ -96,7 +96,7 @@ class MessageHandler:
|
||||
elif message_type == "private":
|
||||
# 获取私聊配置
|
||||
private_list_type = features_config.get("private_list_type", "blacklist")
|
||||
private_list = features_config.get("private_list", [])
|
||||
private_list = [str(item) for item in features_config.get("private_list", [])]
|
||||
|
||||
if private_list_type == "blacklist":
|
||||
# 黑名单模式:如果在黑名单中就过滤
|
||||
|
||||
Reference in New Issue
Block a user