From 6172814a2e76b5e8866ffc81de9f4a82a45e419b Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Wed, 11 Sep 2024 15:03:57 +0200 Subject: [PATCH] Fix shorthands for toptracks I previously used chatgpt to generate shorthands for times, but I didn't read them so it generated stuff like daily. Now there are only lengths that exist in the lastfm api --- util/lastfm/getTopTracks.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/util/lastfm/getTopTracks.js b/util/lastfm/getTopTracks.js index 249b3e6..284c19a 100644 --- a/util/lastfm/getTopTracks.js +++ b/util/lastfm/getTopTracks.js @@ -15,26 +15,30 @@ module.exports = async function (userID, option, guild) { } let tracks = []; const options = { - "d": "1day", - "m": "1month", + "weekly": "7day", + "week": "7day", "w": "7day", + + "monthly": "1month", + "month": "1month", + "m": "1month", + + "quarterly": "3month", "q": "3month", + + "halfyear": "6month", + "hy": "6month", "h": "6month", + + "yearly": "12month", + "year": "12month", "y": "12month", + + "alltime": "overall", "a": "overall", "at": "overall", "all": "overall", - "daily": "1day", - "weekly": "7day", - "monthly": "1month", - "quarterly": "3month", - "halfyear": "6month", - "yearly": "12month", - "biweekly": "14day", - "fortnight": "14day", - "twomonth": "2month", - "twoyear": "24month", - "weekend": "2day", + undefined: "7day" };