From b6821dab4234efd0f0e1c8a043a0bcb432c66e8a Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Fri, 14 Aug 2015 20:56:25 +0100 Subject: [PATCH] bot debugs and minor bug fix --- hydrabot/commands.js | 4 +++- index.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hydrabot/commands.js b/hydrabot/commands.js index 3169a1afc..e66b170f9 100644 --- a/hydrabot/commands.js +++ b/hydrabot/commands.js @@ -28,8 +28,10 @@ Commands[ "echo" ] = { fn: function( bot, params, message ) { bot.sendMessage( message, params.join( " " ), function( err, msg ) { - if ( err ) + if ( err ){ bot.sendMessage( message, "Unable to echo!" ); + console.log(err); + } } ); } diff --git a/index.js b/index.js index c8238ed9c..2fd1a8454 100644 --- a/index.js +++ b/index.js @@ -437,7 +437,7 @@ exports.Client.prototype.sendMessage = function( channel, message, cb, _mentions } else if ( _mentions === true || _mentions === "auto" || _mentions == null || _mentions == undefined ) { //want to auto sort mentions _mentions = []; - var mentionsArray = message.match( /<[^>]*>/g ) || []; + var mentionsArray = message.match( /<@[^>]*>/g ) || []; for ( mention of mentionsArray ) { _mentions.push( mention.substring( 2, mention.length - 1 ) ); }