swee revisou este gist 4 months ago. Ir para a revisão
1 file changed, 11 insertions
irc.rs(arquivo criado)
| @@ -0,0 +1,11 @@ | |||
| 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 | + | } | |
Próximo
Anterior