diff options
Diffstat (limited to 'azalea/examples/testbot.rs')
| -rw-r--r-- | azalea/examples/testbot.rs | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/azalea/examples/testbot.rs b/azalea/examples/testbot.rs index aa47d5a2..a304e2ce 100644 --- a/azalea/examples/testbot.rs +++ b/azalea/examples/testbot.rs @@ -21,7 +21,7 @@ struct State {} struct SwarmState {} #[tokio::main] -async fn main() -> anyhow::Result<()> { +async fn main() { { use parking_lot::deadlock; use std::thread; @@ -51,20 +51,14 @@ async fn main() -> anyhow::Result<()> { accounts.push(Account::offline(&format!("bot{i}"))); } - loop { - let e = SwarmBuilder::new() - .add_accounts(accounts.clone()) - .set_handler(handle) - .set_swarm_handler(swarm_handle) - .join_delay(Duration::from_millis(100)) - .start("localhost") - .await; - // let e = azalea::ClientBuilder::new() - // .set_handler(handle) - // .start(Account::offline("bot"), "localhost") - // .await; - eprintln!("{e:?}"); - } + SwarmBuilder::new() + .add_accounts(accounts.clone()) + .set_handler(handle) + .set_swarm_handler(swarm_handle) + .join_delay(Duration::from_millis(100)) + .start("localhost") + .await + .unwrap(); } async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result<()> { |
