useirc::client::prelude::*;use irc_repartee as irc;usestd::time::Duration;usetokio_stream::StreamExt as_;// NOTE: you can find an asynchronous version of this example with `IrcReactor` in `tooter.rs`.
#[tokio::main]
async fnmain()->irc::error::Result<()>{let config = Config {
nickname:Some("pickles".to_owned()),
server:Some("chat.freenode.net".to_owned()),
channels:vec!["#rust-spam".to_owned()],..Default::default()};letmut client =Client::from_config(config).await?;
client.identify()?;letmut stream = client.stream()?;letmut interval =tokio::time::interval(Duration::from_secs(10));loop{tokio::select!{Some(m)= stream.next()=>{println!("{}", m?);}_= interval.tick()=>{
client.send_privmsg("#rust-spam","TWEET TWEET")?;}}}}