Fixed bug on listing empty subtitle lists
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
parent
f692df6ce0
commit
2746c81466
@ -54,10 +54,12 @@ public class ListLang extends Command {
|
||||
embed.setTitle("Results")
|
||||
.setDescription("Found " + subtitles.getData().size() + " results.")
|
||||
.setColor(Color.BISMARK);
|
||||
StringBuilder s = new StringBuilder();
|
||||
for (SubtitleInfo info : subtitles.getData().subList(0, Math.min(10, subtitles.getData().size())))
|
||||
s.append(info.getId()).append(" - ").append(info.getLanguage()).append("\n");
|
||||
embed.addField("Languages found", s.toString(), false);
|
||||
if (!subtitles.getData().isEmpty()) {
|
||||
StringBuilder s = new StringBuilder();
|
||||
for (SubtitleInfo info : subtitles.getData().subList(0, Math.min(10, subtitles.getData().size())))
|
||||
s.append(info.getId()).append(" - ").append(info.getLanguage()).append("\n");
|
||||
embed.addField("Languages found", s.toString(), false);
|
||||
}
|
||||
});
|
||||
} else if (subtitles.getStatus().getCode() == ResponseStatus.INVALID_PARAMETERS.getCode()) {
|
||||
return messageChannel.createMessage("It looks like it is an invalid IMDB identifier.");
|
||||
|
@ -16,7 +16,7 @@ public class Version extends Command {
|
||||
return event.getMessage().getChannel()
|
||||
.flatMap(channel -> channel
|
||||
.createEmbed(embedCreateSpec -> embedCreateSpec
|
||||
.setColor(Color.RED)
|
||||
.setColor(Color.BISMARK)
|
||||
.setTitle(MovieQuoteBot.NAME)
|
||||
.setDescription(MovieQuoteBot.DESCRIPTION)
|
||||
.addField("Version", MovieQuoteBot.VERSION, true)
|
||||
|
Loading…
Reference in New Issue
Block a user