@marshulll/openclaw-wecom 0.1.11 → 0.1.12
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/package.json +1 -1
- package/wecom/src/wecom-bot.ts +8 -4
package/package.json
CHANGED
package/wecom/src/wecom-bot.ts
CHANGED
|
@@ -753,6 +753,10 @@ export async function handleWecomBotWebhook(params: {
|
|
|
753
753
|
pruneStreams();
|
|
754
754
|
|
|
755
755
|
const { req, res, targets } = params;
|
|
756
|
+
const botTargets = targets.filter((candidate) => shouldHandleBot(candidate.account));
|
|
757
|
+
if (botTargets.length === 0) {
|
|
758
|
+
return false;
|
|
759
|
+
}
|
|
756
760
|
const query = resolveQueryParams(req);
|
|
757
761
|
const timestamp = query.get("timestamp") ?? "";
|
|
758
762
|
const nonce = query.get("nonce") ?? "";
|
|
@@ -770,7 +774,7 @@ export async function handleWecomBotWebhook(params: {
|
|
|
770
774
|
return false;
|
|
771
775
|
}
|
|
772
776
|
|
|
773
|
-
const target =
|
|
777
|
+
const target = botTargets.find((candidate) => {
|
|
774
778
|
if (!shouldHandleBot(candidate.account)) return false;
|
|
775
779
|
if (!candidate.account.configured || !candidate.account.token) return false;
|
|
776
780
|
const ok = verifyWecomSignature({
|
|
@@ -823,9 +827,9 @@ export async function handleWecomBotWebhook(params: {
|
|
|
823
827
|
return true;
|
|
824
828
|
}
|
|
825
829
|
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
830
|
+
const target = botTargets.find((candidate) => {
|
|
831
|
+
if (!shouldHandleBot(candidate.account)) return false;
|
|
832
|
+
if (!candidate.account.token) return false;
|
|
829
833
|
const ok = verifyWecomSignature({
|
|
830
834
|
token: candidate.account.token,
|
|
831
835
|
timestamp,
|