diff options
| author | Jokler <jokler@protonmail.com> | 2020-01-26 06:58:42 +0100 |
|---|---|---|
| committer | Jokler <jokler@protonmail.com> | 2020-01-29 20:39:27 +0100 |
| commit | af0a1b81707536caf4e498d86912f65981342072 (patch) | |
| tree | 6a875cd46bc427544804a14278a90e23a119bfc5 /src/main.rs | |
| parent | 32686ba4a31ecf7c9aedad65c1a6be0be7d96ea2 (diff) | |
| download | pokebot-af0a1b81707536caf4e498d86912f65981342072.tar.gz pokebot-af0a1b81707536caf4e498d86912f65981342072.zip | |
Randomly choose from lists of identities and names
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/main.rs b/src/main.rs index bff40f8..ae1bed7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ mod playlist; mod teamspeak; mod youtube_dl; -use bot::{BotConfig, MasterArgs, MasterBot}; +use bot::{MasterArgs, MasterBot}; #[derive(StructOpt, Debug)] #[structopt(raw(global_settings = "&[AppSettings::ColoredHelp]"))] @@ -61,22 +61,18 @@ pub struct Args { } fn main() { - //let example = BotConfig { - //name: String::from("asd"), - //id: Identity::create().unwrap(), - //owner: Some(ClientId(12)), - //}; - //let bots = vec![example]; + //let ids = vec![Identity::create().unwrap()]; //println!( //"{}", //toml::to_string(&MasterArgs { - //name: String::from("PokeBot"), + //master_name: String::from("PokeBot"), //id: Identity::create().unwrap(), + //names: vec![String::from("test")], //address: String::from("localhost"), //channel: Some(String::from("Poke If Needed")), //local: false, //verbose: 0, - //bots, + //ids, //}) //.map_err(|e| panic!(e.to_string())) //.unwrap() @@ -102,14 +98,9 @@ fn run() -> Result<(), Box<dyn std::error::Error>> { let mut config: MasterArgs = toml::from_str(&toml)?; if let Some(count) = args.gen_id_count { - for i in 0..count { + for _ in 0..count { let id = Identity::create().expect("Failed to create id"); - let bot = BotConfig { - name: format!("{}", i), - owner: None, - id, - }; - config.bots.push(bot); + config.ids.push(id); } let toml = toml::to_string(&config)?; |
