Skip to content

Commit

Permalink
Adding colors as dep and adding colors in the output.
Browse files Browse the repository at this point in the history
  • Loading branch information
vesln committed Jan 21, 2012
1 parent 4fe4287 commit ffb8876
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 5 additions & 4 deletions bin/bot
Expand Up @@ -11,6 +11,7 @@
* Module dependencies.
*/
var readline = require('readline');
var colors = require('colors');

/**
* Bot class.
Expand Down Expand Up @@ -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.
Expand All @@ -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();
});

Expand All @@ -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();
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -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"
Expand Down

0 comments on commit ffb8876

Please sign in to comment.