mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-04-19 08:04:50 +00:00
19 lines
579 B
TypeScript
19 lines
579 B
TypeScript
export default function saveState(client: any, guild: any, radio: any){
|
|
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);
|
|
}
|