koishi-plugin-adapter-repl
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -6,4 +6,4 @@ /// <reference types="node" /> | ||
rl: import("readline/promises").Interface; | ||
start(): Promise<void>; | ||
start(bot: ReplBot): Promise<void>; | ||
stop(): Promise<void>; | ||
} |
@@ -6,14 +6,11 @@ "use strict"; | ||
class ReplAdapter extends koishi_1.Adapter.Server { | ||
constructor() { | ||
super(...arguments); | ||
this.rl = (0, promises_1.createInterface)({ | ||
input: process.stdin, | ||
// output: process.stdout, | ||
}); | ||
} | ||
async start() { | ||
rl = (0, promises_1.createInterface)({ | ||
input: process.stdin, | ||
// output: process.stdout, | ||
}); | ||
async start(bot) { | ||
process.stdout.write('> '); | ||
this.rl.on('line', (line) => { | ||
process.stdout.write('> '); | ||
const session = this.bots[0].session({ | ||
const session = bot.session({ | ||
type: 'message', | ||
@@ -31,3 +28,3 @@ subtype: 'private', | ||
}); | ||
this.bots[0].dispatch(session); | ||
bot.dispatch(session); | ||
}); | ||
@@ -34,0 +31,0 @@ } |
@@ -10,5 +10,7 @@ "use strict"; | ||
class ReplBot extends koishi_1.Bot { | ||
hidden = true; | ||
constructor(ctx, config) { | ||
super(ctx, config); | ||
this.hidden = true; | ||
this.platform = 'repl'; | ||
this.selfId = 'koishi'; | ||
ctx.plugin(adapter_1.default, this); | ||
@@ -15,0 +17,0 @@ } |
{ | ||
"name": "koishi-plugin-adapter-repl", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "REPL adapter for Koishi", | ||
@@ -47,3 +47,3 @@ "main": "lib/index.js", | ||
"esbuild-register": "^3.4.2", | ||
"koishi": "^4.14.0", | ||
"koishi": "^4.14.1", | ||
"typescript": "^5.1.6", | ||
@@ -53,4 +53,4 @@ "yml-register": "^1.1.0" | ||
"peerDependencies": { | ||
"koishi": "^4.14.0" | ||
"koishi": "^4.14.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
7554
125