Skip to content

Commit

Permalink
feat: ✨ case insensitive while matching player names
Browse files Browse the repository at this point in the history
  • Loading branch information
401U committed Jul 2, 2023
1 parent 5576e4c commit e2f4145
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/zhanganzhi/chathub/command/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public List<String> suggest(final Invocation invocation) {
} else if (args.length == 2 && args[0].equals("msg")) {
return proxyServer.getAllPlayers()
.stream().map(Player::getUsername)
.filter(s -> s.startsWith(args[1]))
.map(String::toLowerCase)
.filter(s -> s.startsWith(args[1].toLowerCase()))
.collect(Collectors.toList());
} else {
return List.of();
Expand Down

0 comments on commit e2f4145

Please sign in to comment.