DisTube not showing Song name and requested user

472 Views Asked by At

Distube is not showing the name of the song and the user who requested it. It shows the duration though. Any idea why?

Code:

client.distube
    .on("playSong", (song) => message.channel.send(
        `Playing \`${song.title}\` - \`${song.formattedDuration}\`\nRequested by: ${song.user}`
    ))

Output: output

1

There are 1 best solutions below

0
On BEST ANSWER

Following the code here, the playSong event is emitted when a new song is played and has three parameters, namely

message ( appends MessageObject from discord.js )
queue ( your queue of songs )
song ( this parameter contains your required values )

So in your arrow function listener it'd be something like

client.distube
    .on("playSong", (message, queue, song) => { message.channel.send(
        `Playing \`${song.title}\` - \`${song.formattedDuration}\`\nRequested by: ${song.user}`
    )
});