started documenting

This commit is contained in:
hydrabolt
2015-08-16 17:48:55 +01:00
parent 9422a56d4e
commit 4773df9fc8
4 changed files with 280 additions and 45 deletions

View File

@@ -379,18 +379,13 @@ Commands[ "activity" ] = {
var report = "here's a list of activity over the last " + count + " messages :\n\n";
var users = {};
for ( id in activity ) {
users[ id ] = message.channel.server.members.filter( "id", id, true );
var usernames = {};
for( id in activity ){
usernames[id] = bot.getUser(id).username;
}
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";
report += usernames[id] + " | " + activity[ id ] + " | **" + Math.round( ( activity[ id ] / count ) * 100 ) + "%**.\n";
}
bot.reply( message, report, false, false );