diff options
| author | mat <github@matdoes.dev> | 2022-04-29 23:06:40 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-04-29 23:06:40 -0500 |
| commit | c8c356685d9050d166226fb01353faba5fc00f4a (patch) | |
| tree | 4c4d295e44eacfcb31b025e903c0b60d73c35c83 /bot | |
| parent | baaa7658b58adfe72f0ea96d629dc76298ddf5dc (diff) | |
| download | azalea-drasl-c8c356685d9050d166226fb01353faba5fc00f4a.tar.xz | |
background task works!
Diffstat (limited to 'bot')
| -rw-r--r-- | bot/src/main.rs | 16 |
1 files changed, 11 insertions, 5 deletions
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"); } |
