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 +1 -0
- package/lib/index.js +7 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
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
|
});
|