@openclaw-china/qqbot 2026.3.8-3 → 2026.3.9

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.
package/dist/index.js CHANGED
@@ -6548,15 +6548,21 @@ function getPreferredAccountConfig(channelCfg) {
6548
6548
  }
6549
6549
  return void 0;
6550
6550
  }
6551
- function hasTokenPair(channelCfg) {
6552
- if (hasNonEmptyString(channelCfg.token) && hasNonEmptyString(channelCfg.encodingAESKey)) {
6551
+ function hasCredentialPair(channelCfg, firstKey, secondKey) {
6552
+ if (hasNonEmptyString(channelCfg[firstKey]) && hasNonEmptyString(channelCfg[secondKey])) {
6553
6553
  return true;
6554
6554
  }
6555
6555
  const accountCfg = getPreferredAccountConfig(channelCfg);
6556
6556
  return Boolean(
6557
- accountCfg && hasNonEmptyString(accountCfg.token) && hasNonEmptyString(accountCfg.encodingAESKey)
6557
+ accountCfg && hasNonEmptyString(accountCfg[firstKey]) && hasNonEmptyString(accountCfg[secondKey])
6558
6558
  );
6559
6559
  }
6560
+ function hasTokenPair(channelCfg) {
6561
+ return hasCredentialPair(channelCfg, "token", "encodingAESKey");
6562
+ }
6563
+ function hasWecomWsCredentialPair(channelCfg) {
6564
+ return hasCredentialPair(channelCfg, "botId", "secret");
6565
+ }
6560
6566
  function isChannelConfigured(cfg, channelId) {
6561
6567
  const channelCfg = getChannelConfig(cfg, channelId);
6562
6568
  switch (channelId) {
@@ -6567,6 +6573,7 @@ function isChannelConfigured(cfg, channelId) {
6567
6573
  case "qqbot":
6568
6574
  return hasNonEmptyString(channelCfg.appId) && hasNonEmptyString(channelCfg.clientSecret);
6569
6575
  case "wecom":
6576
+ return hasWecomWsCredentialPair(channelCfg);
6570
6577
  case "wecom-app":
6571
6578
  return hasTokenPair(channelCfg);
6572
6579
  default:
@@ -6717,25 +6724,24 @@ async function configureWecom(prompter, cfg) {
6717
6724
  section("\u914D\u7F6E WeCom\uFF08\u4F01\u4E1A\u5FAE\u4FE1-\u667A\u80FD\u673A\u5668\u4EBA\uFF09");
6718
6725
  showGuideLink("wecom");
6719
6726
  const existing = getChannelConfig(cfg, "wecom");
6720
- const webhookPath = await prompter.askText({
6721
- label: "Webhook \u8DEF\u5F84\uFF08\u9700\u4E0E\u4F01\u4E1A\u5FAE\u4FE1\u540E\u53F0\u914D\u7F6E\u4E00\u81F4\uFF0C\u9ED8\u8BA4 /wecom\uFF09",
6722
- defaultValue: toTrimmedString2(existing.webhookPath) ?? "/wecom",
6723
- required: true
6724
- });
6725
- const token = await prompter.askSecret({
6726
- label: "WeCom token",
6727
- existingValue: toTrimmedString2(existing.token),
6727
+ Ve("\u5F53\u524D\u5411\u5BFC\u4EC5\u63D0\u4F9B WeCom ws \u957F\u8FDE\u63A5\u914D\u7F6E\u3002", "\u63D0\u793A");
6728
+ const botId = await prompter.askText({
6729
+ label: "WeCom botId\uFF08ws \u957F\u8FDE\u63A5\uFF09",
6730
+ defaultValue: toTrimmedString2(existing.botId),
6728
6731
  required: true
6729
6732
  });
6730
- const encodingAESKey = await prompter.askSecret({
6731
- label: "WeCom encodingAESKey",
6732
- existingValue: toTrimmedString2(existing.encodingAESKey),
6733
+ const secret = await prompter.askSecret({
6734
+ label: "WeCom secret\uFF08ws \u957F\u8FDE\u63A5\uFF09",
6735
+ existingValue: toTrimmedString2(existing.secret),
6733
6736
  required: true
6734
6737
  });
6735
6738
  return mergeChannelConfig(cfg, "wecom", {
6736
- webhookPath,
6737
- token,
6738
- encodingAESKey
6739
+ mode: "ws",
6740
+ botId,
6741
+ secret,
6742
+ webhookPath: void 0,
6743
+ token: void 0,
6744
+ encodingAESKey: void 0
6739
6745
  });
6740
6746
  }
6741
6747
  async function configureWecomApp(prompter, cfg) {