@karinjs/adapter-qqbot 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.
package/README.md CHANGED
@@ -3,6 +3,11 @@
3
3
  开发中...
4
4
 
5
5
  如需使用:
6
+
7
+ ```bash
8
+ pnpm add @karinjs/adapter-qqbot -w
9
+ ```
10
+
6
11
  在`config\plugin\@karinjs\adapter-qqbot`创建`config.yaml`
7
12
  输入以下内容,请自行配置账号。当前`Markdown`仅支持`旧图文模板`和`原生`
8
13
 
@@ -1,5 +1,5 @@
1
1
  /** 插件包绝对路径 */
2
2
  declare const dirPath: string;
3
3
  /** 插件包的名称 */
4
- declare const basename: string;
4
+ declare const basename: any;
5
5
  export { dirPath, basename };
package/lib/utils/dir.js CHANGED
@@ -1,3 +1,4 @@
1
+ import fs from 'fs';
1
2
  import path from 'path';
2
3
  import { fileURLToPath } from 'url';
3
4
  /** 当前文件的绝对路径 */
@@ -5,5 +6,5 @@ const filePath = fileURLToPath(import.meta.url).replace(/\\/g, '/');
5
6
  /** 插件包绝对路径 */
6
7
  const dirPath = path.resolve(filePath, '../../../');
7
8
  /** 插件包的名称 */
8
- const basename = path.basename(dirPath);
9
+ const basename = JSON.parse(fs.readFileSync(`${dirPath}/package.json`, 'utf-8')).name;
9
10
  export { dirPath, basename };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karinjs/adapter-qqbot",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "author": "shijin",
5
5
  "type": "module",
6
6
  "description": "karin plugin template",