Added calculateGlobal function to datastore and if playlist doesnt exist then bot's status is dnd.

This commit is contained in:
Christer Warén
2020-04-04 06:53:17 +03:00
parent 76506e8c7c
commit ac6cdf9f2f
2 changed files with 47 additions and 1 deletions

View File

@ -23,7 +23,6 @@ module.exports = {
client.stations = await fetch('https://gitea.cwinfo.org/cwchristerw/radio/raw/branch/master/playlist.json')
.then(res => res.json());
} catch (err) {
client.stations = null;
console.error(err);
}
@ -32,6 +31,12 @@ module.exports = {
.then(res => res.json());
}, 3600000);
if(!client.stations) {
client.user.setStatus('dnd');
}
client.datastore.calculateGlobal(client);
require(`../emojis.js`).execute(client);
}
}