This commit is contained in:
parent
7dab688298
commit
69872ba0d1
1 changed files with 2 additions and 1 deletions
|
@ -77,7 +77,8 @@ module.exports = async function (userID, option, guild, compatibility=false) {
|
||||||
fetch(`https://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=${lastfmUsername}&period=${option[0]}&api_key=${process.env.LAST_FM_API_KEY}&format=json`)
|
fetch(`https://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=${lastfmUsername}&period=${option[0]}&api_key=${process.env.LAST_FM_API_KEY}&format=json`)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
for(let i = 0; i < 10; i++){
|
const maxIterations = data.topartists.artist.length >= 10 ? 10 : data.topartists.artist.length;
|
||||||
|
for(let i = 0; i < maxIterations; i++){
|
||||||
let artist = {}
|
let artist = {}
|
||||||
let currentArtist = data.topartists.artist[i];
|
let currentArtist = data.topartists.artist[i];
|
||||||
artist.name = currentArtist.name;
|
artist.name = currentArtist.name;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue