mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 14:02:02 +00:00
bot debugs and minor bug fix
This commit is contained in:
parent
dc86086e72
commit
b6821dab42
2 changed files with 4 additions and 2 deletions
|
|
@ -28,8 +28,10 @@ Commands[ "echo" ] = {
|
||||||
fn: function( bot, params, message ) {
|
fn: function( bot, params, message ) {
|
||||||
|
|
||||||
bot.sendMessage( message, params.join( " " ), function( err, msg ) {
|
bot.sendMessage( message, params.join( " " ), function( err, msg ) {
|
||||||
if ( err )
|
if ( err ){
|
||||||
bot.sendMessage( message, "Unable to echo!" );
|
bot.sendMessage( message, "Unable to echo!" );
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
index.js
2
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 ) {
|
} else if ( _mentions === true || _mentions === "auto" || _mentions == null || _mentions == undefined ) {
|
||||||
//want to auto sort mentions
|
//want to auto sort mentions
|
||||||
_mentions = [];
|
_mentions = [];
|
||||||
var mentionsArray = message.match( /<[^>]*>/g ) || [];
|
var mentionsArray = message.match( /<@[^>]*>/g ) || [];
|
||||||
for ( mention of mentionsArray ) {
|
for ( mention of mentionsArray ) {
|
||||||
_mentions.push( mention.substring( 2, mention.length - 1 ) );
|
_mentions.push( mention.substring( 2, mention.length - 1 ) );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue