mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 23:43:17 +00:00
18 lines
569 B
JavaScript
18 lines
569 B
JavaScript
|
module.exports = function saveState(client, guild, radio){
|
||
|
client.datastore.checkEntry(guild.id);
|
||
|
|
||
|
let date = new Date();
|
||
|
|
||
|
let data = client.datastore.getEntry(guild.id);
|
||
|
|
||
|
data.state = {};
|
||
|
data.state.channels = {};
|
||
|
data.state.channels.text = radio.textChannel.id;
|
||
|
data.state.channels.voice = radio.voiceChannel.id;
|
||
|
data.state.date = date.toISOString();
|
||
|
data.state.station = {};
|
||
|
data.state.station.name = radio.station.name;
|
||
|
data.state.station.owner = radio.station.owner;
|
||
|
|
||
|
client.datastore.updateEntry(guild, data);
|
||
|
}
|