async fn run(&mut self, user_config: &UserConfig, channels: &[String]) -> anyhow::Result<()> {
        // this can fail if DNS resolution cannot happen
        let connector = twitchchat::connector::smol::Connector::twitch()?;

        let mut runner = AsyncRunner::connect(connector, user_config).await?;
        println!("connecting, we are: {}", runner.identity.username());

        for channel in channels {
            println!("joining: {}", channel);
            if let Err(err) = runner.join(channel).await {
                eprintln!("error while joining '{}': {}", channel, err);
            }
        }

        // if you store this somewhere, you can quit the bot gracefully
        // let quit = runner.quit_handle();

        println!("starting main loop");
        self.main_loop(&mut runner).await
    }
// run the bot until its done
run the bot until its done
run the bot until its done
async fn run(&mut self, user_config: &UserConfig, channels: &[String]) -> anyhow::Result<()> {
        // this can fail if DNS resolution cannot happen
        let connector = twitchchat::connector::smol::Connector::twitch()?;
        let mut runner = AsyncRunner::connect(connector, user_config).await?;
        println!("connecting, we are: {}", runner.identity.username());
        for channel in channels {
            println!("joining: {}", channel);
            if let Err(err) = runner.join(channel).await {
                eprintln!("error while joining '{}': {}", channel, err);
            }
        }
        // if you store this somewhere, you can quit the bot gracefully
        // let quit = runner.quit_handle();
        println!("starting main loop");
        self.main_loop(&mut runner).await
    }
async fn run ( & mut self , user_config : & UserConfig , channels : & [ String ] ) -> anyhow :: Result < ( ) > { // this can fail if DNS resolution cannot happen let connector = twitchchat :: connector :: smol :: Connector :: twitch ( ) ? ; let mut runner = AsyncRunner :: connect ( connector , user_config ) . await ? ; println ! ( " " runner identity username ( ) ) ; for channel in channels { println ! ( " " channel ) ; if let Err ( err ) = runner . join ( channel ) . await { eprintln ! ( " " channel err ) ; } } // if you store this somewhere, you can quit the bot gracefully // let quit = runner.quit_handle(); println ! ( " " ) ; self . main_loop ( & mut runner ) . await }
run the bot until its done
run the bot until its done
&mut self
user_config
&UserConfig
channels
&[String]
&mut self
user_config
&UserConfig
channels
&[String]