Listen for joins and leaves on IRC and broadcast them to minecraft

This commit is contained in:
Yash Karandikar 2021-08-16 17:56:12 -05:00
parent 26b0263459
commit f009c8fb62
Signed by: karx
GPG key ID: A794DA2529474BA5

View file

@ -62,8 +62,14 @@ public class Bot {
Bukkit.broadcastMessage(ChatColor.BLUE + "[IRC] <" + user + "> " + ChatColor.WHITE + message);
} else if (line.contains("PING")) {
chat.sendToServer(bw, line.replaceFirst("I", "O"));
} else if (line.contains("JOIN")) {
String user = line.substring(1, line.indexOf("!"));
hasRespondedToFirstPing = true;
Bukkit.broadcastMessage(ChatColor.YELLOW + "" + ChatColor.ITALIC + "[IRC] " + user + " has joined the channel");
} else if (line.contains("QUIT") || line.contains("PART")) {
String user = line.substring(1, line.indexOf("!"));
Bukkit.broadcastMessage(ChatColor.RED + "" + ChatColor.ITALIC + "[IRC] " + user + " has left the channel");
}
// This will join the channel once and then not again