create-alemonjs 0.0.5 → 0.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-alemonjs",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "alemonjs dev template",
5
5
  "author": "ningmengchongshui",
6
6
  "main": "bin/index.js",
@@ -5,7 +5,7 @@
5
5
  # 具体见 pm2.config.cjs
6
6
  pm2:
7
7
  apps:
8
- - name: 'gui'
9
- script: 'node index.js --login gui'
8
+ - name: 'qq-bot'
9
+ script: 'node index.js --login qq-bot'
10
10
  env:
11
11
  NODE_ENV: 'production'
@@ -25,7 +25,7 @@
25
25
  "@alemonjs/discord": "^2.1.7",
26
26
  "@alemonjs/onebot": "^2.1.4",
27
27
  "@alemonjs/qq-bot": "^2.1.4",
28
- "alemonjs": "2.1.38",
28
+ "alemonjs": "2.1.42",
29
29
  "jsxp": "1.2.4",
30
30
  "tailwindcss": "3",
31
31
  "cssnano": "^7",
@@ -1,14 +1,20 @@
1
1
  const fs = require('fs');
2
2
  const yaml = require('yaml');
3
3
 
4
- // Read and parse the YAML configuration file
5
- const data = fs.readFileSync('./alemon.config.yaml', 'utf8');
6
- const config = yaml.parse(data);
7
-
8
- // Extracting PM2 configuration
9
- const pm2 = config?.pm2 ?? {};
4
+ let pm2 = null;
5
+ try {
6
+ // Read and parse the YAML configuration file
7
+ const data = fs.readFileSync('./alemon.config.yaml', 'utf8');
8
+ const config = yaml.parse(data);
9
+ pm2 = config?.pm2 ?? {};
10
+ }
11
+ catch (error) {
12
+ console.error('Error parsing YAML configuration:', error);
13
+ }
10
14
 
11
15
  /**
12
16
  * @type {{ apps: import("pm2").StartOptions[] }}
13
17
  */
14
- module.exports = pm2;
18
+ module.exports = pm2 || {
19
+ apps: []
20
+ }
@@ -16,7 +16,7 @@ export default async e => {
16
16
  const userRes = await mention.findOne();
17
17
  if (!userRes.count || !userRes.data) {
18
18
  // 没有找到用户
19
-
19
+ console.log('没有找到@用户');
20
20
  return;
21
21
  }
22
22
  const user = userRes.data;