hubot 11.1.9 → 11.2.0
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/package.json +1 -1
- package/src/adapters/Shell.mjs +8 -3
package/package.json
CHANGED
package/src/adapters/Shell.mjs
CHANGED
|
@@ -51,9 +51,10 @@ class Shell extends Adapter {
|
|
|
51
51
|
if (stats.size > historySize) {
|
|
52
52
|
fs.unlinkSync(historyPath)
|
|
53
53
|
}
|
|
54
|
+
|
|
54
55
|
this.#rl = readline.createInterface({
|
|
55
|
-
input: process.stdin,
|
|
56
|
-
output: process.stdout,
|
|
56
|
+
input: this.robot.stdin ?? process.stdin,
|
|
57
|
+
output: this.robot.stdout ?? process.stdout,
|
|
57
58
|
prompt: `${this.robot.name ?? this.robot.alias}> `,
|
|
58
59
|
completer
|
|
59
60
|
})
|
|
@@ -84,7 +85,11 @@ class Shell extends Adapter {
|
|
|
84
85
|
}
|
|
85
86
|
const userName = process.env.HUBOT_SHELL_USER_NAME || 'Shell'
|
|
86
87
|
const user = this.robot.brain.userForId(userId, { name: userName, room: 'Shell' })
|
|
87
|
-
|
|
88
|
+
const message = new TextMessage(user, input, 'messageId')
|
|
89
|
+
if (!message.text.startsWith(this.robot.name) && !message.text.startsWith(this.robot.alias)) {
|
|
90
|
+
message.text = `${this.robot.name} ${message.text}`
|
|
91
|
+
}
|
|
92
|
+
await this.receive(message)
|
|
88
93
|
this.#rl.prompt()
|
|
89
94
|
})
|
|
90
95
|
this.#rl.on('history', async (history) => {
|