From c8c356685d9050d166226fb01353faba5fc00f4a Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 29 Apr 2022 23:06:40 -0500 Subject: background task works! --- bot/src/main.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'bot') diff --git a/bot/src/main.rs b/bot/src/main.rs index 84867d78..3daaa160 100644 --- a/bot/src/main.rs +++ b/bot/src/main.rs @@ -1,3 +1,5 @@ +use azalea_client::{Account, Event}; + #[tokio::main] async fn main() { println!("Hello, world!"); @@ -9,11 +11,15 @@ async fn main() { // .unwrap(); // println!("{}", response.description.to_ansi(None)); - let account = azalea_client::Account::offline("bot"); - let client = account.join(&address.try_into().unwrap()).await.unwrap(); + let account = Account::offline("bot"); + let mut client = account.join(&address.try_into().unwrap()).await.unwrap(); println!("connected"); - // loop { - // match client.next().await {} - // } + while let Some(e) = client.next().await { + match e { + Event::Login => {} + } + } + + println!("done"); } -- cgit v1.2.3