node-karin 0.11.2 → 0.11.4

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.
@@ -24,7 +24,7 @@ export function AdapterConvertKarin(data) {
24
24
  elements.push(segment.video(i.data.url || i.data.file));
25
25
  break;
26
26
  case 'at':
27
- elements.push(segment.at(i.data.qq, i.data.qq));
27
+ elements.push(segment.at(i.data.qq, i.data.qq, i.data.name));
28
28
  break;
29
29
  case 'poke':
30
30
  elements.push(segment.poke(Number(i.data.id), Number(i.data.type)));
@@ -81,7 +81,7 @@ export function KarinConvertAdapter(data, bot) {
81
81
  elements.push({ type, data: { id: i.id } });
82
82
  break;
83
83
  case "at" /* OB11SegmentType.At */:
84
- elements.push({ type, data: { qq: String(i.uid || i.uin) } });
84
+ elements.push({ type, data: { qq: String(i.uid || i.uin), name: i.name } });
85
85
  break;
86
86
  case "reply" /* OB11SegmentType.Reply */:
87
87
  elements.push({ type, data: { id: i.message_id } });
@@ -192,7 +192,7 @@ class PluginLoader {
192
192
  const list = [];
193
193
  const info = await common.getNpmPlugins(true);
194
194
  for (const { plugin, path: _path, file, isMain } of info) {
195
- if (!isMain) {
195
+ if (isMain) {
196
196
  const root = path.join(process.cwd(), 'node_modules', plugin, _path);
197
197
  this.loadMain(root, file, true);
198
198
  continue;
@@ -8,13 +8,13 @@ export class EventBaseHandler {
8
8
  /**
9
9
  * - 是否打印群消息日志
10
10
  */
11
- GroupMsgPrint = true;
11
+ GroupMsgPrint;
12
12
  /**
13
13
  * 处理事件,加入自定义字段
14
14
  */
15
15
  constructor(e) {
16
16
  this.e = e;
17
- this.GroupMsgPrint = false;
17
+ this.GroupMsgPrint = true;
18
18
  /** 加入e.bot */
19
19
  !this.e.bot && Object.defineProperty(this.e, 'bot', { value: listener.getBot(this.e.self_id) });
20
20
  if (this.e.group_id)
@@ -248,7 +248,7 @@ export class MessageHandler extends EventBaseHandler {
248
248
  res = await info.fn.call(app, this.e);
249
249
  }
250
250
  this.GroupMsgPrint && info.log(this.e.self_id, `${logFnc} ${lodash.truncate(this.e.msg, { length: 80 })} 处理完成 ${logger.green(Date.now() - start + 'ms')}`);
251
- if (res !== false)
251
+ if (res === false)
252
252
  continue;
253
253
  return;
254
254
  }
@@ -27,6 +27,7 @@ export class NoticeHandler extends EventBaseHandler {
27
27
  this.deal();
28
28
  }
29
29
  init() {
30
+ this.raw_message();
30
31
  /** 主人 */
31
32
  if (config.master.includes(String(this.e.user_id))) {
32
33
  this.e.isMaster = true;
@@ -55,7 +56,6 @@ export class NoticeHandler extends EventBaseHandler {
55
56
  else {
56
57
  logger.bot('info', this.e.self_id, `未知来源通知事件:${JSON.stringify(this.e)}`);
57
58
  }
58
- this.raw_message();
59
59
  this.reply();
60
60
  }
61
61
  /**
@@ -27,6 +27,7 @@ export class RequestHandler extends EventBaseHandler {
27
27
  this.deal();
28
28
  }
29
29
  init() {
30
+ this.raw_message();
30
31
  /** 主人 */
31
32
  if (config.master.includes(String(this.e.user_id))) {
32
33
  this.e.isMaster = true;
@@ -50,7 +51,6 @@ export class RequestHandler extends EventBaseHandler {
50
51
  else {
51
52
  logger.bot('info', this.e.self_id, `未知来源请求事件:${JSON.stringify(this.e)}`);
52
53
  }
53
- this.raw_message();
54
54
  this.reply();
55
55
  }
56
56
  /**
@@ -95,6 +95,7 @@ export interface AtSegment extends Segment {
95
95
  type: OB11SegmentType.At;
96
96
  data: {
97
97
  qq: string | 'all';
98
+ name?: string;
98
99
  };
99
100
  }
100
101
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-karin",
3
- "version": "0.11.2",
3
+ "version": "0.11.4",
4
4
  "private": false,
5
5
  "description": "基于 Kritor 进行开发的nodejs机器人框架",
6
6
  "homepage": "https://github.com/KarinJS/Karin",