@alemonjs/kook 2.1.9 → 2.1.10

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/dist/index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <link rel="icon" type="image/svg+xml" href="/favicon.ico" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>AlemonJS</title>
7
+ <title>ALemonJS</title>
8
8
  <script type="module" crossorigin src="/assets/index.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index.css">
10
10
  </head>
package/lib/index.js CHANGED
@@ -786,19 +786,21 @@ const main = () => {
786
786
  const params = data.payload?.params;
787
787
  try {
788
788
  const keys = key.split('.');
789
+ let parent = null;
789
790
  let target = client;
790
791
  for (const k of keys) {
791
792
  if (target === null || target === undefined || !(k in target)) {
792
793
  consume([createResult(ResultCode.Fail, '未知请求,请尝试升级版本', null)]);
793
794
  return;
794
795
  }
796
+ parent = target;
795
797
  target = target[k];
796
798
  }
797
799
  if (typeof target !== 'function') {
798
800
  consume([createResult(ResultCode.Fail, '目标不是可调用方法', null)]);
799
801
  return;
800
802
  }
801
- const res = await target(...params);
803
+ const res = await target.call(parent, ...params);
802
804
  consume([createResult(ResultCode.Ok, '请求完成', res)]);
803
805
  }
804
806
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alemonjs/kook",
3
- "version": "2.1.9",
3
+ "version": "2.1.10",
4
4
  "description": "kook platform connection",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",
@@ -59,5 +59,5 @@
59
59
  "type": "git",
60
60
  "url": "https://github.com/lemonade-lab/alemonjs.git"
61
61
  },
62
- "gitHead": "4b0115f3dfec34c18e27f57bf5c0f0164e28394a"
62
+ "gitHead": "fee3935ca19b1658ea4b41d5d3e7f281e7efc932"
63
63
  }