Skip to content

Commit 8d5f2b5

Browse files
committed
Added description requirement for commands....
1 parent 96c9504 commit 8d5f2b5

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

src/main/java/org/mangorage/mangobotcore/api/command/v1/AbstractCommand.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,23 @@ public abstract class AbstractCommand<C, R> {
2020

2121
private final Map<String, Argument<?>> arguments = new LinkedHashMap<>();
2222
private final String name;
23+
private final String description;
2324

2425
private int requiredArgs = 0;
2526

26-
public AbstractCommand(String name) {
27+
public AbstractCommand(String name, String description) {
2728
this.name = name;
29+
this.description = description;
2830
}
2931

3032
public String getName() {
3133
return name;
3234
}
3335

36+
public String getDescription() {
37+
return description;
38+
}
39+
3440
public abstract R getFailedResult();
3541

3642
public List<String> aliases() {
@@ -70,7 +76,17 @@ protected <T> OptionalArg<T> registerOptionalArgument(String name, String descri
7076
}
7177

7278
public List<String> getCommandNotes() {
73-
return List.of("No additional notes for this command.");
79+
final List<String> notes = new ArrayList<>(
80+
List.of(
81+
"Description:",
82+
getDescription()
83+
)
84+
);
85+
86+
notes.add("Aliases: ");
87+
notes.add(String.join(",", aliases()));
88+
89+
return notes;
7490
}
7591

7692
/**

0 commit comments

Comments
 (0)