Browse Source

now playing

tags/Beta0.1
calexil 2 years ago
parent
commit
02f6ed9838
1 changed files with 0 additions and 52 deletions
  1. 0
    52
      bot.js

+ 0
- 52
bot.js View File

@@ -59,58 +59,6 @@ client.on('message', message => {
}
});

var LastFmNode = require('lastfm').LastFmNode;

var lastfm = new LastFmNode({
api_key: '99187e91b94f44ce4f2d71bcfe303147',
secret: '71656c0d03209d8b56a50ae852e89b68'
});

var trackStream = lastfm.stream('calexil');

trackStream.on('lastPlayed', function(track) {
console.log('Last played: ' + track.name);
});

trackStream.on('nowPlaying', function(track) {
console.log('Now playing: ' + track.name);
});

trackStream.on('scrobbled', function(track) {
console.log('Scrobbled: ' + track.name);
});

trackStream.on('stoppedPlaying', function(track) {
console.log('Stopped playing: ' + track.name);
});

trackStream.on('error', function(error) {
console.log('Error: ' + error.message);
});

trackStream.start();

var session = lastfm.session({
token: token,
handlers: {
success: function(session) {
lastfm.update('nowplaying', session, { track: track } );
lastfm.update('scrobble', session, { track: track, timestamp: 12345678 });
}
}
});

var request = lastfm.request("artist.getInfo", {
artist: "The Mae Shi",
handlers: {
success: function(data) {
console.log("Success: " + data);
},
error: function(error) {
console.log("Error: " + error.message);
}
}
});

// THIS MUST BE THIS WAY
client.login(process.env.BOT_TOKEN);

Loading…
Cancel
Save