koishi-plugin-qq-full-message 1.0.2 → 1.0.3

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/index.js +4 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -49,9 +49,12 @@ function collectFromConfig(node, out) {
49
49
  }
50
50
 
51
51
  // 拿到 loader 服务(只有通过 koishi 配置文件启动时才存在)。
52
+ // 只用 ctx.get():直接读 ctx.loader 在该服务没注册时会打
53
+ // "property loader is not registered" 的错误日志。
52
54
  function getLoader(ctx) {
53
55
  try {
54
- return ctx.get('loader') || ctx.loader
56
+ if (typeof ctx.get === 'function') return ctx.get('loader')
57
+ return ctx.loader
55
58
  } catch {
56
59
  return
57
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-qq-full-message",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "接管 QQ 官方机器人的群全量消息,只注入给选定插件。",
5
5
  "main": "index.js",
6
6
  "files": [