alemonjs 1.0.1 → 1.0.2

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.
@@ -36,7 +36,7 @@ export function createApp(AppName) {
36
36
  return {
37
37
  /**
38
38
  * 设置指令json地址
39
- * @param rt = '/src'
39
+ * @param rt = '/public/defset'
40
40
  */
41
41
  setHelp: setAppsHelp,
42
42
  /**
@@ -25,7 +25,7 @@ const plugins = {};
25
25
  /**
26
26
  * 默认执行地址
27
27
  */
28
- const route = '/help';
28
+ const route = '/public/defset';
29
29
  /**
30
30
  * 执行文件
31
31
  */
@@ -36,7 +36,7 @@ let addressMenu = join(process.cwd(), route);
36
36
  let mergedRegex;
37
37
  /**
38
38
  * 设置指令json地址
39
- * @param rt '/help'
39
+ * @param rt '/public/defset'
40
40
  */
41
41
  export function setAppsHelp(rt = route) {
42
42
  addressMenu = join(process.cwd(), rt);
@@ -1,5 +1,5 @@
1
1
  /**
2
- *
2
+ *对话缓存
3
3
  */
4
4
  const Sockes = {};
5
5
  /**
@@ -1,3 +1,6 @@
1
+ /**
2
+ * 插件模板
3
+ */
1
4
  export class plugin {
2
5
  /**
3
6
  * 模块名
@@ -59,14 +59,18 @@ export function createStr(Options) {
59
59
  * 插件路径
60
60
  */
61
61
  const basePath = join(process.cwd(), appDir, AppName);
62
+ /**
63
+ * 数据路径
64
+ */
65
+ const dataPath = join(process.cwd(), '.data', AppName);
62
66
  /**
63
67
  * 写入地址
64
68
  */
65
- const AdressHtml = join(process.cwd(), 'data', AppName, basename(tplFile));
69
+ const AdressHtml = join(dataPath, basename(tplFile));
66
70
  /**
67
71
  * 确保写入目录存在
68
72
  */
69
- mkdirSync(join(process.cwd(), 'data', AppName), { recursive: true });
73
+ mkdirSync(dataPath, { recursive: true });
70
74
  /**
71
75
  * 判断初始模板是否改变
72
76
  */
@@ -80,6 +80,9 @@ export const EventEnum = [
80
80
  * 消息判断
81
81
  */
82
82
  export const EventType = ['CREATE', 'UPDATE', 'DELETE'];
83
+ /**
84
+ * 卡片枚举
85
+ */
83
86
  export const CacrdEnum = [
84
87
  /**
85
88
  * qq频道
@@ -96,11 +96,3 @@ export async function createBot(val = {
96
96
  export { getBotConfigByKey, setBotConfigByKey } from './login.js';
97
97
  // 设置独立鉴权路径
98
98
  export const setAuthenticationByNtqq = ClientAPIByQQ.setAuthentication;
99
- // 监听退出
100
- process.on('SIGINT', signals => {
101
- console.info(signals);
102
- if (process.pid) {
103
- process.exit();
104
- }
105
- return;
106
- });
package/lib/index.js CHANGED
@@ -2,11 +2,17 @@ if (process.argv.slice(2).includes('discord') &&
2
2
  !process.argv.slice(2).includes('not')) {
3
3
  process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
4
4
  }
5
- // 导出机器人
6
- export * from './main.js';
5
+ // 导出编译工具
6
+ export { compilationTools, integration } from 'alemon-rollup';
7
7
  // 导出核心方法
8
8
  export * from './alemon/index.js';
9
- /**
10
- * 编译
11
- */
12
- export { compilationTools, integration } from 'alemon-rollup';
9
+ // 导出机器人
10
+ export * from './bot.js';
11
+ // 监听退出
12
+ process.on('SIGINT', signals => {
13
+ console.info(signals);
14
+ if (process.pid) {
15
+ process.exit();
16
+ }
17
+ return;
18
+ });
package/lib/login.js CHANGED
@@ -1,3 +1,6 @@
1
+ /**
2
+ * bot-config
3
+ */
1
4
  const config = {
2
5
  redis: {
3
6
  host: '127.0.0.1',
package/lib/types.js CHANGED
@@ -1,3 +1,8 @@
1
+ /**
2
+ * *****
3
+ * ntqq
4
+ * ****
5
+ */
1
6
  export var NtQQEventsEnum;
2
7
  (function (NtQQEventsEnum) {
3
8
  NtQQEventsEnum["GROUP_AT_MESSAGE_CREATE"] = "GROUP_AT_MESSAGE_CREATE";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alemonjs",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "阿柠檬框架",
5
5
  "author": "ningmengchongshui",
6
6
  "main": "lib/index.js",
@@ -57,4 +57,4 @@
57
57
  "engines": {
58
58
  "node": ">=16.14.0"
59
59
  }
60
- }
60
+ }
@@ -19,7 +19,7 @@ export declare function getAppName(url: string | URL): string;
19
19
  export declare function createApp(AppName: string): {
20
20
  /**
21
21
  * 设置指令json地址
22
- * @param rt = '/src'
22
+ * @param rt = '/public/defset'
23
23
  */
24
24
  setHelp: typeof setAppsHelp;
25
25
  /**
@@ -1,7 +1,7 @@
1
1
  import { AMessage } from './typings.js';
2
2
  /**
3
3
  * 设置指令json地址
4
- * @param rt '/help'
4
+ * @param rt '/public/defset'
5
5
  */
6
6
  export declare function setAppsHelp(rt?: string): void;
7
7
  /**
@@ -1,4 +1,7 @@
1
1
  import { EventEnum, EventType } from './typings.js';
2
+ /**
3
+ * 插件类型
4
+ */
2
5
  export interface PluginInitType {
3
6
  event?: (typeof EventEnum)[number];
4
7
  eventType?: (typeof EventType)[number];
@@ -7,6 +10,9 @@ export interface PluginInitType {
7
10
  dsc?: string;
8
11
  rule?: PluginRuleType[];
9
12
  }
13
+ /**
14
+ * 插件类型
15
+ */
10
16
  export interface PluginRuleType {
11
17
  /**
12
18
  * 正则
@@ -29,6 +35,9 @@ export interface PluginRuleType {
29
35
  */
30
36
  priority?: number;
31
37
  }
38
+ /**
39
+ * 插件模板
40
+ */
32
41
  export declare class plugin {
33
42
  /**
34
43
  * 模块名
@@ -517,7 +517,13 @@ export interface MuteController {
517
517
  */
518
518
  muteMembers?: (...args: any[]) => any;
519
519
  }
520
+ /**
521
+ * 卡片枚举
522
+ */
520
523
  export declare const CacrdEnum: readonly ["qq_embed", "qq_ark", "kook_card"];
524
+ /**
525
+ * 卡片类型
526
+ */
521
527
  export interface CardType {
522
528
  type: (typeof CacrdEnum)[number];
523
529
  card: any;
package/types/index.d.ts CHANGED
@@ -1,6 +1,3 @@
1
- export * from './main.js';
2
- export * from './alemon/index.js';
3
- /**
4
- * 编译
5
- */
6
1
  export { compilationTools, integration } from 'alemon-rollup';
2
+ export * from './alemon/index.js';
3
+ export * from './bot.js';
package/types/types.d.ts CHANGED
@@ -1,11 +1,37 @@
1
1
  import { GatewayIntentBits } from 'discord.js';
2
2
  import { AvailableIntentsEventsEnum } from 'qq-guild-bot';
3
+ /**
4
+ * ****
5
+ * config
6
+ * /////
7
+ */
8
+ export interface ConfigType {
9
+ redis?: RedisConfig;
10
+ mysql?: MysqlConfig;
11
+ discord?: DiscordConfig;
12
+ kook?: KookConfig;
13
+ villa?: VillaConfig;
14
+ qq?: QQConfig;
15
+ server?: ServerConfig;
16
+ puppeteer?: PuppeteerConfig;
17
+ ntqq?: NtQQConfig;
18
+ }
19
+ /**
20
+ * ****
21
+ * redis
22
+ * *****
23
+ */
3
24
  export interface RedisConfig {
4
25
  host: string;
5
26
  port: number;
6
27
  password: string;
7
28
  db: number;
8
29
  }
30
+ /**
31
+ * ***
32
+ * mysql
33
+ * **
34
+ */
9
35
  export interface MysqlConfig {
10
36
  host: string;
11
37
  port: number;
@@ -13,17 +39,32 @@ export interface MysqlConfig {
13
39
  password: string;
14
40
  database: string;
15
41
  }
42
+ /**
43
+ * **
44
+ * discord
45
+ * **
46
+ */
16
47
  export interface DiscordConfig {
17
48
  token: string;
18
49
  masterID: string;
19
50
  password: string;
20
51
  intents: GatewayIntentBits[];
21
52
  }
53
+ /**
54
+ * ****
55
+ * kook
56
+ * ***
57
+ */
22
58
  export interface KookConfig {
23
59
  token: string;
24
60
  masterID: string;
25
61
  password: string;
26
62
  }
63
+ /**
64
+ * ****
65
+ * villa
66
+ * *****
67
+ */
27
68
  export interface VillaConfig {
28
69
  bot_id: string;
29
70
  secret: string;
@@ -37,6 +78,11 @@ export interface VillaConfig {
37
78
  img_url: string;
38
79
  IMAGE_DIR: string;
39
80
  }
81
+ /**
82
+ * *****
83
+ * ntqq
84
+ * ****
85
+ */
40
86
  export declare enum NtQQEventsEnum {
41
87
  GROUP_AT_MESSAGE_CREATE = "GROUP_AT_MESSAGE_CREATE",
42
88
  C2C_MESSAGE_CREATE = "C2C_MESSAGE_CREATE"
@@ -54,6 +100,11 @@ export interface NtQQConfig {
54
100
  IMAGE_DIR: string;
55
101
  http: string;
56
102
  }
103
+ /**
104
+ * ******
105
+ * qq
106
+ * *****
107
+ */
57
108
  export interface QQConfig {
58
109
  appID: string;
59
110
  token: string;
@@ -63,23 +114,22 @@ export interface QQConfig {
63
114
  isPrivate: boolean;
64
115
  sandbox: boolean;
65
116
  }
117
+ /**
118
+ * ******
119
+ * server
120
+ * *****
121
+ */
66
122
  export interface ServerConfig {
67
123
  host: string;
68
124
  port: number;
69
125
  }
126
+ /**
127
+ * ********
128
+ * pup
129
+ * *******
130
+ */
70
131
  export interface PuppeteerConfig {
71
132
  args: string[];
72
133
  headless: 'new';
73
134
  timeout: number;
74
135
  }
75
- export interface ConfigType {
76
- redis?: RedisConfig;
77
- mysql?: MysqlConfig;
78
- discord?: DiscordConfig;
79
- kook?: KookConfig;
80
- villa?: VillaConfig;
81
- qq?: QQConfig;
82
- server?: ServerConfig;
83
- puppeteer?: PuppeteerConfig;
84
- ntqq?: NtQQConfig;
85
- }
File without changes