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", "name": "eximiabots-radiox",
"version": "0.3.10", "version": "0.3.11",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "eximiabots-radiox", "name": "eximiabots-radiox",
"version": "0.3.10", "version": "0.3.11",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@discordjs/builders": "^0.6.0", "@discordjs/builders": "^0.6.0",

View File

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

View File

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

View File

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

View File

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