@alemonjs/discord 0.0.2 → 0.0.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.
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # [https://alemonjs.com/](https://alemonjs.com/)
2
+
3
+ 跨平台开发的事件驱动机器人
4
+
5
+ ## USE
6
+
7
+ - discord
8
+
9
+ ```sh
10
+ yarn add @alemonjs/discord
11
+ ```
12
+
13
+ - alemon.config.yaml
14
+
15
+ ```sh
16
+ discord:
17
+ # 令牌
18
+ token: ''
19
+ # 主人
20
+ master_id: null
21
+ # 前缀(非必填)
22
+ intent: null
23
+ # 活动 非必填)
24
+ shard: null
25
+ ```
26
+
27
+ ## Community
28
+
29
+ QQ Group 806943302
package/lib/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { ConfigType } from 'alemonjs';
2
-
3
- declare const _default: (_: ConfigType) => typeof global.alemonjs;
1
+ declare const _default: () => typeof global.alemonjs;
4
2
 
5
3
  export { _default as default };
package/lib/index.js CHANGED
@@ -1,7 +1,11 @@
1
- import { defineBot, Text, At, OnProcessor, useParse } from 'alemonjs';
1
+ import { defineBot, getConfig, Text, At, OnProcessor, useParse } from 'alemonjs';
2
2
  import { DCClient } from 'chat-space';
3
3
 
4
- var index = defineBot((config) => {
4
+ var index = defineBot(() => {
5
+ const cfg = getConfig();
6
+ const config = cfg.value?.discord;
7
+ if (!config)
8
+ return;
5
9
  // 创建客户端
6
10
  const client = new DCClient({
7
11
  token: config.token
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@alemonjs/discord",
3
- "version": "0.0.2",
4
- "description": "啊柠檬脚本",
5
- "author": "ningmengchongshui",
3
+ "version": "0.0.4",
4
+ "description": "discord-bot",
5
+ "author": "lemonade",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "main": "lib/index.js",
9
9
  "dependencies": {
10
- "chat-space": "^0.0.3"
10
+ "chat-space": "^0.0.6"
11
11
  },
12
12
  "types": "lib",
13
13
  "exports": {
@@ -16,8 +16,18 @@
16
16
  "types": "./lib/index.d.ts"
17
17
  }
18
18
  },
19
+ "keywords": [
20
+ "alemonjs",
21
+ "discord",
22
+ "bot",
23
+ "chat-bot"
24
+ ],
19
25
  "publishConfig": {
20
- "access": "public",
21
26
  "registry": "https://registry.npmjs.org"
27
+ },
28
+ "bugs": "https://github.com/ningmengchongshui/alemonjs/issues",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/ningmengchongshui/alemonjs.git"
22
32
  }
23
33
  }