@alemonjs/discord 2.1.12 → 2.1.13

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
@@ -566,19 +566,21 @@ const main = () => {
566
566
  const params = data.payload?.params;
567
567
  try {
568
568
  const keys = key.split('.');
569
+ let parent = null;
569
570
  let target = client;
570
571
  for (const k of keys) {
571
572
  if (target === null || target === undefined || !(k in target)) {
572
573
  consume([createResult(ResultCode.Fail, '未知请求,请尝试升级版本', null)]);
573
574
  return;
574
575
  }
576
+ parent = target;
575
577
  target = target[k];
576
578
  }
577
579
  if (typeof target !== 'function') {
578
580
  consume([createResult(ResultCode.Fail, '目标不是可调用方法', null)]);
579
581
  return;
580
582
  }
581
- const res = await target(...params);
583
+ const res = await target.call(parent, ...params);
582
584
  consume([createResult(ResultCode.Ok, '请求完成', res)]);
583
585
  }
584
586
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alemonjs/discord",
3
- "version": "2.1.12",
3
+ "version": "2.1.13",
4
4
  "description": "discord platform connection",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",
@@ -65,5 +65,5 @@
65
65
  "type": "git",
66
66
  "url": "https://github.com/lemonade-lab/alemonjs.git"
67
67
  },
68
- "gitHead": "4b0115f3dfec34c18e27f57bf5c0f0164e28394a"
68
+ "gitHead": "fee3935ca19b1658ea4b41d5d3e7f281e7efc932"
69
69
  }