-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChatView.js
More file actions
28 lines (21 loc) · 931 Bytes
/
ChatView.js
File metadata and controls
28 lines (21 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module.exports = {
start: start
}
function start(options, api) {
let threadListener = require('./ThreadListener.js')
threadListener.start(process.argv, api);
threadListener.on("ready", function(threadId, threadInfo) {
process.stdout.write("\x1Bc");
console.log(`Chatting with ${threadInfo[threadId].threadName}`);
process.stdout.write("\033[" + process.stdout.rows + "B");
const promptFixed = require("./Readline.js");
promptFixed.start();
promptFixed.on("line", function (line) {
api.sendMessage(line, threadListener.getCurrentThread());
// process.stdout.write("\033[" + process.stdout.rows + "A");
// console.log(`Chatting with ${threadInfo[threadId].threadName}`);
// process.stdout.write("\033[" + process.stdout.rows + "B");
process.stdout.write("\033[1A")
});
});
}