node-karin 0.3.4 → 0.3.5

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.
@@ -94,8 +94,8 @@ export declare const listener: {
94
94
  * @param options.retry_count - 重试次数
95
95
  */
96
96
  sendMsg(uid: string, contact: contact, elements: KarinElement, options?: {
97
- recallMsg: number;
98
- retry_count: number;
97
+ recallMsg?: number;
98
+ retry_count?: number;
99
99
  }): Promise<{
100
100
  message_id: string;
101
101
  }>;
@@ -178,7 +178,7 @@ export const listener = new (class Listeners extends EventEmitter {
178
178
  logger.bot('error', self_id, error)
179
179
  }
180
180
  /** 快速撤回 */
181
- if (bot.RecallMessage && recallMsg > 0 && result?.message_id) {
181
+ if (recallMsg && bot.RecallMessage && recallMsg > 0 && result?.message_id) {
182
182
  setTimeout(() => bot.RecallMessage(contact, result.message_id), recallMsg * 1000)
183
183
  }
184
184
  return result
package/lib/index.d.ts CHANGED
@@ -25,7 +25,7 @@ export declare const Renderer: {
25
25
  }): number;
26
26
  unapp(index: number): boolean;
27
27
  App(id?: string): import("./types/index.js").KarinRenderApp;
28
- render(options: import("./types/index.js").KarinRenderType, id: string): Promise<string | string[]>;
28
+ render(options: import("./types/index.js").KarinRenderType, id?: string | undefined): Promise<string | string[]>;
29
29
  renderHtml(data: string): Promise<string | string[]>;
30
30
  };
31
31
  export declare const Cfg: {
@@ -92,8 +92,8 @@ export declare const Bot: {
92
92
  path: string;
93
93
  }[] | (new () => import("./types/index.js").KarinAdapter)[];
94
94
  sendMsg(uid: string, contact: import("./types/index.js").contact, elements: import("./types/index.js").KarinElement, options?: {
95
- recallMsg: number;
96
- retry_count: number;
95
+ recallMsg?: number | undefined;
96
+ retry_count?: number | undefined;
97
97
  }): Promise<{
98
98
  message_id: string;
99
99
  }>;
@@ -31,7 +31,7 @@ declare class Renderer {
31
31
  /**
32
32
  * 调用标准渲染器
33
33
  */
34
- render(options: KarinRenderType, id: string): Promise<string | string[]>;
34
+ render(options: KarinRenderType, id?: string): Promise<string | string[]>;
35
35
  /**
36
36
  * 快速渲染
37
37
  * @param data html路径、http地址
package/modules.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import ws from 'ws';
4
+ import moment from 'moment';
5
+ import lodash from 'lodash';
6
+ import express from 'express';
7
+ import axios from 'axios';
8
+ import chalk from 'chalk';
9
+ import chokidar from 'chokidar';
10
+ import { Level as level } from 'level';
11
+ import schedule from 'node-schedule';
12
+ import yaml from 'yaml';
13
+ import log4js from 'log4js';
14
+ export { fs, ws, path, axios, lodash, moment, express, chalk, chokidar, level, schedule, yaml, log4js, };
package/modules.js ADDED
@@ -0,0 +1,14 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import ws from 'ws';
4
+ import moment from 'moment';
5
+ import lodash from 'lodash';
6
+ import express from 'express';
7
+ import axios from 'axios';
8
+ import chalk from 'chalk';
9
+ import chokidar from 'chokidar';
10
+ import { Level as level } from 'level';
11
+ import schedule from 'node-schedule';
12
+ import yaml from 'yaml';
13
+ import log4js from 'log4js';
14
+ export { fs, ws, path, axios, lodash, moment, express, chalk, chokidar, level, schedule, yaml, log4js, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-karin",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "private": false,
5
5
  "description": "基于 Kritor 进行开发的nodejs机器人框架",
6
6
  "homepage": "https://github.com/KarinJS/Karin",
@@ -26,6 +26,8 @@
26
26
  "/lib/**/*.d.ts",
27
27
  "/config/defSet/*.yaml",
28
28
  "/config/view/*.yaml",
29
+ "modules.js",
30
+ "modules.d.ts",
29
31
  "LICENSE",
30
32
  "package.json",
31
33
  "README.md"
@@ -35,7 +37,8 @@
35
37
  ],
36
38
  "scripts": {
37
39
  "app": "node .",
38
- "build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json && npm run fix",
40
+ "build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json && npm run fix && npm run cp",
41
+ "cp": "cp ./lib/modules.d.ts ./modules.d.ts && cp ./lib/modules.js ./modules.js",
39
42
  "delete": "pm2 delete ./config/config/pm2.yaml",
40
43
  "fix": "eslint lib/**/*.js --fix",
41
44
  "fix:all": "eslint lib/**/*.js --fix && eslint src/**/*.ts --fix",