mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-01 15:43:38 +00:00
Fixed some errors
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
module.exports = function statisticsUpdate(client, currentState, radio) {
|
||||
module.exports = function statisticsUpdate(client, guild, radio) {
|
||||
|
||||
client.datastore.checkEntry(currentState.guild.id);
|
||||
client.datastore.checkEntry(guild.id);
|
||||
|
||||
radio.currentGuild = client.datastore.getEntry(currentState.guild.id);
|
||||
radio.currentGuild = client.datastore.getEntry(guild.id);
|
||||
|
||||
if(!radio.currentGuild.statistics[radio.station.name]){
|
||||
radio.currentGuild.statistics[radio.station.name] = {};
|
||||
radio.currentGuild.statistics[radio.station.name].time = 0;
|
||||
radio.currentGuild.statistics[radio.station.name].used = 0;
|
||||
client.datastore.updateEntry(currentState.guild, radio.currentGuild);
|
||||
client.datastore.updateEntry(guild, radio.currentGuild);
|
||||
}
|
||||
|
||||
if(!radio.connection.dispatcher){
|
||||
@ -21,6 +21,6 @@ module.exports = function statisticsUpdate(client, currentState, radio) {
|
||||
}
|
||||
|
||||
radio.currentGuild.statistics[radio.station.name].used = parseInt(radio.currentGuild.statistics[radio.station.name].used)+1;
|
||||
client.datastore.updateEntry(currentState.guild, radio.currentGuild);
|
||||
client.datastore.updateEntry(guild, radio.currentGuild);
|
||||
|
||||
}
|
Reference in New Issue
Block a user