SHARE
TWEET

Untitled

a guest May 26th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2. const moment = require("moment");
  3. require("moment-duration-format");
  4.  
  5. exports.run = (bot, message, args) => {
  6.  let user = message.mentions.members.first() || message.guild.members.get(args[0]) || message.member;
  7.   if(user.presence.game == null) return message.channel.send(`**${user.user.tag}** | Tidak memutar lagu di Spotify`)
  8.   let game = user.presence.game.name;
  9.  if (game !== 'Spotify') return message.channel.send(`**${user.user.tag}** | Tidak memutar lagu di Spotify`);
  10.  
  11.   let img = `https://i.scdn.co/image/${user.presence.game.assets.largeImage.slice(8)}`;
  12.   let url = `https://open.spotify.com/track/${user.presence.game.syncID}`;
  13.   let name = user.presence.game.details;
  14.   let author = user.presence.game.state;
  15.   let album = user.presence.game.assets.largeText;
  16.  
  17.   //membuat embed
  18.   let embed = new Discord.RichEmbed()
  19.   .setAuthor("Spotify Tracking Info", `https://cdn.discordapp.com/emojis/408668371039682560.png`)
  20.   .setColor("GREEN")
  21.   .setThumbnail(img)
  22.   .addField("Song name", name, true)
  23.   .addField("Album", album, true)
  24.   .addField("Author", author, false)
  25.   .addField("Listening to Track", `[${url}](${url})`, false)
  26.   message.channel.send(embed)
  27. }
  28.  
  29. exports.help = {
  30.  name: "spotify"
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top