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 xyz.vallat.louis.subtitles.OpenSubtitles;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@ -48,7 +47,6 @@ public abstract class Command {
|
|||||||
|
|
||||||
public abstract Mono<Void> execute(MessageCreateEvent event);
|
public abstract Mono<Void> execute(MessageCreateEvent event);
|
||||||
|
|
||||||
// TODO: RECODE THIS TO USE THE OPTIONS SYSTEM
|
|
||||||
public String getUsage() {
|
public String getUsage() {
|
||||||
return "``" + this.usage + "``";
|
return "``" + this.usage + "``";
|
||||||
}
|
}
|
||||||
@ -69,19 +67,6 @@ public abstract class Command {
|
|||||||
return name;
|
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) {
|
protected Mono<Void> unknownLanguage(MessageCreateEvent event, String lang) {
|
||||||
return event.getMessage().getChannel()
|
return event.getMessage().getChannel()
|
||||||
.flatMap(channel ->
|
.flatMap(channel ->
|
||||||
@ -92,7 +77,7 @@ public abstract class Command {
|
|||||||
protected Mono<Void> parsingError(MessageCreateEvent event) {
|
protected Mono<Void> parsingError(MessageCreateEvent event) {
|
||||||
return event.getMessage().getChannel()
|
return event.getMessage().getChannel()
|
||||||
.flatMap(channel ->
|
.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();
|
.then();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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) {
|
protected String[] getArgArray(MessageCreateEvent event) {
|
||||||
return event.getMessage().getContent().substring(name.length()).split(" ");
|
return event.getMessage().getContent().substring(name.length()).split(" ");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user