koishi-plugin-suangua223 0.0.2 → 0.0.3

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 +4 -16
  2. package/package.json +4 -1
package/lib/index.js CHANGED
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
6
  var __export = (target, all) => {
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
 
30
20
  // src/index.ts
@@ -36,9 +26,8 @@ __export(src_exports, {
36
26
  });
37
27
  module.exports = __toCommonJS(src_exports);
38
28
  var import_koishi = require("koishi");
39
- var import_fs = __toESM(require("fs"));
40
- var imagePath = "./images/photo.png";
41
- var imageBuffer = import_fs.default.readFileSync(imagePath);
29
+ var import_url = require("url");
30
+ var import_path = require("path");
42
31
  var name = "suangua223";
43
32
  var Config = import_koishi.Schema.object({});
44
33
  function getRandomInt(min, max) {
@@ -46,10 +35,9 @@ function getRandomInt(min, max) {
46
35
  }
47
36
  __name(getRandomInt, "getRandomInt");
48
37
  function apply(ctx, config) {
49
- ctx.command("算卦").action(async ({ session }, ...args) => {
38
+ ctx.command("测试").action(async ({ session }, ...args) => {
50
39
  let random = getRandomInt(1, 64);
51
- await session.send("您的卦象为" + random);
52
- await session.send((0, import_koishi.h)("img", { src: imageBuffer }));
40
+ await session.send(import_koishi.h.image((0, import_url.pathToFileURL)((0, import_path.resolve)(__dirname, "./images/1.png")).href));
53
41
  });
54
42
  }
55
43
  __name(apply, "apply");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-suangua223",
3
3
  "description": "算卦插件",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -17,6 +17,9 @@
17
17
  "scripts": {
18
18
  "build": "tsc"
19
19
  },
20
+ "service": {
21
+ "required": []
22
+ },
20
23
  "peerDependencies": {
21
24
  "koishi": "^4.18.7"
22
25
  }