wechaty-web-panel 1.6.77 → 1.6.78
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 +4 -0
- package/dist/cjs/src/common/index.d.ts +3 -2
- package/dist/cjs/src/common/index.js +12 -6
- package/dist/cjs/src/handlers/on-message.js +5 -5
- package/dist/cjs/src/package-json.js +2 -2
- package/dist/cjs/src/proxy/aibotk.js +1 -0
- package/dist/esm/src/common/index.d.ts +3 -2
- package/dist/esm/src/common/index.js +12 -6
- package/dist/esm/src/handlers/on-message.js +5 -5
- package/dist/esm/src/package-json.js +2 -2
- package/dist/esm/src/proxy/aibotk.js +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -71,11 +71,12 @@ export function addRoom(that: any, contact: any, roomName: any, replys: any): Pr
|
|
|
71
71
|
export function contactSay(contact: any, msg: any, isRoom?: boolean): Promise<void>;
|
|
72
72
|
/**
|
|
73
73
|
* 群关键词回复
|
|
74
|
+
* @param room
|
|
74
75
|
* @param {*} contact
|
|
75
76
|
* @param {*} msg
|
|
76
|
-
* @param
|
|
77
|
+
* @param noNeedAt
|
|
77
78
|
*/
|
|
78
|
-
export function roomSay(room: any, contact: any, msg: any): Promise<void>;
|
|
79
|
+
export function roomSay(room: any, contact: any, msg: any, noNeedAt?: boolean): Promise<void>;
|
|
79
80
|
/**
|
|
80
81
|
* 统一触发加群欢迎词
|
|
81
82
|
* @param room 群
|
|
@@ -236,11 +236,12 @@ async function addReplyHistory(that, { content, contact, room }) {
|
|
|
236
236
|
}
|
|
237
237
|
/**
|
|
238
238
|
* 群关键词回复
|
|
239
|
+
* @param room
|
|
239
240
|
* @param {*} contact
|
|
240
241
|
* @param {*} msg
|
|
241
|
-
* @param
|
|
242
|
+
* @param noNeedAt
|
|
242
243
|
*/
|
|
243
|
-
async function roomSay(room, contact, msg) {
|
|
244
|
+
async function roomSay(room, contact, msg, noNeedAt = false) {
|
|
244
245
|
const config = await (0, configDb_js_1.allConfig)();
|
|
245
246
|
const { role } = config.userInfo;
|
|
246
247
|
if (msg.id && role === 'vip') {
|
|
@@ -253,12 +254,17 @@ async function roomSay(room, contact, msg) {
|
|
|
253
254
|
try {
|
|
254
255
|
if (msg.type === 1 && msg.content) {
|
|
255
256
|
const content = await formatContent(msg.content);
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
await room.say(content, ...contact);
|
|
257
|
+
if (noNeedAt || !contact) {
|
|
258
|
+
await room.say(content);
|
|
259
259
|
}
|
|
260
260
|
else {
|
|
261
|
-
|
|
261
|
+
// 文字
|
|
262
|
+
if (Array.isArray(contact)) {
|
|
263
|
+
await room.say(content, ...contact);
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
await room.say(content, contact);
|
|
267
|
+
}
|
|
262
268
|
}
|
|
263
269
|
void addReplyHistory(this, { content, contact: null, room: room });
|
|
264
270
|
}
|
|
@@ -277,7 +277,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
|
|
|
277
277
|
});
|
|
278
278
|
if (gpt4vReplys.length) {
|
|
279
279
|
for (let reply of gpt4vReplys) {
|
|
280
|
-
await index_js_1.roomSay.call(that, room, contact, reply);
|
|
280
|
+
await index_js_1.roomSay.call(that, room, contact, reply, config?.noNeedAt);
|
|
281
281
|
config?.chatDelay ? await (0, index_js_2.delay)(config?.chatDelay * 1000) : await (0, index_js_2.delay)(200);
|
|
282
282
|
}
|
|
283
283
|
return;
|
|
@@ -297,7 +297,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
|
|
|
297
297
|
isMention: mentionSelf
|
|
298
298
|
});
|
|
299
299
|
for (let reply of replys) {
|
|
300
|
-
await index_js_1.roomSay.call(that, room, contact, reply);
|
|
300
|
+
await index_js_1.roomSay.call(that, room, contact, reply, config?.noNeedAt);
|
|
301
301
|
config?.chatDelay ? await (0, index_js_2.delay)(config?.chatDelay * 1000) : await (0, index_js_2.delay)(200);
|
|
302
302
|
}
|
|
303
303
|
const cloudRoom = config.cloudRoom;
|
|
@@ -333,7 +333,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
|
|
|
333
333
|
});
|
|
334
334
|
if (imgGpt4vReplys.length) {
|
|
335
335
|
for (let reply of imgGpt4vReplys) {
|
|
336
|
-
await index_js_1.roomSay.call(that, room, contact, reply);
|
|
336
|
+
await index_js_1.roomSay.call(that, room, contact, reply, config?.noNeedAt);
|
|
337
337
|
}
|
|
338
338
|
return;
|
|
339
339
|
}
|
|
@@ -372,7 +372,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
|
|
|
372
372
|
});
|
|
373
373
|
if (gpt4vReplys.length) {
|
|
374
374
|
for (let reply of gpt4vReplys) {
|
|
375
|
-
await index_js_1.roomSay.call(that, room, contact, reply);
|
|
375
|
+
await index_js_1.roomSay.call(that, room, contact, reply, config?.noNeedAt);
|
|
376
376
|
}
|
|
377
377
|
return;
|
|
378
378
|
}
|
|
@@ -391,7 +391,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
|
|
|
391
391
|
isMention: true
|
|
392
392
|
});
|
|
393
393
|
for (let reply of replys) {
|
|
394
|
-
await index_js_1.roomSay.call(that, room, contact, reply);
|
|
394
|
+
await index_js_1.roomSay.call(that, room, contact, reply, config?.noNeedAt);
|
|
395
395
|
config?.chatDelay ? await (0, index_js_2.delay)(config?.chatDelay * 1000) : await (0, index_js_2.delay)(200);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
@@ -6,7 +6,7 @@ exports.packageJson = void 0;
|
|
|
6
6
|
*/
|
|
7
7
|
exports.packageJson = {
|
|
8
8
|
"name": "wechaty-web-panel",
|
|
9
|
-
"version": "1.6.
|
|
9
|
+
"version": "1.6.78",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"import": "./dist/esm/src/index.js",
|
|
@@ -37,7 +37,7 @@ exports.packageJson = {
|
|
|
37
37
|
"eslint-plugin-prettier": "^3.1.4",
|
|
38
38
|
"npm-run-all": "^4.1.5",
|
|
39
39
|
"prettier": "^2.0.5",
|
|
40
|
-
"wechaty-puppet-matrix": "^0.0.
|
|
40
|
+
"wechaty-puppet-matrix": "^0.0.23",
|
|
41
41
|
"wechaty-puppet-wechat4u": "^1.14.12"
|
|
42
42
|
},
|
|
43
43
|
"readme": "README.md",
|
|
@@ -71,11 +71,12 @@ export function addRoom(that: any, contact: any, roomName: any, replys: any): Pr
|
|
|
71
71
|
export function contactSay(contact: any, msg: any, isRoom?: boolean): Promise<void>;
|
|
72
72
|
/**
|
|
73
73
|
* 群关键词回复
|
|
74
|
+
* @param room
|
|
74
75
|
* @param {*} contact
|
|
75
76
|
* @param {*} msg
|
|
76
|
-
* @param
|
|
77
|
+
* @param noNeedAt
|
|
77
78
|
*/
|
|
78
|
-
export function roomSay(room: any, contact: any, msg: any): Promise<void>;
|
|
79
|
+
export function roomSay(room: any, contact: any, msg: any, noNeedAt?: boolean): Promise<void>;
|
|
79
80
|
/**
|
|
80
81
|
* 统一触发加群欢迎词
|
|
81
82
|
* @param room 群
|
|
@@ -222,11 +222,12 @@ async function addReplyHistory(that, { content, contact, room }) {
|
|
|
222
222
|
}
|
|
223
223
|
/**
|
|
224
224
|
* 群关键词回复
|
|
225
|
+
* @param room
|
|
225
226
|
* @param {*} contact
|
|
226
227
|
* @param {*} msg
|
|
227
|
-
* @param
|
|
228
|
+
* @param noNeedAt
|
|
228
229
|
*/
|
|
229
|
-
async function roomSay(room, contact, msg) {
|
|
230
|
+
async function roomSay(room, contact, msg, noNeedAt = false) {
|
|
230
231
|
const config = await allConfig();
|
|
231
232
|
const { role } = config.userInfo;
|
|
232
233
|
if (msg.id && role === 'vip') {
|
|
@@ -239,12 +240,17 @@ async function roomSay(room, contact, msg) {
|
|
|
239
240
|
try {
|
|
240
241
|
if (msg.type === 1 && msg.content) {
|
|
241
242
|
const content = await formatContent(msg.content);
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
await room.say(content, ...contact);
|
|
243
|
+
if (noNeedAt || !contact) {
|
|
244
|
+
await room.say(content);
|
|
245
245
|
}
|
|
246
246
|
else {
|
|
247
|
-
|
|
247
|
+
// 文字
|
|
248
|
+
if (Array.isArray(contact)) {
|
|
249
|
+
await room.say(content, ...contact);
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
await room.say(content, contact);
|
|
253
|
+
}
|
|
248
254
|
}
|
|
249
255
|
void addReplyHistory(this, { content, contact: null, room: room });
|
|
250
256
|
}
|
|
@@ -275,7 +275,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
|
|
|
275
275
|
});
|
|
276
276
|
if (gpt4vReplys.length) {
|
|
277
277
|
for (let reply of gpt4vReplys) {
|
|
278
|
-
await roomSay.call(that, room, contact, reply);
|
|
278
|
+
await roomSay.call(that, room, contact, reply, config?.noNeedAt);
|
|
279
279
|
config?.chatDelay ? await delay(config?.chatDelay * 1000) : await delay(200);
|
|
280
280
|
}
|
|
281
281
|
return;
|
|
@@ -295,7 +295,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
|
|
|
295
295
|
isMention: mentionSelf
|
|
296
296
|
});
|
|
297
297
|
for (let reply of replys) {
|
|
298
|
-
await roomSay.call(that, room, contact, reply);
|
|
298
|
+
await roomSay.call(that, room, contact, reply, config?.noNeedAt);
|
|
299
299
|
config?.chatDelay ? await delay(config?.chatDelay * 1000) : await delay(200);
|
|
300
300
|
}
|
|
301
301
|
const cloudRoom = config.cloudRoom;
|
|
@@ -331,7 +331,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
|
|
|
331
331
|
});
|
|
332
332
|
if (imgGpt4vReplys.length) {
|
|
333
333
|
for (let reply of imgGpt4vReplys) {
|
|
334
|
-
await roomSay.call(that, room, contact, reply);
|
|
334
|
+
await roomSay.call(that, room, contact, reply, config?.noNeedAt);
|
|
335
335
|
}
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
@@ -370,7 +370,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
|
|
|
370
370
|
});
|
|
371
371
|
if (gpt4vReplys.length) {
|
|
372
372
|
for (let reply of gpt4vReplys) {
|
|
373
|
-
await roomSay.call(that, room, contact, reply);
|
|
373
|
+
await roomSay.call(that, room, contact, reply, config?.noNeedAt);
|
|
374
374
|
}
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
@@ -389,7 +389,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
|
|
|
389
389
|
isMention: true
|
|
390
390
|
});
|
|
391
391
|
for (let reply of replys) {
|
|
392
|
-
await roomSay.call(that, room, contact, reply);
|
|
392
|
+
await roomSay.call(that, room, contact, reply, config?.noNeedAt);
|
|
393
393
|
config?.chatDelay ? await delay(config?.chatDelay * 1000) : await delay(200);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const packageJson = {
|
|
5
5
|
"name": "wechaty-web-panel",
|
|
6
|
-
"version": "1.6.
|
|
6
|
+
"version": "1.6.78",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"import": "./dist/esm/src/index.js",
|
|
@@ -34,7 +34,7 @@ export const packageJson = {
|
|
|
34
34
|
"eslint-plugin-prettier": "^3.1.4",
|
|
35
35
|
"npm-run-all": "^4.1.5",
|
|
36
36
|
"prettier": "^2.0.5",
|
|
37
|
-
"wechaty-puppet-matrix": "^0.0.
|
|
37
|
+
"wechaty-puppet-matrix": "^0.0.23",
|
|
38
38
|
"wechaty-puppet-wechat4u": "^1.14.12"
|
|
39
39
|
},
|
|
40
40
|
"readme": "README.md",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wechaty-web-panel",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.78",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"import": "./dist/esm/src/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"eslint-plugin-prettier": "^3.1.4",
|
|
32
32
|
"npm-run-all": "^4.1.5",
|
|
33
33
|
"prettier": "^2.0.5",
|
|
34
|
-
"wechaty-puppet-matrix": "^0.0.
|
|
34
|
+
"wechaty-puppet-matrix": "^0.0.23",
|
|
35
35
|
"wechaty-puppet-wechat4u": "^1.14.12"
|
|
36
36
|
},
|
|
37
37
|
"readme": "README.md",
|