wechaty-web-panel 1.6.56 → 1.6.57
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 +23 -0
- package/dist/cjs/src/package-json.d.ts +11 -1
- package/dist/cjs/src/package-json.js +13 -3
- package/dist/cjs/src/service/event-dispatch-service.js +1 -1
- package/dist/cjs/test/wechat.d.ts +2 -0
- package/dist/cjs/test/wechat.js +34 -0
- package/dist/cjs/test/wework.d.ts +2 -0
- package/dist/cjs/test/wework.js +27 -0
- package/dist/esm/src/package-json.d.ts +11 -1
- package/dist/esm/src/package-json.js +13 -3
- package/dist/esm/src/service/event-dispatch-service.js +2 -2
- package/dist/esm/test/wechat.d.ts +2 -0
- package/dist/esm/test/wechat.js +32 -0
- package/dist/esm/test/wework.d.ts +2 -0
- package/dist/esm/test/wework.js +25 -0
- package/package.json +13 -3
- package/dist/cjs/test/index.d.ts +0 -2
- package/dist/cjs/test/index.js +0 -23
- package/dist/esm/test/index.d.ts +0 -2
- package/dist/esm/test/index.js +0 -18
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -8,6 +8,29 @@ Wechaty Web Panel 插件,让你的 Wechaty 机器人快速接入 web 控制面
|
|
|
8
8
|
|
|
9
9
|
本项目为插件源码,非直接运行的项目。如需可直接运行的项目,请直接拉取 [https://github.com/leochen-g/wechat-assistant-pro](https://github.com/leochen-g/wechat-assistant-pro) 即可
|
|
10
10
|
|
|
11
|
+
## 快速测试
|
|
12
|
+
|
|
13
|
+
### 下载源码并安装依赖
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
git clone https://github.com/leochen-g/wechaty-web-panel.git
|
|
17
|
+
cd wechaty-web-panel
|
|
18
|
+
npm install # 可指定淘宝镜像源加速: --registry=https://registry.npmmirror.com
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 测试微信
|
|
22
|
+
|
|
23
|
+
在 test/wechat.js文件中填入apiKey与apiSecret,运行如下命令
|
|
24
|
+
```sh
|
|
25
|
+
npm run test:wechat
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 测试企业微信
|
|
29
|
+
需要有企业微信token,在test/wework.js填入workProToken、apiKey与apiSecret,运行如下命令
|
|
30
|
+
```sh
|
|
31
|
+
npm run test:wework
|
|
32
|
+
```
|
|
33
|
+
|
|
11
34
|
## 面板主要功能
|
|
12
35
|
|
|
13
36
|
* 定时提醒
|
|
@@ -14,7 +14,8 @@ export namespace packageJson {
|
|
|
14
14
|
clean: string;
|
|
15
15
|
dist: string;
|
|
16
16
|
"dist:commonjs": string;
|
|
17
|
-
test: string;
|
|
17
|
+
"test:wechat": string;
|
|
18
|
+
"test:wework": string;
|
|
18
19
|
release: string;
|
|
19
20
|
"release:dry": string;
|
|
20
21
|
};
|
|
@@ -41,6 +42,15 @@ export namespace packageJson {
|
|
|
41
42
|
"eslint-plugin-prettier": string;
|
|
42
43
|
"npm-run-all": string;
|
|
43
44
|
prettier: string;
|
|
45
|
+
"@juzi/wechaty": string;
|
|
46
|
+
"@grpc/grpc-js": string;
|
|
47
|
+
"@juzi/wechaty-puppet": string;
|
|
48
|
+
"@juzi/wechaty-puppet-service": string;
|
|
49
|
+
wechaty: string;
|
|
50
|
+
"wechaty-puppet-service": string;
|
|
51
|
+
"wechaty-puppet-wechat4u": string;
|
|
52
|
+
"wechaty-puppet-padlocal": string;
|
|
53
|
+
"wechaty-puppet": string;
|
|
44
54
|
};
|
|
45
55
|
const readme: string;
|
|
46
56
|
namespace engines {
|
|
@@ -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.57",
|
|
10
10
|
"description": "智能微秘书插件",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
@@ -20,7 +20,8 @@ exports.packageJson = {
|
|
|
20
20
|
"clean": "shx rm -fr dist/*",
|
|
21
21
|
"dist": "npm-run-all clean build dist:commonjs",
|
|
22
22
|
"dist:commonjs": "jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json",
|
|
23
|
-
"test": "node test/
|
|
23
|
+
"test:wechat": "node test/wechat.js",
|
|
24
|
+
"test:wework": "node test/wework.js",
|
|
24
25
|
"release": "verpub publish",
|
|
25
26
|
"release:dry": "verpub --dry-run"
|
|
26
27
|
},
|
|
@@ -61,7 +62,16 @@ exports.packageJson = {
|
|
|
61
62
|
"eslint-config-prettier": "^6.11.0",
|
|
62
63
|
"eslint-plugin-prettier": "^3.1.4",
|
|
63
64
|
"npm-run-all": "^4.1.5",
|
|
64
|
-
"prettier": "^2.0.5"
|
|
65
|
+
"prettier": "^2.0.5",
|
|
66
|
+
"@juzi/wechaty": "^1.0.87",
|
|
67
|
+
"@grpc/grpc-js": "1.9.14",
|
|
68
|
+
"@juzi/wechaty-puppet": "^1.0.78",
|
|
69
|
+
"@juzi/wechaty-puppet-service": "^1.0.87",
|
|
70
|
+
"wechaty": "^1.20.2",
|
|
71
|
+
"wechaty-puppet-service": "^1.18.2",
|
|
72
|
+
"wechaty-puppet-wechat4u": "^1.14.12",
|
|
73
|
+
"wechaty-puppet-padlocal": "^1.20.1",
|
|
74
|
+
"wechaty-puppet": "^1.21.1"
|
|
65
75
|
},
|
|
66
76
|
"readme": "README.md",
|
|
67
77
|
"engines": {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const wechaty_1 = require("wechaty");
|
|
4
|
+
const index_js_1 = require("../src/index.js");
|
|
5
|
+
const name = 'wechat-assistant-pro';
|
|
6
|
+
let bot = '';
|
|
7
|
+
let padLocalToken = ''; // 如果申请了ipadlocal的token,可以直接填入
|
|
8
|
+
if (process.env['PAD_LOCAL_TOKEN']) {
|
|
9
|
+
console.log('读取到环境变量中的ipadLocalToken');
|
|
10
|
+
padLocalToken = process.env['PAD_LOCAL_TOKEN'];
|
|
11
|
+
}
|
|
12
|
+
if (padLocalToken) {
|
|
13
|
+
console.log('读取到环境变量中的ipad token 使用ipad协议启动');
|
|
14
|
+
bot = wechaty_1.WechatyBuilder.build({
|
|
15
|
+
name,
|
|
16
|
+
puppetOptions: {
|
|
17
|
+
token: padLocalToken
|
|
18
|
+
}, puppet: 'wechaty-puppet-padlocal',
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
console.log('默认使用wechat4u协议启动');
|
|
23
|
+
bot = wechaty_1.WechatyBuilder.build({
|
|
24
|
+
name,
|
|
25
|
+
puppet: 'wechaty-puppet-wechat4u',
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
bot.use((0, index_js_1.WechatyWebPanelPlugin)({
|
|
29
|
+
apiKey: '***', apiSecret: '***',
|
|
30
|
+
}));
|
|
31
|
+
bot.use((0, index_js_1.WechatyMessageRecordPlugin)());
|
|
32
|
+
bot.start()
|
|
33
|
+
.catch((e) => console.error(e));
|
|
34
|
+
//# sourceMappingURL=wechat.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const wechaty_1 = require("@juzi/wechaty");
|
|
4
|
+
const index_js_1 = require("../src/index.js");
|
|
5
|
+
const name = 'worker-assistant';
|
|
6
|
+
let bot = '';
|
|
7
|
+
let workProToken = ''; // 如果申请了企业微信的token 可以直接填入
|
|
8
|
+
if (process.env['WORK_PRO_TOKEN']) {
|
|
9
|
+
console.log('读取到环境变量中的企微token');
|
|
10
|
+
workProToken = process.env['WORK_PRO_TOKEN'];
|
|
11
|
+
}
|
|
12
|
+
bot = wechaty_1.WechatyBuilder.build({
|
|
13
|
+
name,
|
|
14
|
+
puppet: '@juzi/wechaty-puppet-service',
|
|
15
|
+
puppetOptions: {
|
|
16
|
+
authority: 'token-service-discovery-test.juzibot.com',
|
|
17
|
+
tls: { disable: true },
|
|
18
|
+
token: workProToken
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
bot.use((0, index_js_1.WechatyWebPanelPlugin)({
|
|
22
|
+
apiKey: '***', apiSecret: '***',
|
|
23
|
+
}));
|
|
24
|
+
bot.use((0, index_js_1.WechatyMessageRecordPlugin)());
|
|
25
|
+
bot.start()
|
|
26
|
+
.catch((e) => console.error(e));
|
|
27
|
+
//# sourceMappingURL=wework.js.map
|
|
@@ -14,7 +14,8 @@ export namespace packageJson {
|
|
|
14
14
|
clean: string;
|
|
15
15
|
dist: string;
|
|
16
16
|
"dist:commonjs": string;
|
|
17
|
-
test: string;
|
|
17
|
+
"test:wechat": string;
|
|
18
|
+
"test:wework": string;
|
|
18
19
|
release: string;
|
|
19
20
|
"release:dry": string;
|
|
20
21
|
};
|
|
@@ -41,6 +42,15 @@ export namespace packageJson {
|
|
|
41
42
|
"eslint-plugin-prettier": string;
|
|
42
43
|
"npm-run-all": string;
|
|
43
44
|
prettier: string;
|
|
45
|
+
"@juzi/wechaty": string;
|
|
46
|
+
"@grpc/grpc-js": string;
|
|
47
|
+
"@juzi/wechaty-puppet": string;
|
|
48
|
+
"@juzi/wechaty-puppet-service": string;
|
|
49
|
+
wechaty: string;
|
|
50
|
+
"wechaty-puppet-service": string;
|
|
51
|
+
"wechaty-puppet-wechat4u": string;
|
|
52
|
+
"wechaty-puppet-padlocal": string;
|
|
53
|
+
"wechaty-puppet": string;
|
|
44
54
|
};
|
|
45
55
|
const readme: string;
|
|
46
56
|
namespace engines {
|
|
@@ -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.57",
|
|
7
7
|
"description": "智能微秘书插件",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
@@ -17,7 +17,8 @@ export const packageJson = {
|
|
|
17
17
|
"clean": "shx rm -fr dist/*",
|
|
18
18
|
"dist": "npm-run-all clean build dist:commonjs",
|
|
19
19
|
"dist:commonjs": "jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json",
|
|
20
|
-
"test": "node test/
|
|
20
|
+
"test:wechat": "node test/wechat.js",
|
|
21
|
+
"test:wework": "node test/wework.js",
|
|
21
22
|
"release": "verpub publish",
|
|
22
23
|
"release:dry": "verpub --dry-run"
|
|
23
24
|
},
|
|
@@ -58,7 +59,16 @@ export const packageJson = {
|
|
|
58
59
|
"eslint-config-prettier": "^6.11.0",
|
|
59
60
|
"eslint-plugin-prettier": "^3.1.4",
|
|
60
61
|
"npm-run-all": "^4.1.5",
|
|
61
|
-
"prettier": "^2.0.5"
|
|
62
|
+
"prettier": "^2.0.5",
|
|
63
|
+
"@juzi/wechaty": "^1.0.87",
|
|
64
|
+
"@grpc/grpc-js": "1.9.14",
|
|
65
|
+
"@juzi/wechaty-puppet": "^1.0.78",
|
|
66
|
+
"@juzi/wechaty-puppet-service": "^1.0.87",
|
|
67
|
+
"wechaty": "^1.20.2",
|
|
68
|
+
"wechaty-puppet-service": "^1.18.2",
|
|
69
|
+
"wechaty-puppet-wechat4u": "^1.14.12",
|
|
70
|
+
"wechaty-puppet-padlocal": "^1.20.1",
|
|
71
|
+
"wechaty-puppet": "^1.21.1"
|
|
62
72
|
},
|
|
63
73
|
"readme": "README.md",
|
|
64
74
|
"engines": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRubbishType, getMingYan, getSweetWord, getStar, getNews, getXing, getSkl, getLunar, getGoldReply, getXhy, getRkl, getEmo, getCname } from '../proxy/api.js';
|
|
1
|
+
import { getRubbishType, getMingYan, getSweetWord, getStar, getNews, getXing, getSkl, getLunar, getGoldReply, getXhy, getRkl, getEmo, getCname, getResByTX } from '../proxy/api.js';
|
|
2
2
|
import { getConfig, getMeiNv, getWordCloudConfig, getCustomEvents } from '../proxy/aibotk.js';
|
|
3
3
|
import { getConstellation, msgArr, getNewsType } from '../lib/index.js';
|
|
4
4
|
import { initTaskLocalSchedule, initTimeSchedule, initMultiTask } from "../task/index.js";
|
|
@@ -149,7 +149,7 @@ async function dispatchAiBot(bot, msg, name, id) {
|
|
|
149
149
|
switch (bot) {
|
|
150
150
|
case 0:
|
|
151
151
|
// 天行机器人
|
|
152
|
-
res = await
|
|
152
|
+
res = await getResByTX(msg, id);
|
|
153
153
|
replys = [{ type: 1, content: res }];
|
|
154
154
|
break;
|
|
155
155
|
case 5:
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { WechatyBuilder } from 'wechaty';
|
|
2
|
+
import { WechatyWebPanelPlugin, WechatyMessageRecordPlugin } from '../src/index.js';
|
|
3
|
+
const name = 'wechat-assistant-pro';
|
|
4
|
+
let bot = '';
|
|
5
|
+
let padLocalToken = ''; // 如果申请了ipadlocal的token,可以直接填入
|
|
6
|
+
if (process.env['PAD_LOCAL_TOKEN']) {
|
|
7
|
+
console.log('读取到环境变量中的ipadLocalToken');
|
|
8
|
+
padLocalToken = process.env['PAD_LOCAL_TOKEN'];
|
|
9
|
+
}
|
|
10
|
+
if (padLocalToken) {
|
|
11
|
+
console.log('读取到环境变量中的ipad token 使用ipad协议启动');
|
|
12
|
+
bot = WechatyBuilder.build({
|
|
13
|
+
name,
|
|
14
|
+
puppetOptions: {
|
|
15
|
+
token: padLocalToken
|
|
16
|
+
}, puppet: 'wechaty-puppet-padlocal',
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
console.log('默认使用wechat4u协议启动');
|
|
21
|
+
bot = WechatyBuilder.build({
|
|
22
|
+
name,
|
|
23
|
+
puppet: 'wechaty-puppet-wechat4u',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
bot.use(WechatyWebPanelPlugin({
|
|
27
|
+
apiKey: '***', apiSecret: '***',
|
|
28
|
+
}));
|
|
29
|
+
bot.use(WechatyMessageRecordPlugin());
|
|
30
|
+
bot.start()
|
|
31
|
+
.catch((e) => console.error(e));
|
|
32
|
+
//# sourceMappingURL=wechat.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { WechatyBuilder } from '@juzi/wechaty';
|
|
2
|
+
import { WechatyWebPanelPlugin, WechatyMessageRecordPlugin } from '../src/index.js';
|
|
3
|
+
const name = 'worker-assistant';
|
|
4
|
+
let bot = '';
|
|
5
|
+
let workProToken = ''; // 如果申请了企业微信的token 可以直接填入
|
|
6
|
+
if (process.env['WORK_PRO_TOKEN']) {
|
|
7
|
+
console.log('读取到环境变量中的企微token');
|
|
8
|
+
workProToken = process.env['WORK_PRO_TOKEN'];
|
|
9
|
+
}
|
|
10
|
+
bot = WechatyBuilder.build({
|
|
11
|
+
name,
|
|
12
|
+
puppet: '@juzi/wechaty-puppet-service',
|
|
13
|
+
puppetOptions: {
|
|
14
|
+
authority: 'token-service-discovery-test.juzibot.com',
|
|
15
|
+
tls: { disable: true },
|
|
16
|
+
token: workProToken
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
bot.use(WechatyWebPanelPlugin({
|
|
20
|
+
apiKey: '***', apiSecret: '***',
|
|
21
|
+
}));
|
|
22
|
+
bot.use(WechatyMessageRecordPlugin());
|
|
23
|
+
bot.start()
|
|
24
|
+
.catch((e) => console.error(e));
|
|
25
|
+
//# sourceMappingURL=wework.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wechaty-web-panel",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.57",
|
|
4
4
|
"description": "智能微秘书插件",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"clean": "shx rm -fr dist/*",
|
|
15
15
|
"dist": "npm-run-all clean build dist:commonjs",
|
|
16
16
|
"dist:commonjs": "jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json",
|
|
17
|
-
"test": "node test/
|
|
17
|
+
"test:wechat": "node test/wechat.js",
|
|
18
|
+
"test:wework": "node test/wework.js",
|
|
18
19
|
"release": "verpub publish",
|
|
19
20
|
"release:dry": "verpub --dry-run"
|
|
20
21
|
},
|
|
@@ -55,7 +56,16 @@
|
|
|
55
56
|
"eslint-config-prettier": "^6.11.0",
|
|
56
57
|
"eslint-plugin-prettier": "^3.1.4",
|
|
57
58
|
"npm-run-all": "^4.1.5",
|
|
58
|
-
"prettier": "^2.0.5"
|
|
59
|
+
"prettier": "^2.0.5",
|
|
60
|
+
"@juzi/wechaty": "^1.0.87",
|
|
61
|
+
"@grpc/grpc-js": "1.9.14",
|
|
62
|
+
"@juzi/wechaty-puppet": "^1.0.78",
|
|
63
|
+
"@juzi/wechaty-puppet-service": "^1.0.87",
|
|
64
|
+
"wechaty": "^1.20.2",
|
|
65
|
+
"wechaty-puppet-service": "^1.18.2",
|
|
66
|
+
"wechaty-puppet-wechat4u": "^1.14.12",
|
|
67
|
+
"wechaty-puppet-padlocal": "^1.20.1",
|
|
68
|
+
"wechaty-puppet": "^1.21.1"
|
|
59
69
|
},
|
|
60
70
|
"readme": "README.md",
|
|
61
71
|
"engines": {
|
package/dist/cjs/test/index.d.ts
DELETED
package/dist/cjs/test/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const wechaty_1 = require("wechaty");
|
|
7
|
-
const index_js_1 = __importDefault(require("../src/index.js"));
|
|
8
|
-
const name = 'wechat-assistant';
|
|
9
|
-
const bot = wechaty_1.WechatyBuilder.build({
|
|
10
|
-
name,
|
|
11
|
-
puppet: 'wechaty-puppet-wechat',
|
|
12
|
-
puppetOptions: {
|
|
13
|
-
uos: true
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
bot
|
|
17
|
-
.use((0, index_js_1.default)({
|
|
18
|
-
apiKey: '',
|
|
19
|
-
apiSecret: ''
|
|
20
|
-
}));
|
|
21
|
-
bot.start()
|
|
22
|
-
.catch((e) => console.error(e));
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
package/dist/esm/test/index.d.ts
DELETED
package/dist/esm/test/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { WechatyBuilder } from 'wechaty';
|
|
2
|
-
import WechatyWebPanelPlugin from '../src/index.js';
|
|
3
|
-
const name = 'wechat-assistant';
|
|
4
|
-
const bot = WechatyBuilder.build({
|
|
5
|
-
name,
|
|
6
|
-
puppet: 'wechaty-puppet-wechat',
|
|
7
|
-
puppetOptions: {
|
|
8
|
-
uos: true
|
|
9
|
-
},
|
|
10
|
-
});
|
|
11
|
-
bot
|
|
12
|
-
.use(WechatyWebPanelPlugin({
|
|
13
|
-
apiKey: '',
|
|
14
|
-
apiSecret: ''
|
|
15
|
-
}));
|
|
16
|
-
bot.start()
|
|
17
|
-
.catch((e) => console.error(e));
|
|
18
|
-
//# sourceMappingURL=index.js.map
|