Adding r.ip function

This commit is contained in:
DarkFeather 2022-06-23 11:58:27 -05:00
parent 919fb1db15
commit 838c0f8064
Signed by: DarkFeather
GPG Key ID: 1CC1E3F4ED06F296

View File

@ -126,17 +126,9 @@ namespace AniNIX.TheRaven {
} }
connection.Write(send); connection.Write(send);
return; return;
case "r.heartbeat": case "r.ip":
try { send.PrivMsg(ExecuteCommand.Run("curl -s 10.0.1.1:80 | grep \"WAN IP\" | cut -f 7 -d \">\" | cut -f 1 -d \"<\""),(incoming.target.Equals(theRaven.Nick))?incoming.user:incoming.target);
String[] byLine = ExecuteCommand.Run("heartbeat-client").Split('\n'); connection.Write(send);
for (int i = 0; i < byLine.Length; i++) {
send.PrivMsg(byLine[i],incoming.user);
connection.Write(send);
}
} catch (Exception e) {
e.ToString();
send.PrivMsg("Can't get heartbeat",incoming.user);
}
return; return;
case "r.searches": case "r.searches":
send.PrivMsg(theRaven.searchesIndex,(incoming.target.Equals(theRaven.Nick))?incoming.user:incoming.target); send.PrivMsg(theRaven.searchesIndex,(incoming.target.Equals(theRaven.Nick))?incoming.user:incoming.target);