@agent-wechat/wechat 0.9.3 → 0.9.4
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 +5 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5718,7 +5718,7 @@ function resolveWeChatMentionGate(params) {
|
|
|
5718
5718
|
}
|
|
5719
5719
|
|
|
5720
5720
|
// src/monitor.ts
|
|
5721
|
-
var MEDIA_TYPES = /* @__PURE__ */ new Set([3, 34]);
|
|
5721
|
+
var MEDIA_TYPES = /* @__PURE__ */ new Set([3, 34, 43]);
|
|
5722
5722
|
var HISTORY_CONTEXT_MARKER = "[Chat messages since your last reply - for context]";
|
|
5723
5723
|
var CURRENT_MESSAGE_MARKER = "[Current message - respond to this]";
|
|
5724
5724
|
function isOfficialAccount(chatId) {
|
|
@@ -5736,7 +5736,10 @@ function sleep(ms, signal) {
|
|
|
5736
5736
|
async function pollMedia(client, chatId, localId, log, maxAttempts = 15, intervalMs = 1e3) {
|
|
5737
5737
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
5738
5738
|
const result = await client.getMedia(chatId, localId);
|
|
5739
|
-
if (result.
|
|
5739
|
+
if (result.type === "unsupported") {
|
|
5740
|
+
return null;
|
|
5741
|
+
}
|
|
5742
|
+
if (result.data) {
|
|
5740
5743
|
return result;
|
|
5741
5744
|
}
|
|
5742
5745
|
if (attempt < maxAttempts) {
|