koishi-plugin-echoplus 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.
package/lib/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export declare const name = "echoplus";
3
3
  export interface Config {
4
4
  }
5
5
  export declare const Config: Schema<Config>;
6
+ export declare const Sleep: (ms: any) => Promise<unknown>;
6
7
  export declare function apply(ctx: Context, config: Config): void;
package/lib/index.js CHANGED
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
23
  Config: () => Config,
24
+ Sleep: () => Sleep,
24
25
  apply: () => apply,
25
26
  name: () => name
26
27
  });
@@ -28,10 +29,14 @@ module.exports = __toCommonJS(src_exports);
28
29
  var import_koishi = require("koishi");
29
30
  var name = "echoplus";
30
31
  var Config = import_koishi.Schema.object({});
32
+ var Sleep = /* @__PURE__ */ __name((ms) => {
33
+ return new Promise((resolve) => setTimeout(resolve, ms));
34
+ }, "Sleep");
31
35
  function apply(ctx, config) {
32
- ctx.command("echoplus <message>").action(({ session }, message) => {
36
+ ctx.command("echoplus <message>").action(async ({ session }, message) => {
33
37
  for (var i = message.length; i >= 1; i--) {
34
38
  session.send(message.substring(0, i));
39
+ await Sleep(200);
35
40
  }
36
41
  });
37
42
  }
@@ -39,6 +44,7 @@ __name(apply, "apply");
39
44
  // Annotate the CommonJS export names for ESM import in node:
40
45
  0 && (module.exports = {
41
46
  Config,
47
+ Sleep,
42
48
  apply,
43
49
  name
44
50
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-echoplus",
3
3
  "description": "Echo and repeat with a less letter until none.",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "contributors": [
6
6
  "MoreAmmonia <wangermazibilibili@126.com>"
7
7
  ],