how can i make my bot play random music when the queue end? (discord.js)


my code look like this: https://replit.com/@hotdogwastaken/MUSICBOT
i need someone to help me, i am new

    name: 'play',
    aliases: ['p'],
    category: 'Music',
    utilisation: '{prefix}play [name/URL]',

    execute(client, message, args) {
        if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} Mày có ở trong voice đéo đâu? `);

        if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} Bot đang được sử dụng ở voice khác !`);

        if (!args[0]) return message.channel.send(`${client.emotes.error} - Nhập tên bài hát vào?`);

        client.player.play(message, args.join(" "), { firstResult: true });
    },
};

Source: JavaSript – Stack Overflow

November 24, 2021
Category : News
Tags: bots | discord | discord.js | discord.py | javascript

Leave a Reply

Your email address will not be published. Required fields are marked *

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.