fmtt: Set weekly as the default time period
This commit is contained in:
parent
3ed4714457
commit
4a67153fb9
1 changed files with 6 additions and 5 deletions
|
@ -17,12 +17,13 @@ module.exports = async function (userID, option) {
|
||||||
}
|
}
|
||||||
if(option.length === 0){
|
if(option.length === 0){
|
||||||
option[0] = "weekly"
|
option[0] = "weekly"
|
||||||
}else {
|
|
||||||
option[0] = options[option[0]];
|
|
||||||
if(option[0] === undefined)
|
|
||||||
option[0] = options[option[0]];
|
|
||||||
}
|
}
|
||||||
const apiKey = process.env.LAST_FM_API_KEY;
|
|
||||||
|
option[0] = options[option[0]];
|
||||||
|
if(option[0] === undefined)
|
||||||
|
option[0] = options[option[0]];
|
||||||
|
|
||||||
|
const apiKey = process.env.LAST_FM_API_KEY;
|
||||||
if(lastfmUsername != undefined){
|
if(lastfmUsername != undefined){
|
||||||
tracks = await new Promise ((resolve, reject) => {
|
tracks = await new Promise ((resolve, reject) => {
|
||||||
fetch(`https://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user=${lastfmUsername}&period=${option[0]}&api_key=${apiKey}&format=json`)
|
fetch(`https://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user=${lastfmUsername}&period=${option[0]}&api_key=${apiKey}&format=json`)
|
||||||
|
|
Loading…
Add table
Reference in a new issue