Removed now unused functions from the Command system
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
parent
a366662290
commit
ceea5fa96d
@ -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<Void> 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<Void> notEnoughArguments(MessageCreateEvent event) {
|
||||
return event.getMessage().getChannel()
|
||||
.flatMap(channel -> channel.createMessage("Error, you're missing some arguments.\n" + getUsage()))
|
||||
.then();
|
||||
}
|
||||
|
||||
protected Mono<Void> 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<Void> unknownLanguage(MessageCreateEvent event, String lang) {
|
||||
return event.getMessage().getChannel()
|
||||
.flatMap(channel ->
|
||||
@ -129,11 +114,6 @@ public abstract class Command {
|
||||
}
|
||||
}
|
||||
|
||||
protected List<String> 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(" ");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user