Search code examples
javascriptdiscord.jsdistube

How do i make my music bot send embed from a function when song is played?


So I made music bot and I'm making it work on Discord js v13 and Distube v3(I have been using v12 before). Sadly there are many changes and some of them made me search for solution for hours. If you can help me with this one i may be able to fix the whole bot :D. So here's the code:https://sourceb.in/BI41NrxFPH. When song is played i want my bot to send embed but it doesn't send anything. I made lots of changes and got many results like

DiscordAPIError: Cannot send an empty message

but embed was never sent. If you need some information let me know.


Solution

  • Because

        var playingMessage =  message.channel.send({ embeds: [embed1] });
    
    

    Sending messages doesn't ​work as a variant

    Try typing

    message.channel.send({ embeds: [embed1] });
    

    In the last line of the playback function or in the:

    //function playsongyes(song)  example
    message.channel.send({ embeds: [embed1] });