mm_cmd 1.1.1 → 1.1.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.
Files changed (2) hide show
  1. package/lib/manager.js +5 -4
  2. package/package.json +29 -29
package/lib/manager.js CHANGED
@@ -129,14 +129,14 @@ CmdManager.prototype._getCache = function () {
129
129
  * @returns {void}
130
130
  * @private
131
131
  */
132
- CmdManager.prototype._fullList = function () {
132
+ CmdManager.prototype._fullList = async function () {
133
133
  this.list_before = [];
134
134
  this.list_main = [];
135
135
  this.list_after = [];
136
136
  var infos = this.configs;
137
137
  for (var i = 0; i < infos.length; i++) {
138
138
  var info = infos[i];
139
- if (info.state !== 1) {
139
+ if (!info.state) {
140
140
  continue;
141
141
  }
142
142
  var mod = this.get(info.name);
@@ -162,7 +162,7 @@ CmdManager.prototype._fullList = function () {
162
162
  * @param {string} dir_path 目录路径
163
163
  */
164
164
  CmdManager.prototype.updateAfter = async function (dir_path) {
165
- this._fullList();
165
+ await this._fullList();
166
166
  };
167
167
 
168
168
  /**
@@ -209,7 +209,8 @@ CmdManager.prototype.runSub = async function (msg, db, tense) {
209
209
  var ret;
210
210
  for (var i = 0; i < list.length; i++) {
211
211
  var info = list[i];
212
- if (info.state !== 1) {
212
+ let is_running = await this.isRunning(info.name);
213
+ if (!is_running) {
213
214
  continue;
214
215
  }
215
216
  var mod = this.get(info.name);
package/package.json CHANGED
@@ -1,31 +1,31 @@
1
1
  {
2
- "name": "mm_cmd",
3
- "version": "1.1.1",
4
- "description": "指令框架,用于以聊天的方式操作程序,前端发送字符串,后端判断是否为指令并执行(基于 mm_corejs,内置管理器池,无全局/原型扩展依赖)",
5
- "main": "index.js",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://gitee.com/qiuwenwu91/mm_cmd.git"
9
- },
10
- "keywords": [
11
- "mm_mod",
12
- "mm_adapter",
13
- "mm_in_adapter",
14
- "cmd",
15
- "command",
16
- "chat",
17
- "指令管理器"
18
- ],
19
- "layer": "adapter",
20
- "group": "in_adapter",
21
- "author": "邱文武",
22
- "license": "ISC",
23
- "dependencies": {
24
- "mm_corejs": "^1.1.4",
25
- "mm_mod": "^1.0.1",
26
- "mm_matchs": "^1.1.10"
27
- },
28
- "scripts": {
29
- "test": "node test.js"
30
- }
2
+ "name": "mm_cmd",
3
+ "version": "1.1.2",
4
+ "description": "指令框架,用于以聊天的方式操作程序,前端发送字符串,后端判断是否为指令并执行(基于 mm_corejs,内置管理器池,无全局/原型扩展依赖)",
5
+ "main": "index.js",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://gitee.com/qiuwenwu91/mm_cmd.git"
9
+ },
10
+ "keywords": [
11
+ "mm_mod",
12
+ "mm_adapter",
13
+ "mm_in_adapter",
14
+ "cmd",
15
+ "command",
16
+ "chat",
17
+ "指令管理器"
18
+ ],
19
+ "layer": "infra",
20
+ "group": "in_adapter",
21
+ "author": "邱文武",
22
+ "license": "ISC",
23
+ "dependencies": {
24
+ "mm_corejs": "^1.1.4",
25
+ "mm_mod": "^1.0.1",
26
+ "mm_matchs": "^1.1.10"
27
+ },
28
+ "scripts": {
29
+ "test": "node test.js"
30
+ }
31
31
  }