forked from Minecraft/Hush
Merge pull request 'Highlight matched phrase.' (#1) from ZeroHD/Hush:master into master
Reviewed-on: https://git.etztech.xyz/Minecraft/Hush/pulls/1master
commit
7746f6905e
|
@ -20,7 +20,7 @@ public class WatchList {
|
|||
private static List<Pattern> buildPattern(List<String> patternList) {
|
||||
return patternList
|
||||
.stream()
|
||||
.map(Pattern::compile)
|
||||
.map(p -> Pattern.compile(String.format("(%s)", p)))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
|
|
@ -73,9 +73,11 @@ public class HushAsyncChatListener implements Listener {
|
|||
|
||||
String playerName = player.getName();
|
||||
String webhook = plugin.getConfig().getString("webhook");
|
||||
chatMessage = Javacord.escapeFormat(chatMessage);
|
||||
chatMessage = pattern.matcher(chatMessage).replaceAll("**$0**");
|
||||
|
||||
if (webhook != null) {
|
||||
String message = playerName + " said: " + "`" + Javacord.escapeFormat(chatMessage) + "`";
|
||||
String message = playerName + " said: " + chatMessage;
|
||||
Embed embed = new Embed()
|
||||
.color(0xC70039)
|
||||
.description(message)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: Hush
|
||||
version: v0.1.0
|
||||
version: 0.1.0
|
||||
main: com.zerohighdef.hush.Hush
|
||||
api-version: "1.16"
|
||||
authors: [ZeroHighDef]
|
||||
|
|
Loading…
Reference in New Issue