/*
 * @package AJAX_Chat
 * @author Sebastian Tschan
 * @copyright (c) Sebastian Tschan
 * @license GNU Affero General Public License
 * @link https://blueimp.net/ajax/
 */

// Overriding client side functionality:

/*
// Example - Overriding the replaceCustomCommands method:
ajaxChat.replaceCustomCommands = function(text, textParts) {
   switch(textParts[0]) {
      case '/myip':
         return '<span class="chatBotMessage">' + this.lang['myip'].replace(/%s/, textParts[1]) + '</span>';
      case '/earnings':
         return '<span class="chatBotMessage">' + this.lang['myip'].replace(/%s/, textParts[1]) + '</span>';
      default:
         return text;
   }
}
 */
 
 ajaxChat.replaceCustomText = function(text) {
    text=text.replace(/fuck/gi, '****');
    return text;
}
 
 ajaxChat.replaceCustomCommands = function(text, textParts) {
	switch(textParts[0]) {
		case '/chatbot':
		text=text.replace('/chatbot', ' ');
		return '<span class="chatBotMessage">' + text + '</span>';		
		
		case '/chatboterror':
		text=text.replace('/chatboterror', ' ');
		return '<span class="chatBotMessage"><font color="red">Error: ' + text + '</font></span>';
		
	
		
		default:
		return text;
	}
	
	
}
