25 lines
538 B
Rust
25 lines
538 B
Rust
use irsc::{Client, Command, Config};
|
|
|
|
#[allow(unused_macros)]
|
|
macro_rules! loop_n {
|
|
($n:expr, $c:expr) => {{
|
|
for _ in 0..$n {
|
|
$c
|
|
}
|
|
}};
|
|
}
|
|
|
|
fn main() -> Result<(), std::io::Error> {
|
|
let config = Config::from_toml("config.toml")?;
|
|
let mut client = Client::new("192.168.1.28", 6667, config)?;
|
|
client.identify()?;
|
|
|
|
loop {
|
|
if let Ok(ref command) = client.read() {
|
|
if let Command::OTHER(line) = command {
|
|
print!("{}", line);
|
|
}
|
|
}
|
|
}
|
|
}
|