@alemonjs/qq-bot 0.0.7 → 0.0.8

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/lib/index.js +3 -1
  2. package/package.json +4 -6
package/lib/index.js CHANGED
@@ -5,7 +5,9 @@ import { GROUP_AT_MESSAGE_CREATE, C2C_MESSAGE_CREATE, DIRECT_MESSAGE_CREATE, AT_
5
5
  const client = new Proxy({}, {
6
6
  get: (_, prop) => {
7
7
  if (prop in global.client) {
8
- return global.client[prop];
8
+ const original = global.client[prop];
9
+ // 防止函数内this丢失
10
+ return typeof original === 'function' ? original.bind(global.client) : original;
9
11
  }
10
12
  return undefined;
11
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alemonjs/qq-bot",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "qq-bot",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",
@@ -36,13 +36,11 @@
36
36
  ".": {
37
37
  "import": "./lib/index.js",
38
38
  "types": "./lib/index.d.ts"
39
- }
39
+ },
40
+ "./package": "./package.json"
40
41
  },
41
42
  "keywords": [
42
- "alemonjs",
43
- "qq-bot",
44
- "bot",
45
- "chat-bot"
43
+ "alemonjs"
46
44
  ],
47
45
  "publishConfig": {
48
46
  "registry": "https://registry.npmjs.org",