From 5f6949bc2e5c3e72dd0efb9363bb64b7d5d10121 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Fri, 12 Jul 2024 02:33:11 +0200 Subject: [PATCH] Temporarily disable the fmtt command --- commands/misc/fm.js | 3 ++- util/lastfm/getTopTracks.js | 19 ++----------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/commands/misc/fm.js b/commands/misc/fm.js index 578004a..64b2177 100644 --- a/commands/misc/fm.js +++ b/commands/misc/fm.js @@ -26,7 +26,8 @@ module.exports = { case "toptracks": case "tt": args.shift(); - sendText.text = await getTopTracks(message.author.id, args); + //sendText.text = await getTopTracks(message.author.id, args); + sendText.text = "This command is currently being rewritten, come back later." break; case "cover": sendText = await getCurrentCover(message.author.id, message.guild); diff --git a/util/lastfm/getTopTracks.js b/util/lastfm/getTopTracks.js index 38da5c1..5c6e37b 100644 --- a/util/lastfm/getTopTracks.js +++ b/util/lastfm/getTopTracks.js @@ -1,10 +1,6 @@ // http://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user=username&api_key=YOUR_API_KEY&format=json -const Discord = require('discord.js'); -const getFmUsername = require("./getFmUsername") -module.exports = async function (userID, option) { - let lastfmUsername = await getFmUsername(userID); - let sendText = {text: "", embed: null}; +module.exports = async function (lastfmUsername, option) { let tracks = []; const options = { "alltime": "overall", @@ -65,17 +61,6 @@ module.exports = async function (userID, option) { reject(error); }); }); - let author = `Top ${duration} tracks for ${lastfmUsername}:\n`; - let toptracks = ""; - for(let i = 0; i < tracks.length; i++){ - sendText += `${i}. ${tracks[i].artist} - ${tracks[i].song} (${tracks[i].playcount} plays)\n`; } - const embed = new Discord.MessageEmbed() - .setAuthor(`Now playing - ${nickname}`, user.user.avatarURL({ dynamic: true, size: 4096 })) - .setColor(15780145) - - } else { - sendText.text = "You haven't set your last.fm username yet. Use `fm set ` to set it."; - } - return sendText; + return tracks; } \ No newline at end of file