Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding colors as dep and adding colors in the output.

  • Loading branch information...
commit ffb8876aafc59366586ef94be090b89a94da6e01 1 parent 4fe4287
@vesln authored
Showing with 6 additions and 6 deletions.
  1. +5 −4 bin/bot
  2. +1 −2  package.json
View
9 bin/bot
@@ -11,6 +11,7 @@
* Module dependencies.
*/
var readline = require('readline');
+var colors = require('colors');
/**
* Bot class.
@@ -45,14 +46,14 @@ var bot = new Bot(new Db, defaults);
*
* @type {String}
*/
-var nick = 'Bot: ';
+var nick = 'Bot: '.cyan;
/**
* Your nickname.
*
* @type {String}
*/
-var you = 'You: ';
+var you = 'You: '.magenta;
/**
* Exit cmd.
@@ -72,7 +73,7 @@ var rl = readline.createInterface(process.stdin, process.stdout)
rl.on('line', function(line) {
if (line.trim() === 'exit') return rl.emit('close');
console.log(nick + bot.answer(line));
- rl.setPrompt(you, you.length);
+ rl.setPrompt(you, you.length - 10);
rl.prompt();
});
@@ -84,5 +85,5 @@ rl.on('close', function() {
// Greeting.
console.log(nick + 'Good to see you here, dude. Let\'s talk.');
-rl.setPrompt(you, you.length);
+rl.setPrompt(you, you.length - 10);
rl.prompt();
View
3  package.json
@@ -6,12 +6,11 @@
, "keywords": ["bot", "chat bot"]
, "author": "Veselin Todorov <hi@vesln.com>"
, "dependencies": {
- "flatiron": "~0.1.7"
+ "colors": "0.6.0-1"
}
, "devDependencies": {
"mocha": "0.3.3"
, "should": "0.3.2"
- , "sinon": "1.3.1"
}
, "repository" : {
"type" : "git"
Please sign in to comment.
Something went wrong with that request. Please try again.