From 499fe2a90287c5a84a4b32ebc43fc7a609e8871c Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Tue, 15 Aug 2023 14:56:16 -0700 Subject: fix: LOAD_FAILED error due to rate limitation --- src/main/java/audio/Music.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/audio/Music.java') diff --git a/src/main/java/audio/Music.java b/src/main/java/audio/Music.java index 65e3564..cf30ee3 100644 --- a/src/main/java/audio/Music.java +++ b/src/main/java/audio/Music.java @@ -239,8 +239,9 @@ public class Music extends ListenerAdapter { loadAndPlay((TextChannel) event.getChannel(), youtubeAPI.returnTopVideoURL(spotifyAPI.getSearchTerm_sync(randomSong)), true); } else { - event.reply("Found Video: " + youtubeAPI.returnTopVideoURL(userQuery)).queue(); - loadAndPlay((TextChannel) event.getChannel(), youtubeAPI.returnTopVideoURL(userQuery), true); + String top_video = youtubeAPI.returnTopVideoURL(userQuery); + event.reply("Found Video: " + top_video).queue(); + loadAndPlay((TextChannel) event.getChannel(), top_video, true); } } catch (IOException e) { e.printStackTrace(); -- cgit v1.2.3