mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 21:43:33 +01:00
Minor bug fix when starting PMs
This commit is contained in:
@@ -211,6 +211,17 @@ Commands[ "remind" ] = {
|
||||
}
|
||||
}
|
||||
|
||||
Commands[ "annoy" ] = {
|
||||
oplevel: 0,
|
||||
fn: function( bot, params, message ) {
|
||||
|
||||
var user = getUser( message, params );
|
||||
|
||||
bot.sendMessage( user, "Ha I'm annoying you on " + message.author.mention() + "'s request!" );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Commands[ "activity" ] = {
|
||||
oplevel: 0,
|
||||
fn: function( bot, params, message ) {
|
||||
@@ -224,7 +235,8 @@ Commands[ "activity" ] = {
|
||||
bot.reply( message, "error gettings logs." );
|
||||
} else {
|
||||
|
||||
var activity = {}, count = 0;
|
||||
var activity = {},
|
||||
count = 0;
|
||||
for ( msg of logs.contents ) {
|
||||
|
||||
count = logs.length();
|
||||
@@ -242,7 +254,9 @@ Commands[ "activity" ] = {
|
||||
users[ id ] = message.channel.server.members.filter( "id", id, true );
|
||||
}
|
||||
|
||||
activity = Object.keys(activity).sort(function(a,b){return activity[a]-activity[b]});
|
||||
activity = Object.keys( activity ).sort( function( a, b ) {
|
||||
return activity[ a ] - activity[ b ]
|
||||
} );
|
||||
|
||||
for ( id in activity ) {
|
||||
report += id + " | " + activity[ id ] + " | **" + Math.round( ( activity[ id ] / count ) * 100 ) + "%**.\n";
|
||||
|
||||
Reference in New Issue
Block a user