qidao-openclaw-plugin 1.2.5 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +8 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidao-openclaw-plugin",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "description": "OpenClaw 栖岛聊天 Channel 插件 - 连接到栖岛聊天服务",
package/src/index.js CHANGED
@@ -71,12 +71,13 @@ const qidaoChannel = {
71
71
  console.log('请访问栖岛官方网站完成认证后,输入获取到的 chatId');
72
72
  console.log('');
73
73
 
74
- const chatId = await prompter.text({
74
+ const chatIdInput = await prompter.text({
75
75
  message: '请输入栖岛 Chat ID:',
76
76
  default: qidaoConfig.chatId?.toString() || '',
77
77
  });
78
78
 
79
- if (!chatId || chatId.trim() === '') {
79
+ // 检查输入是否为空或只有空格
80
+ if (!chatIdInput || chatIdInput.trim() === '') {
80
81
  console.log('未输入 chatId,取消配置');
81
82
  return { cfg };
82
83
  }
@@ -86,18 +87,21 @@ const qidaoChannel = {
86
87
  default: qidaoConfig.serverUrl || 'wss://oc.qidao.chat/ws',
87
88
  });
88
89
 
90
+ // 构建新配置 - 直接在 channels.qidao 下配置
89
91
  const newCfg = {
90
92
  ...cfg,
91
93
  channels: {
92
94
  ...cfg.channels,
93
95
  qidao: {
94
96
  enabled: true,
95
- chatId: parseInt(chatId),
96
- serverUrl,
97
+ chatId: parseInt(chatIdInput.trim()),
98
+ serverUrl: (serverUrl && serverUrl.trim()) || 'wss://oc.qidao.chat/ws',
97
99
  },
98
100
  },
99
101
  };
100
102
 
103
+ console.log('配置已保存:', newCfg.channels.qidao);
104
+
101
105
  return { cfg: newCfg, accountId: 'default' };
102
106
  },
103
107
  },