Skip to content

Commit

Permalink
Merge pull request #14 from DancingSnow0517/RuleCommandFix
Browse files Browse the repository at this point in the history
fix(RuleCommand): 修复RuleCommand命令补全没有考虑特殊字符的问题
  • Loading branch information
Gu-ZT authored Apr 2, 2023
2 parents 23eecd7 + 717c1c1 commit 1dc46c2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/dev/dubhe/curtain/api/rules/CurtainRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,15 @@ public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> cont

@Override
public Collection<String> getExamples() {
return List.of(this.suggestions);
if (this.getType() == String.class) {
ArrayList<String> rt = new ArrayList<>();
for (String s : this.suggestions) {
rt.add("\"%s\"".formatted(s));
}
return rt;
} else {
return List.of(this.suggestions);
}
}

public String[] getCategories() {
Expand Down

0 comments on commit 1dc46c2

Please sign in to comment.