mirror of
				https://github.com/warengroup/eximiabots-radiox.git
				synced 2025-11-04 11:29:33 +00:00 
			
		
		
		
	Added logger to play.js
This commit is contained in:
		@@ -140,10 +140,10 @@ function play(interaction, guild, client, url) {
 | 
				
			|||||||
    radio.audioPlayer.play(resource);
 | 
					    radio.audioPlayer.play(resource);
 | 
				
			||||||
    resource.playStream
 | 
					    resource.playStream
 | 
				
			||||||
        .on("readable", () => {
 | 
					        .on("readable", () => {
 | 
				
			||||||
            console.log("[Radio] Stream started" + " / " + guild.id + " / " + radio.station.name);
 | 
					            client.funcs.logger('Radio', 'Stream started' + " / " + guild.id + " / " + radio.station.name);
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        .on("finish", () => {
 | 
					        .on("finish", () => {
 | 
				
			||||||
            console.log("[Radio] Stream finished" + " / " + guild.id);
 | 
					            client.funcs.logger('Radio', 'Stream finished' + " / " + guild.id);
 | 
				
			||||||
            client.funcs.statisticsUpdate(client, guild, radio);
 | 
					            client.funcs.statisticsUpdate(client, guild, radio);
 | 
				
			||||||
            radio.connection?.destroy();
 | 
					            radio.connection?.destroy();
 | 
				
			||||||
            radio.audioPlayer?.stop();
 | 
					            radio.audioPlayer?.stop();
 | 
				
			||||||
@@ -151,7 +151,7 @@ function play(interaction, guild, client, url) {
 | 
				
			|||||||
            return;
 | 
					            return;
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        .on("error", error => {
 | 
					        .on("error", error => {
 | 
				
			||||||
            console.log("[Radio] Stream errored");
 | 
					            client.funcs.logger('Radio', 'Stream errored');
 | 
				
			||||||
            console.error(error);
 | 
					            console.error(error);
 | 
				
			||||||
            radio.connection?.destroy();
 | 
					            radio.connection?.destroy();
 | 
				
			||||||
            radio.audioPlayer?.stop();
 | 
					            radio.audioPlayer?.stop();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user