From 5a85141611d8beecf3b509d4820c4f4ae2575851 Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Thu, 29 Oct 2020 00:03:55 +0100 Subject: [PATCH] Refactored and added a way to list a movie's subtitle languages by imdb id and title Signed-off-by: Louis Vallat --- .../commands/{ListLangMovieTitle.java => ListLangMovie.java} | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) rename src/main/java/xyz/vallat/louis/commands/{ListLangMovieTitle.java => ListLangMovie.java} (88%) diff --git a/src/main/java/xyz/vallat/louis/commands/ListLangMovieTitle.java b/src/main/java/xyz/vallat/louis/commands/ListLangMovie.java similarity index 88% rename from src/main/java/xyz/vallat/louis/commands/ListLangMovieTitle.java rename to src/main/java/xyz/vallat/louis/commands/ListLangMovie.java index 5d9e578..e6db62d 100644 --- a/src/main/java/xyz/vallat/louis/commands/ListLangMovieTitle.java +++ b/src/main/java/xyz/vallat/louis/commands/ListLangMovie.java @@ -14,11 +14,14 @@ public class ListLangMovieTitle extends Command { private static final ReactionEmoji WAITING = ReactionEmoji.unicode("⌛"); public ListLangMovieTitle(String name) { - super(name, "List all languages attached to a film title.", name + " title", 1, 2); + super(name, "List all languages attached to a film title or an IMDB Identifier.", + name + " imdb|title value", 3, 3); } @Override public Mono execute(MessageCreateEvent event) { + if (event.getMessage().getContent().split(" ").length < minArgs) return notEnoughArguments(event); + boolean isId = event.getMessage().getContent().split(" ") String arg = event.getMessage().getContent().substring(name.length() + 1); if (arg.isBlank()) return notEnoughArguments(event); logger.debug("Executing command with argument '{}'.", arg);