mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-11-10 03:40:19 +00:00
commit
3db736d3f3
4
package-lock.json
generated
4
package-lock.json
generated
@ -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",
|
||||
|
@ -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": {
|
||||
|
@ -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){
|
||||
|
@ -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");
|
||||
|
@ -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){
|
||||
|
Loading…
Reference in New Issue
Block a user