wechaty-web-panel 1.6.44 → 1.6.46
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/CHANGELOG.md +3 -0
- package/dist/cjs/src/common/index.js +2 -0
- package/dist/cjs/src/lib/index.js +5 -3
- package/dist/cjs/src/package-json.js +1 -1
- package/dist/cjs/src/proxy/superagent.js +4 -3
- package/dist/cjs/src/service/msg-filters.js +1 -1
- package/dist/cjs/src/service/room-async-service.d.ts +0 -4
- package/dist/cjs/src/service/room-async-service.js +1 -4
- package/dist/esm/src/common/index.js +2 -0
- package/dist/esm/src/lib/index.js +5 -3
- package/dist/esm/src/package-json.js +1 -1
- package/dist/esm/src/proxy/superagent.js +4 -3
- package/dist/esm/src/service/msg-filters.js +1 -1
- package/dist/esm/src/service/room-async-service.d.ts +0 -4
- package/dist/esm/src/service/room-async-service.js +1 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -116,6 +116,7 @@ async function updateContactInfo(that, noCache = false) {
|
|
|
116
116
|
res.push(obj);
|
|
117
117
|
}
|
|
118
118
|
await updateFriendInfo(res, 80);
|
|
119
|
+
console.log(`更新群列表完毕,共获取到${realContact.length}个好友信息`);
|
|
119
120
|
}
|
|
120
121
|
catch (e) {
|
|
121
122
|
console.log('e', e);
|
|
@@ -162,6 +163,7 @@ async function updateRoomInfo(that, noCache = false) {
|
|
|
162
163
|
res.push(obj);
|
|
163
164
|
}
|
|
164
165
|
await updateRoomsInfo(res, 80);
|
|
166
|
+
console.log(`更新群列表完毕,共获取到${roomList.length}个群聊`);
|
|
165
167
|
}
|
|
166
168
|
catch (e) {
|
|
167
169
|
console.log('e', e);
|
|
@@ -502,10 +502,12 @@ exports.delHtmlTag = delHtmlTag;
|
|
|
502
502
|
* @returns {*[]}
|
|
503
503
|
*/
|
|
504
504
|
function extractImageLinks(text) {
|
|
505
|
-
const httpRegex = /(http:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar))/g;
|
|
506
|
-
const httpsRegex = /(https:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar))/g;
|
|
505
|
+
const httpRegex = /(http:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar|pdf|txt|log))/g;
|
|
506
|
+
const httpsRegex = /(https:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar|pdf|txt|log))/g;
|
|
507
507
|
const mdRegexHttps = /!\[[^\]]*\]\((https?:\/\/\S+)\)/g;
|
|
508
508
|
const mdRegexHttp = /!\[[^\]]*\]\((http?:\/\/\S+)\)/g;
|
|
509
|
+
const fileRegexHttp = /\[[^\]]*\]\((http?:\/\/\S+)\)/g;
|
|
510
|
+
const filesRegexHttp = /\[[^\]]*\]\((https?:\/\/\S+)\)/g;
|
|
509
511
|
let imageLinks = [];
|
|
510
512
|
let match;
|
|
511
513
|
while ((match = httpRegex.exec(text)) !== null) {
|
|
@@ -514,7 +516,7 @@ function extractImageLinks(text) {
|
|
|
514
516
|
while ((match = httpsRegex.exec(text)) !== null) {
|
|
515
517
|
imageLinks.push(match[0]);
|
|
516
518
|
}
|
|
517
|
-
while ((match = mdRegexHttp.exec(text)) !== null || (match = mdRegexHttps.exec(text)) !== null) {
|
|
519
|
+
while ((match = mdRegexHttp.exec(text)) !== null || (match = mdRegexHttps.exec(text)) !== null || (match = fileRegexHttp.exec(text)) !== null || (match = filesRegexHttp.exec(text)) !== null) {
|
|
518
520
|
imageLinks.push(match[1]);
|
|
519
521
|
}
|
|
520
522
|
imageLinks = Array.from(new Set(imageLinks));
|
|
@@ -45,11 +45,12 @@ service.interceptors.response.use((response) => {
|
|
|
45
45
|
return Promise.resolve(result);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
console.log(`回调接口网络错误:${response.status}`);
|
|
49
|
+
const res = [{ type: 1, content: '' }];
|
|
49
50
|
return Promise.resolve(res);
|
|
50
51
|
}, (err) => {
|
|
51
|
-
console.log('
|
|
52
|
-
const res = [{ type: 1, content: '
|
|
52
|
+
console.log('回调接口网络错误:', err);
|
|
53
|
+
const res = [{ type: 1, content: '' }];
|
|
53
54
|
return Promise.resolve(res);
|
|
54
55
|
});
|
|
55
56
|
/**
|
|
@@ -364,7 +364,7 @@ async function customChat({ msg, name, id, config, isMention, room, roomId, room
|
|
|
364
364
|
if (keyword || !finalConfig?.keywords.length) {
|
|
365
365
|
msg = keyword ? msg.replace(keyword, '') : msg;
|
|
366
366
|
if (finalConfig.limitNum > 0 && finalConfig.limitNum <= finalConfig.usedNum) {
|
|
367
|
-
return [{ type: 1, content: finalConfig.rechargeTip || '
|
|
367
|
+
return [{ type: 1, content: finalConfig.rechargeTip || '' }];
|
|
368
368
|
}
|
|
369
369
|
const msgArr = await (0, dispatch_js_1.dispatchBot)({
|
|
370
370
|
botType: finalConfig.robotType,
|
|
@@ -238,7 +238,7 @@ const unidirectionalMapper = async (message, one) => {
|
|
|
238
238
|
20: 'CallRecord', // Call Record (voice and video, maybe group?)
|
|
239
239
|
};
|
|
240
240
|
const type = typeMap[message.type()];
|
|
241
|
-
messageList.unshift(`${prefix}: ${type}`)
|
|
241
|
+
// messageList.unshift(`${prefix}: ${type}`)
|
|
242
242
|
}
|
|
243
243
|
break;
|
|
244
244
|
}
|
|
@@ -458,7 +458,4 @@ async function dispatchAsync(that, msg, list) {
|
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
exports.dispatchAsync = dispatchAsync;
|
|
461
|
-
exports.default = {
|
|
462
|
-
dispatchAsync,
|
|
463
|
-
};
|
|
464
461
|
//# sourceMappingURL=room-async-service.js.map
|
|
@@ -108,6 +108,7 @@ async function updateContactInfo(that, noCache = false) {
|
|
|
108
108
|
res.push(obj);
|
|
109
109
|
}
|
|
110
110
|
await updateFriendInfo(res, 80);
|
|
111
|
+
console.log(`更新群列表完毕,共获取到${realContact.length}个好友信息`);
|
|
111
112
|
}
|
|
112
113
|
catch (e) {
|
|
113
114
|
console.log('e', e);
|
|
@@ -153,6 +154,7 @@ async function updateRoomInfo(that, noCache = false) {
|
|
|
153
154
|
res.push(obj);
|
|
154
155
|
}
|
|
155
156
|
await updateRoomsInfo(res, 80);
|
|
157
|
+
console.log(`更新群列表完毕,共获取到${roomList.length}个群聊`);
|
|
156
158
|
}
|
|
157
159
|
catch (e) {
|
|
158
160
|
console.log('e', e);
|
|
@@ -451,10 +451,12 @@ export function delHtmlTag(str) {
|
|
|
451
451
|
* @returns {*[]}
|
|
452
452
|
*/
|
|
453
453
|
export function extractImageLinks(text) {
|
|
454
|
-
const httpRegex = /(http:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar))/g;
|
|
455
|
-
const httpsRegex = /(https:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar))/g;
|
|
454
|
+
const httpRegex = /(http:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar|pdf|txt|log))/g;
|
|
455
|
+
const httpsRegex = /(https:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar|pdf|txt|log))/g;
|
|
456
456
|
const mdRegexHttps = /!\[[^\]]*\]\((https?:\/\/\S+)\)/g;
|
|
457
457
|
const mdRegexHttp = /!\[[^\]]*\]\((http?:\/\/\S+)\)/g;
|
|
458
|
+
const fileRegexHttp = /\[[^\]]*\]\((http?:\/\/\S+)\)/g;
|
|
459
|
+
const filesRegexHttp = /\[[^\]]*\]\((https?:\/\/\S+)\)/g;
|
|
458
460
|
let imageLinks = [];
|
|
459
461
|
let match;
|
|
460
462
|
while ((match = httpRegex.exec(text)) !== null) {
|
|
@@ -463,7 +465,7 @@ export function extractImageLinks(text) {
|
|
|
463
465
|
while ((match = httpsRegex.exec(text)) !== null) {
|
|
464
466
|
imageLinks.push(match[0]);
|
|
465
467
|
}
|
|
466
|
-
while ((match = mdRegexHttp.exec(text)) !== null || (match = mdRegexHttps.exec(text)) !== null) {
|
|
468
|
+
while ((match = mdRegexHttp.exec(text)) !== null || (match = mdRegexHttps.exec(text)) !== null || (match = fileRegexHttp.exec(text)) !== null || (match = filesRegexHttp.exec(text)) !== null) {
|
|
467
469
|
imageLinks.push(match[1]);
|
|
468
470
|
}
|
|
469
471
|
imageLinks = Array.from(new Set(imageLinks));
|
|
@@ -38,11 +38,12 @@ service.interceptors.response.use((response) => {
|
|
|
38
38
|
return Promise.resolve(result);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
console.log(`回调接口网络错误:${response.status}`);
|
|
42
|
+
const res = [{ type: 1, content: '' }];
|
|
42
43
|
return Promise.resolve(res);
|
|
43
44
|
}, (err) => {
|
|
44
|
-
console.log('
|
|
45
|
-
const res = [{ type: 1, content: '
|
|
45
|
+
console.log('回调接口网络错误:', err);
|
|
46
|
+
const res = [{ type: 1, content: '' }];
|
|
46
47
|
return Promise.resolve(res);
|
|
47
48
|
});
|
|
48
49
|
/**
|
|
@@ -347,7 +347,7 @@ async function customChat({ msg, name, id, config, isMention, room, roomId, room
|
|
|
347
347
|
if (keyword || !finalConfig?.keywords.length) {
|
|
348
348
|
msg = keyword ? msg.replace(keyword, '') : msg;
|
|
349
349
|
if (finalConfig.limitNum > 0 && finalConfig.limitNum <= finalConfig.usedNum) {
|
|
350
|
-
return [{ type: 1, content: finalConfig.rechargeTip || '
|
|
350
|
+
return [{ type: 1, content: finalConfig.rechargeTip || '' }];
|
|
351
351
|
}
|
|
352
352
|
const msgArr = await dispatchBot({
|
|
353
353
|
botType: finalConfig.robotType,
|
|
@@ -232,7 +232,7 @@ const unidirectionalMapper = async (message, one) => {
|
|
|
232
232
|
20: 'CallRecord', // Call Record (voice and video, maybe group?)
|
|
233
233
|
};
|
|
234
234
|
const type = typeMap[message.type()];
|
|
235
|
-
messageList.unshift(`${prefix}: ${type}`)
|
|
235
|
+
// messageList.unshift(`${prefix}: ${type}`)
|
|
236
236
|
}
|
|
237
237
|
break;
|
|
238
238
|
}
|
|
@@ -452,7 +452,4 @@ async function dispatchAsync(that, msg, list) {
|
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
export { dispatchAsync };
|
|
455
|
-
export default {
|
|
456
|
-
dispatchAsync,
|
|
457
|
-
};
|
|
458
455
|
//# sourceMappingURL=room-async-service.js.map
|