From ceea5fa96d47e91f2b7b97cc96f5aeacc37f59f6 Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Wed, 4 Nov 2020 11:23:43 +0100 Subject: [PATCH] Removed now unused functions from the Command system Signed-off-by: Louis Vallat --- .../xyz/vallat/louis/commands/Command.java | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/main/java/xyz/vallat/louis/commands/Command.java b/src/main/java/xyz/vallat/louis/commands/Command.java index f1c8a6c..503f48b 100644 --- a/src/main/java/xyz/vallat/louis/commands/Command.java +++ b/src/main/java/xyz/vallat/louis/commands/Command.java @@ -14,7 +14,6 @@ import xyz.vallat.louis.omdb.objects.Movie; import xyz.vallat.louis.subtitles.OpenSubtitles; import java.io.IOException; -import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Function; @@ -48,7 +47,6 @@ public abstract class Command { public abstract Mono execute(MessageCreateEvent event); - // TODO: RECODE THIS TO USE THE OPTIONS SYSTEM public String getUsage() { return "``" + this.usage + "``"; } @@ -69,19 +67,6 @@ public abstract class Command { return name; } - protected Mono notEnoughArguments(MessageCreateEvent event) { - return event.getMessage().getChannel() - .flatMap(channel -> channel.createMessage("Error, you're missing some arguments.\n" + getUsage())) - .then(); - } - - protected Mono badArgument(MessageCreateEvent event, String arg) { - return event.getMessage().getChannel() - .flatMap(channel -> - channel.createMessage("Error, this argument isn't recognized: '" + arg + "'.\n Usage: " + getUsage())) - .then(); - } - protected Mono unknownLanguage(MessageCreateEvent event, String lang) { return event.getMessage().getChannel() .flatMap(channel -> @@ -92,7 +77,7 @@ public abstract class Command { protected Mono parsingError(MessageCreateEvent event) { return event.getMessage().getChannel() .flatMap(channel -> - channel.createMessage("An error occurred while parsing your command. Usage: " + getUsage() + ".")) + channel.createMessage("An error occurred while parsing your command. Usage: " + getUsage() + ".")) .then(); } @@ -129,11 +114,6 @@ public abstract class Command { } } - protected List getArguments(MessageCreateEvent event) { - String[] arguments = event.getMessage().getContent().split(" "); - return List.of(arguments).subList(1, arguments.length); - } - protected String[] getArgArray(MessageCreateEvent event) { return event.getMessage().getContent().substring(name.length()).split(" "); }