/**
 * khan.js
 *
 * !khan
 * Makes the bot say KHAAAAAAAAAAAAN.
 */
var bot = require( '..' );
var khan = require( 'khaan' );

bot.addListener( 'message', function ( nick, to, text ) {
	if ( text.substr( 0, 5 ) === '!khan' ) {
		var args = text.split( ' ' );
		var word = args[1] ? args[1] : 'khan';
		var a = bot.config.khan || 434;
		var number = Math.floor(Math.random() * a) + 1;
		bot.say( to, khan.khan( word, number ) );
	}
} );

@@ -227,19 +227,20 @@
 %7B%0A%09%09var 
-arg
+word
 s = text
@@ -260,145 +260,278 @@
 ;%0A%09%09
-var word = args%5B1%5D ? args%5B1%5D : 'khan';%0A%09%09var a = bot.config.khan %7C%7C 434;%0A%09%09var number = Math.floor(Math.random() * a) + 1;%0A%09%09bot.say( to,
+words.shift();%0A%09%09if ( typeof words%5B0%5D === 'undefined' ) %7B%0A%09%09%09words = %5B 'khan' %5D;%0A%09%09%7D%0A%09%09var a = bot.config.khan %7C%7C 434;%0A%09%09console.log( words );%0A%09%09a = a / words.length;%0A%09%09var number = Math.floor(Math.random() * a) + 1;%0A%09%09words = words.map( function ( current ) %7B%0A%09%09%09return
  kha
@@ -542,20 +542,23 @@
 an( 
-word
+current
 , number
  ) )
@@ -553,16 +553,56 @@
 , number
+);%0A%09%09%7D );%0A%09%09bot.say( to, words.join( ' '
  ) );%0A%09%7D

allow arbitrary number of args in khan