mirror of
				https://github.com/warengroup/eximiabots-radiox.git
				synced 2025-11-04 06:49:32 +00:00 
			
		
		
		
	update
This commit is contained in:
		@@ -15,7 +15,6 @@ module.exports = {
 | 
			
		||||
        const embed = new Discord.MessageEmbed()
 | 
			
		||||
            .setTitle("__Now playing__")
 | 
			
		||||
            .setDescription(`<a:aNotes:674602408105476106>**Now playing:** ${radio.url}\n\`${client.funcs.msToTime(completed, "hh:mm:ss")}\``)
 | 
			
		||||
            .setURL(radio.songs[0].url)
 | 
			
		||||
            .setThumbnail(thumbnail._rejectionHandler0)
 | 
			
		||||
            .setColor(client.config.embedColor)
 | 
			
		||||
        return msg.channel.send(embed);
 | 
			
		||||
 
 | 
			
		||||
@@ -9,8 +9,6 @@ module.exports = {
 | 
			
		||||
	execute(msg, args, client, Discord, prefix, command) {
 | 
			
		||||
		const radio = client.radio.get(msg.guild.id);
 | 
			
		||||
		if (client.funcs.check(client, msg, command)) {
 | 
			
		||||
			radio.songs = [];
 | 
			
		||||
			radio.looping = false;
 | 
			
		||||
			radio.connection.dispatcher.end('Stopped');
 | 
			
		||||
			msg.channel.send('<:stop:674685626108477519> Stopped the music!')
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,20 +0,0 @@
 | 
			
		||||
module.exports = async function (client, reason, guild) {
 | 
			
		||||
    const radio = client.radio.get(guild.id);
 | 
			
		||||
    radio.playing = false;
 | 
			
		||||
    if (reason === "Stream is not generating quickly enough.") {
 | 
			
		||||
        console.log("Song ended");
 | 
			
		||||
    } else if (reason === "seek") {
 | 
			
		||||
        return;
 | 
			
		||||
    } else {
 | 
			
		||||
        console.log(reason);
 | 
			
		||||
    }
 | 
			
		||||
    if (!radio.songLooping) {
 | 
			
		||||
        if (radio.looping) {
 | 
			
		||||
            radio.songs.push(radio.songs[0]);
 | 
			
		||||
        }
 | 
			
		||||
        radio.votes = 0;
 | 
			
		||||
        radio.voters = [];
 | 
			
		||||
        radio.songs.shift();
 | 
			
		||||
    }
 | 
			
		||||
    client.funcs.play(guild, radio.songs[0], client, 0, true);
 | 
			
		||||
};
 | 
			
		||||
@@ -16,7 +16,6 @@ module.exports = class extends Client {
 | 
			
		||||
        this.funcs = {};
 | 
			
		||||
        this.dispatcher = {};
 | 
			
		||||
        this.config = require('./config/config.js');
 | 
			
		||||
        this.dispatcher.finish = require('../events/dispatcher/finish.js');
 | 
			
		||||
 | 
			
		||||
        fs.readdirSync(path.join(__dirname, 'funcs')).forEach(filename => {
 | 
			
		||||
            this.funcs[filename.slice(0, -3)] = require(`./funcs/${filename}`);
 | 
			
		||||
 
 | 
			
		||||
@@ -2,9 +2,7 @@ module.exports = async function (msg, voiceChannel, client, url) {
 | 
			
		||||
    const radio = client.radio.get(msg.guild.id);
 | 
			
		||||
 | 
			
		||||
    if (radio) {
 | 
			
		||||
        radio.songs.push(song);
 | 
			
		||||
        if (playlist) return;
 | 
			
		||||
        return msg.channel.send(`<:green_check_mark:674265384777416705> **${song.title}** has been added to the queue!`);
 | 
			
		||||
        radio.connection.dispatcher.end('Stopped');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const construct = {
 | 
			
		||||
 
 | 
			
		||||
@@ -3,8 +3,8 @@ module.exports = async function (guild, client, url) {
 | 
			
		||||
    const radio = client.radio.get(guild.id);
 | 
			
		||||
    const dispatcher = radio.connection
 | 
			
		||||
        .play(url, { bitrate: 1024, passes: 10, volume: 1, highWaterMark: 1 << 25 })
 | 
			
		||||
        .on("finish", reason => {
 | 
			
		||||
            client.dispatcher.finish(client, reason, guild);
 | 
			
		||||
        .on("finish", () => {
 | 
			
		||||
            radio.delete();
 | 
			
		||||
        });
 | 
			
		||||
    dispatcher.on('start', () => {
 | 
			
		||||
        dispatcher.player.streamingData.pausedTime = 0;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user