mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-22 22:13:16 +00:00
Fixed statistics command when guild has empty statistics (part 2)
This commit is contained in:
parent
20d5d8b3bd
commit
94344bbecd
@ -11,7 +11,9 @@ module.exports = {
|
||||
let statistics;
|
||||
let i = 0;
|
||||
|
||||
if(currentGuild.statistics){
|
||||
if(!currentGuild || currentGuild && !currentGuild.statistics){
|
||||
statistics = "You have not listened any radio station";
|
||||
} else {
|
||||
Object.keys(client.stations).forEach(function(station) {
|
||||
if(currentGuild.statistics[stations[station].name]){
|
||||
if(i > 0){
|
||||
@ -28,10 +30,6 @@ module.exports = {
|
||||
});
|
||||
}
|
||||
|
||||
if(!statistics){
|
||||
statistics = "You have not listened any radio station";
|
||||
}
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setTitle(client.messages.statisticsTitle)
|
||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["list"].replace(/[^0-9]+/g, ''))
|
||||
|
Loading…
Reference in New Issue
Block a user