Skip to content

Commit 7bfd67e

Browse files
committed
Updated Log Analyzer :>
1 parent e259092 commit 7bfd67e

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ dependencies {
6161
installer('org.mangorage:installer:4.0.3')
6262
bot('org.mangorage:mangobot:11.0.23')
6363

64+
plugin('org.mangorage:mangobotgithub:+')
65+
6466
library('org.luaj:luaj-jse:3.0.1')
6567
library('dev.arbjerg:lavaplayer:2.2.2')
6668
library('dev.lavalink.youtube:common:1.11.3')

src/main/java/org/mangorage/mangobot/modules/logs/modules/UUIDChecker.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,32 @@
33
import net.dv8tion.jda.api.entities.Message;
44
import org.mangorage.mangobot.modules.logs.LogAnalyserModule;
55

6+
import java.util.regex.Matcher;
7+
import java.util.regex.Pattern;
8+
69
public final class UUIDChecker implements LogAnalyserModule {
10+
private static final Pattern pattern = Pattern.compile("--uuid,\\s*([a-fA-F0-9-]+)");
11+
12+
public static String extractUUID(String input) {
13+
Matcher matcher = pattern.matcher(input);
14+
15+
if (matcher.find()) {
16+
return matcher.group(1);
17+
} else {
18+
return "UUID not found";
19+
}
20+
}
721

822
@Override
923
public void analyse(String str, Message message) {
10-
System.out.println("Check");
24+
var lines = str.split("\n");
25+
for (String line : lines) {
26+
if (line.contains("--username") && line.contains("--uuid")) {
27+
message.reply(
28+
"[Found Profile](https://namemc.com/search/%s)".formatted(extractUUID(line))
29+
).setSuppressEmbeds(true).mentionRepliedUser(true).queue();
30+
break;
31+
}
32+
}
1133
}
1234
}

0 commit comments

Comments
 (0)