Merge pull request #75 from warengroup/develop

Version 0.3.11
This commit is contained in:
Christer Warén 2021-09-18 15:24:36 +03:00 committed by GitHub
commit 3db736d3f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 12 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "eximiabots-radiox",
"version": "0.3.10",
"version": "0.3.11",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "eximiabots-radiox",
"version": "0.3.10",
"version": "0.3.11",
"license": "MIT",
"dependencies": {
"@discordjs/builders": "^0.6.0",

View File

@ -1,6 +1,6 @@
{
"name": "eximiabots-radiox",
"version": "0.3.10",
"version": "0.3.11",
"description": "Internet Radio to your Discord guild",
"main": "index.js",
"scripts": {

View File

@ -48,8 +48,11 @@ module.exports = class {
}
loadEntry(id){
const json = require(`../../../datastore/` + id + '.json');
this.map.set(id, json);
try {
const json = require(`../../../datastore/` + id + '.json');
this.map.set(id, json);
} catch (error) {
}
}
getEntry(id){

View File

@ -40,8 +40,9 @@ module.exports = class {
let streamers = this.map.keys();
streamers.forEach(streamer => {
if(client.stations.findIndex(station => station.name == streamer)) return;
this.stop(streamer);
if(client.stations.findIndex(station => station.name == streamer) == -1){
this.stop(streamer);
}
});
}
@ -73,15 +74,12 @@ module.exports = class {
this.play(station);
});
audioPlayer
.on('playing', () => {
this.logger('Streamer', station.name + " / " + "Playing");
})
.on('idle', () => {
this.logger('Streamer', station.name + " / " + "Idle");
this.play(station);
})
.on('paused', () => {
this.logger('Streamer', station.name + " / " + "Paused");

View File

@ -155,7 +155,7 @@ module.exports = {
client.config.maintenanceMode = true;
client.user.setStatus('idle');
client.funcs.saveRadios(client);
client.radio.save(client);
setInterval(() => {
if(client.radio.size == 0 && client.config.streamerMode == "manual" && client.config.maintenanceMode){
@ -179,7 +179,7 @@ module.exports = {
client.config.maintenanceMode = true;
client.user.setStatus('idle');
client.funcs.save(client);
client.radio.save(client);
setInterval(() => {
if(client.radio.size == 0 && client.config.streamerMode == "auto" && client.config.maintenanceMode){