mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-11-14 04:30:18 +00:00
Updated statistics command
This commit is contained in:
parent
933140502d
commit
b280981e1c
@ -9,6 +9,7 @@ module.exports = {
|
|||||||
let message = {};
|
let message = {};
|
||||||
let stations = client.stations;
|
let stations = client.stations;
|
||||||
let currentGuild = client.datastore.getEntry(interaction.guild.id);
|
let currentGuild = client.datastore.getEntry(interaction.guild.id);
|
||||||
|
let global = client.datastore.getEntry("global");
|
||||||
let statistics = "";
|
let statistics = "";
|
||||||
|
|
||||||
if(!client.stations) {
|
if(!client.stations) {
|
||||||
@ -21,9 +22,13 @@ module.exports = {
|
|||||||
} else {
|
} else {
|
||||||
Object.keys(stations).forEach(function(station) {
|
Object.keys(stations).forEach(function(station) {
|
||||||
if(currentGuild.statistics[stations[station].name] && currentGuild.statistics[stations[station].name].time && parseInt(currentGuild.statistics[stations[station].name].time) > 0 && currentGuild.statistics[stations[station].name].used && parseInt(currentGuild.statistics[stations[station].name].used) > 0){
|
if(currentGuild.statistics[stations[station].name] && currentGuild.statistics[stations[station].name].time && parseInt(currentGuild.statistics[stations[station].name].time) > 0 && currentGuild.statistics[stations[station].name].used && parseInt(currentGuild.statistics[stations[station].name].used) > 0){
|
||||||
statistics += `**${parseInt(station) + 1}** ` + stations[station].name + " \n";
|
statistics += `**${parseInt(station) + 1}. ` + stations[station].name + "** \n";
|
||||||
statistics += "Time: " + client.funcs.msToTime(currentGuild.statistics[stations[station].name].time) + "\n";
|
if(global && global.statistics[stations[station].name] && global.statistics[stations[station].name].time && parseInt(global.statistics[stations[station].name].time) > 0 && global.statistics[stations[station].name].used && parseInt(global.statistics[stations[station].name].used) > 0){
|
||||||
statistics += "Used: " + currentGuild.statistics[stations[station].name].used + "\n";
|
statistics += "Guild – Time: " + client.funcs.msToTime(currentGuild.statistics[stations[station].name].time) + " (" + ((currentGuild.statistics[stations[station].name].time / global.statistics[stations[station].name].time) * 100) + "%" + ")" + " / " + "Used: " + currentGuild.statistics[stations[station].name].used + " (" + ((currentGuild.statistics[stations[station].name].used / global.statistics[stations[station].name].used) * 100) + "%" + ")" + "\n";
|
||||||
|
statistics += "Global – Time: " + client.funcs.msToTime(global.statistics[stations[station].name].time) + " / " + "Used: " + global.statistics[stations[station].name].used + "\n\n";
|
||||||
|
} else {
|
||||||
|
statistics += "Time: " + client.funcs.msToTime(currentGuild.statistics[stations[station].name].time) + " / " + "Used: " + currentGuild.statistics[stations[station].name].used + "\n\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user