wechaty-web-panel 1.5.1 → 1.5.2
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 -1
- package/README.md +5 -4
- package/dist/cjs/src/package-json.js +1 -1
- package/dist/cjs/src/proxy/superagent.js +4 -4
- package/dist/cjs/src/service/event-dispatch-service.js +0 -29
- package/dist/cjs/src/service/msg-filter-service.js +0 -2
- package/dist/esm/src/package-json.js +1 -1
- package/dist/esm/src/proxy/superagent.js +4 -4
- package/dist/esm/src/service/event-dispatch-service.js +0 -29
- package/dist/esm/src/service/msg-filter-service.js +0 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -21,7 +21,8 @@ Wechaty Web Panel 插件,让你的 wechaty 机器人快速接入 web 控制面
|
|
|
21
21
|
- [x] 天行机器人
|
|
22
22
|
- [x] 图灵机器人
|
|
23
23
|
- [x] 腾讯闲聊机器人
|
|
24
|
-
- [x] ChatGPT api
|
|
24
|
+
- [x] ChatGPT api (支持切换模型)
|
|
25
|
+
- [x] ChatGPT 网页hook
|
|
25
26
|
- [x] 微信对话开放平台
|
|
26
27
|
- [ ] 更多
|
|
27
28
|
|
|
@@ -48,8 +49,8 @@ Wechaty Web Panel 插件,让你的 wechaty 机器人快速接入 web 控制面
|
|
|
48
49
|
- [x] 获取表情包 例: "表情包你好坏"
|
|
49
50
|
- [x] 获取美女图 例: "美女图"
|
|
50
51
|
- [x] 群合影 例: "群合影"
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
~~- [x] 牛年头像 例: "牛气冲天"~~
|
|
53
|
+
~~- [x] 国旗头像 例: "我要国旗"(下线)~~
|
|
53
54
|
- [ ] 更多待你发现
|
|
54
55
|
- [x] 进群自动欢迎
|
|
55
56
|
- [x] 加好友自动回复
|
|
@@ -62,7 +63,7 @@ Wechaty Web Panel 插件,让你的 wechaty 机器人快速接入 web 控制面
|
|
|
62
63
|
|
|
63
64
|
* 特色功能
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
~~- [x] 群合影(下线)~~
|
|
66
67
|
- [x] 主动发送消息
|
|
67
68
|
- [x] 主动更新配置
|
|
68
69
|
- [x] 主动同步好友和群列表
|
|
@@ -36,13 +36,13 @@ service.interceptors.response.use((response) => {
|
|
|
36
36
|
return Promise.resolve(res.data);
|
|
37
37
|
}
|
|
38
38
|
else {
|
|
39
|
-
const
|
|
40
|
-
return Promise.resolve(
|
|
39
|
+
const result = [{ type: 1, content: '回调函数返回参数错误:' + JSON.stringify(res.data) }];
|
|
40
|
+
return Promise.resolve(result);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
|
-
const
|
|
45
|
-
return Promise.resolve(
|
|
44
|
+
const result = [{ type: 1, content: res.msg }];
|
|
45
|
+
return Promise.resolve(result);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
const res = [{ type: 1, content: '回调接口网络错误:' + response.status }];
|
|
@@ -69,38 +69,9 @@ async function dispatchEventContent(that, eName, msg, name, id, avatar, room) {
|
|
|
69
69
|
url = await (0, aibotk_js_1.getMeiNv)();
|
|
70
70
|
type = 2;
|
|
71
71
|
break;
|
|
72
|
-
case 'ncov':
|
|
73
|
-
content = await api_js_1.default.getNcov();
|
|
74
|
-
break;
|
|
75
72
|
case 'cname':
|
|
76
73
|
content = await api_js_1.default.getCname();
|
|
77
74
|
break;
|
|
78
|
-
case 'roomCloud': {
|
|
79
|
-
let wordContent = '';
|
|
80
|
-
const roomName = await room.topic(); // 获取群名
|
|
81
|
-
const config = await (0, aibotk_js_1.getWordCloudConfig)(roomName);
|
|
82
|
-
if (!config.authList) {
|
|
83
|
-
content = '本群暂未开通群词云功能,请联系群主或管理员开启';
|
|
84
|
-
}
|
|
85
|
-
else if (config.authList.length) {
|
|
86
|
-
if (config.authList.includes(name)) {
|
|
87
|
-
wordContent = await (0, roomDb_js_1.getRoomRecordContent)(roomName, config.day);
|
|
88
|
-
const baseImg = await (0, aibotk_js_1.getWordCloud)(wordContent, config.background, config.border);
|
|
89
|
-
type = 3;
|
|
90
|
-
url = baseImg;
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
content = '很抱歉,你没有生成群词云的权限,请联系管理员或群主开通';
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
wordContent = await (0, roomDb_js_1.getRoomRecordContent)(roomName, config.day);
|
|
98
|
-
const baseImg = await (0, aibotk_js_1.getWordCloud)(wordContent, config.background, config.border);
|
|
99
|
-
type = 3;
|
|
100
|
-
url = baseImg;
|
|
101
|
-
}
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
75
|
case 'removeRecord': {
|
|
105
76
|
const roomName = await room.topic(); // 获取群名
|
|
106
77
|
const config = await (0, aibotk_js_1.getWordCloudConfig)(roomName);
|
|
@@ -52,7 +52,6 @@ async function filterFriendMsg(that, contact, msg) {
|
|
|
52
52
|
{ bool: msg.startsWith(REMINDKEY), method: 'scheduleJobMsg' },
|
|
53
53
|
{ bool: config.callBackEvents && config.callBackEvents.length > 0, method: 'callbackEvent' },
|
|
54
54
|
{ bool: config.eventKeywords && config.eventKeywords.length > 0, method: 'eventMsg' },
|
|
55
|
-
{ bool: config.avatarList && config.avatarList.length > 0, method: 'avatarCrop' },
|
|
56
55
|
{ bool: true, method: 'keywordsMsg' },
|
|
57
56
|
{ bool: config.autoReply && config.botScope !== 'room', method: 'robotMsg' },
|
|
58
57
|
];
|
|
@@ -83,7 +82,6 @@ async function filterRoomMsg({ that, msg, name, id, avatar, room, isMention }) {
|
|
|
83
82
|
{ bool: msg === '', method: 'emptyMsg' },
|
|
84
83
|
{ bool: config.callBackEvents && config.callBackEvents.length > 0, method: 'callbackEvent' },
|
|
85
84
|
{ bool: config.eventKeywords && config.eventKeywords.length > 0, method: 'eventMsg' },
|
|
86
|
-
{ bool: config.avatarList && config.avatarList.length > 0, method: 'avatarCrop' },
|
|
87
85
|
{ bool: true, method: 'keywordsMsg' },
|
|
88
86
|
{ bool: config.autoReply && config.botScope !== 'friend', method: 'robotMsg' },
|
|
89
87
|
];
|
|
@@ -29,13 +29,13 @@ service.interceptors.response.use((response) => {
|
|
|
29
29
|
return Promise.resolve(res.data);
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
const
|
|
33
|
-
return Promise.resolve(
|
|
32
|
+
const result = [{ type: 1, content: '回调函数返回参数错误:' + JSON.stringify(res.data) }];
|
|
33
|
+
return Promise.resolve(result);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
const
|
|
38
|
-
return Promise.resolve(
|
|
37
|
+
const result = [{ type: 1, content: res.msg }];
|
|
38
|
+
return Promise.resolve(result);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
const res = [{ type: 1, content: '回调接口网络错误:' + response.status }];
|
|
@@ -63,38 +63,9 @@ async function dispatchEventContent(that, eName, msg, name, id, avatar, room) {
|
|
|
63
63
|
url = await getMeiNv();
|
|
64
64
|
type = 2;
|
|
65
65
|
break;
|
|
66
|
-
case 'ncov':
|
|
67
|
-
content = await api.getNcov();
|
|
68
|
-
break;
|
|
69
66
|
case 'cname':
|
|
70
67
|
content = await api.getCname();
|
|
71
68
|
break;
|
|
72
|
-
case 'roomCloud': {
|
|
73
|
-
let wordContent = '';
|
|
74
|
-
const roomName = await room.topic(); // 获取群名
|
|
75
|
-
const config = await getWordCloudConfig(roomName);
|
|
76
|
-
if (!config.authList) {
|
|
77
|
-
content = '本群暂未开通群词云功能,请联系群主或管理员开启';
|
|
78
|
-
}
|
|
79
|
-
else if (config.authList.length) {
|
|
80
|
-
if (config.authList.includes(name)) {
|
|
81
|
-
wordContent = await getRoomRecordContent(roomName, config.day);
|
|
82
|
-
const baseImg = await getWordCloud(wordContent, config.background, config.border);
|
|
83
|
-
type = 3;
|
|
84
|
-
url = baseImg;
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
content = '很抱歉,你没有生成群词云的权限,请联系管理员或群主开通';
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
wordContent = await getRoomRecordContent(roomName, config.day);
|
|
92
|
-
const baseImg = await getWordCloud(wordContent, config.background, config.border);
|
|
93
|
-
type = 3;
|
|
94
|
-
url = baseImg;
|
|
95
|
-
}
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
69
|
case 'removeRecord': {
|
|
99
70
|
const roomName = await room.topic(); // 获取群名
|
|
100
71
|
const config = await getWordCloudConfig(roomName);
|
|
@@ -46,7 +46,6 @@ async function filterFriendMsg(that, contact, msg) {
|
|
|
46
46
|
{ bool: msg.startsWith(REMINDKEY), method: 'scheduleJobMsg' },
|
|
47
47
|
{ bool: config.callBackEvents && config.callBackEvents.length > 0, method: 'callbackEvent' },
|
|
48
48
|
{ bool: config.eventKeywords && config.eventKeywords.length > 0, method: 'eventMsg' },
|
|
49
|
-
{ bool: config.avatarList && config.avatarList.length > 0, method: 'avatarCrop' },
|
|
50
49
|
{ bool: true, method: 'keywordsMsg' },
|
|
51
50
|
{ bool: config.autoReply && config.botScope !== 'room', method: 'robotMsg' },
|
|
52
51
|
];
|
|
@@ -76,7 +75,6 @@ async function filterRoomMsg({ that, msg, name, id, avatar, room, isMention }) {
|
|
|
76
75
|
{ bool: msg === '', method: 'emptyMsg' },
|
|
77
76
|
{ bool: config.callBackEvents && config.callBackEvents.length > 0, method: 'callbackEvent' },
|
|
78
77
|
{ bool: config.eventKeywords && config.eventKeywords.length > 0, method: 'eventMsg' },
|
|
79
|
-
{ bool: config.avatarList && config.avatarList.length > 0, method: 'avatarCrop' },
|
|
80
78
|
{ bool: true, method: 'keywordsMsg' },
|
|
81
79
|
{ bool: config.autoReply && config.botScope !== 'friend', method: 'robotMsg' },
|
|
82
80
|
];
|