cleaned up anagram.js, combined module exports.

This commit is contained in:
2019-03-18 06:23:27 +11:00
parent 7d11f13e30
commit 467dc136ff
22 changed files with 513 additions and 496 deletions

View File

@@ -1,25 +1,23 @@
exports.name = 'Stats for DAdmin'
exports.alias = ['stats']
exports.helptext = 'Metrics on DAdmin, uptime, users, servers'
exports.helphide = false
exports.permissions = ['READ_MESSAGES']
exports.category = 'general'
exports.command = (client, msg) => {
var users = 0;
for (var i = 0; i < client.guilds.array().length; i++){
users += client.guilds.array()[i].members.array().length;
}
msg.reply("Running DAdmin for " + millisecondsToStr(client.uptime) + " on " + client.guilds.array().length + " servers for " + users + " users, since 09 Aug 2018");
module.exports = {
name = 'Stats for DAdmin',
alias =['stats'],
helptext = 'Metrics on DAdmin, uptime, users, servers',
helphide = false,
permissions =['READ_MESSAGES'],
category = 'general',
command = (client, msg) => {
var users = 0;
for (var i = 0; i < client.guilds.array().length; i++) {
users += client.guilds.array()[i].members.array().length;
}
msg.reply("Running DAdmin for " + millisecondsToStr(client.uptime) + " on " + client.guilds.array().length + " servers for " + users + " users, since 09 Aug 2018");
}
}
function millisecondsToStr(milliseconds) {
function millisecondsToStr (milliseconds) {
// TIP: to find current time in milliseconds, use:
// var current_time_milliseconds = new Date().getTime();
function numberEnding (number) {
function numberEnding(number) {
return (number > 1) ? 's' : '';
}
@@ -47,4 +45,3 @@ function millisecondsToStr (milliseconds) {
}
return 'less than a second'; //'just now' //or other string you like;
}