use of se.michaelthelin.spotify.model_objects.specification.PlayHistory in project spotifybot by NotEchoDE.
the class LastSongCommand method exec.
@Override
@SneakyThrows
public void exec(String userName, String id, UserLevel userLevel, String[] args) {
PagingCursorbased<PlayHistory> historyPagingCursorbased = getRoot().getSpotifyApi().getCurrentUsersRecentlyPlayedTracks().limit(1).build().execute();
String trackId = historyPagingCursorbased.getItems()[0].getTrack().getId();
Track track = getRoot().getSpotifyApi().getTrack(trackId).build().execute();
sendMessage(getModule().getEntry("lastSong"), "$USER", userName, "$LASTSONG", track.getName(), "$ARTISTS", SpotifyUtils.getArtists(track));
}
Aggregations