Skip to content
This repository has been archived by the owner on Jul 3, 2021. It is now read-only.

[actions] getHistory

Thedark1337 edited this page Feb 11, 2017 · 2 revisions

getHistory([callback])

Gets the room's history of songs played (50 in total)

NOTE: in PlugAPI versions greater than 5 callback is optional, previous versions require it


Parameters

callback function (optional)

Callback function to be called with data from server.


Returns

An array of objects that represents the previous 50 songs that have been played.


Example

//without callback (only works in PlugAPI versions greater than 5)
const history = bot.getHistory();
console.log(history);


//with callback
bot.getHistory(function(data) {
   // data is an array of objects that can be iterated
});
Clone this wiki locally