0

Added better handling of private playlists.

This commit is contained in:
Logan Fick
2019-05-26 16:11:13 -04:00
parent 9bf5571faf
commit 67d2b3ad50

View File

@@ -183,10 +183,15 @@ public final class TrackLoadHandler implements AudioLoadResultHandler {
Checks.notNull(exception, "Exception");
final CommandResponse response;
if (exception.getMessage().equals("Unknown file format.")) {
final String message = exception.getMessage();
if (message.equals("Unknown file format.")) {
response = new CommandResponse("question",
"Sorry " + this.requester.getAsMention() + ", but I do not recognize the format of that track.")
.setDeletionDelay(10, TimeUnit.SECONDS);
} else if (message.equals("The playlist is private.")) {
response = new CommandResponse("no_entry_sign",
"Sorry " + this.requester.getAsMention() + ", but that playlist is private.").setDeletionDelay(10,
TimeUnit.SECONDS);
} else {
final Guild guild = this.channel.getGuild();
logger.error("An error occurred for " + guild.getName() + " (" + guild.getId()