diff options
| author | Pinapelz <donaldshan1@outlook.com> | 2023-08-15 14:56:16 -0700 |
|---|---|---|
| committer | Pinapelz <donaldshan1@outlook.com> | 2023-08-15 14:56:16 -0700 |
| commit | 499fe2a90287c5a84a4b32ebc43fc7a609e8871c (patch) | |
| tree | 3dcc13fa8aa73a2d55c4b607f8b2d54203df1ad7 /src/main/java/audio | |
| parent | f225145602b89bf9ce5e0123bf2038fe59e59db6 (diff) | |
fix: LOAD_FAILED error due to rate limitation
Diffstat (limited to 'src/main/java/audio')
| -rw-r--r-- | src/main/java/audio/Music.java | 5 |
1 files changed, 3 insertions, 2 deletions
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();
|
