24 lines
525 B
Rust
24 lines
525 B
Rust
use irsc::{Client, 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::new("test", Some("test"), Some("+B"));
|
|
let mut client =
|
|
Client::new("192.168.178.100", 6667, config).expect("Unable to connect to IRC server");
|
|
client.identify()?;
|
|
|
|
loop {
|
|
if let Some(line) = client.read_string() {
|
|
print!("{}", line);
|
|
}
|
|
}
|
|
}
|