Streamlined restore method in Radio class with play command

This commit is contained in:
Christer Warén 2021-09-17 23:29:04 +03:00
parent 57aaf92947
commit 871cb475f9

View File

@ -65,18 +65,8 @@ module.exports = class Radio extends Map {
construct.connection = connection; construct.connection = connection;
let date = new Date(); let date = new Date();
construct.startTime = date.getTime(); construct.startTime = date.getTime();
client.funcs.play(client, null, guild, station);
client.datastore.checkEntry(guild.id); client.datastore.checkEntry(guild.id);
construct.datastore = client.datastore.getEntry(guild.id); client.funcs.play(client, null, guild, station);
if (!construct.datastore.statistics[construct.station.name]) {
construct.datastore.statistics[construct.station.name] = {};
construct.datastore.statistics[construct.station.name].time = 0;
construct.datastore.statistics[construct.station.name].used = 0;
client.datastore.updateEntry(guild, construct.datastore);
}
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }