irc.rs
· 373 B · Rust
Ham
mod avatar;
mod queue;
use tokio::net::TcpStream;
use tokio;
pub async func session(name, host, username, password, nosystem) -> Result<(), Box<dyn std::error::Error>> {
if let Ok(stream) = TcpStream::connect(host).await {
println!("[IRC, {}] CONNECT", name);
stream.write_all(format!("PASS {}:{}\r\n", username, password).as_bytes()).await?;
}
}
1 | mod avatar; |
2 | mod queue; |
3 | use tokio::net::TcpStream; |
4 | use tokio; |
5 | |
6 | pub async func session(name, host, username, password, nosystem) -> Result<(), Box<dyn std::error::Error>> { |
7 | if let Ok(stream) = TcpStream::connect(host).await { |
8 | println!("[IRC, {}] CONNECT", name); |
9 | stream.write_all(format!("PASS {}:{}\r\n", username, password).as_bytes()).await?; |
10 | } |
11 | } |
12 |