Closed bit0r1n closed 6 years ago
i made spotify command, he is working, but when in my status there is nothing, bot is crashing how to fix this? if at all possible
bot.on('message', message => { let msg = message.content.toUpperCase(); if(msg.startsWith(prefix + 'SPOTIFY')){ var user = message.mentions.users.first() || message.author; if(user.bot) return message.channel.send("bots cant listen music :cry:"); if(user.presence.game.type == 2 && user.presence.game.name == 'Spotify') { try { var trackImg = user.presence.game.assets.largeImageURL; var trackUrl = https://open.spotify.com/track/${user.presence.game.syncID}; var trackName = user.presence.game.details; var trackAlbum = user.presence.game.assets.largeText; var trackAuthor = user.presence.game.state; const embed = new Discord.RichEmbed() .setAuthor('Spotify info') .setColor(embedcolor) .setThumbnail(trackImg) .setDescription( \🎵` Track name : `${trackName}` `📀` Album : `${trackAlbum}` `🎤` Author(s) : `${trackAuthor}` `🕐` Start listen at: `${user.presence.game.timestamps.start.getHours()}:${user.presence.game.timestamps.start.getMinutes()}:${user.presence.game.timestamps.start.getSeconds()}` ) .addField('Listen this track :',${trackAuthor} — ${trackName} (Spotify link), false); return message.channel.send(embed); }catch(error){ return message.channel.send(`[Err ❌]`, ${user.username} listen local music); } }else{ message.channel.send(${user.username} dont listen music on Spotify`); } }
https://open.spotify.com/track/${user.presence.game.syncID}
\
) .addField('Listen this track :',
, false); return message.channel.send(embed); }catch(error){ return message.channel.send(
); } }else{ message.channel.send(
});
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue – you will get redirected there anyway.
i made spotify command, he is working, but when in my status there is nothing, bot is crashing how to fix this? if at all possible
});