Skip to content

Commit

Permalink
fix SwarmEvent::Login and SwarmEvent::Init maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Dec 16, 2023
1 parent a069ffe commit 844ed11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion azalea/examples/echo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use azalea::prelude::*;
#[tokio::main]
async fn main() {
let account = Account::offline("bot");
// or let account = Account::microsoft("email").await.unwrap();
let account = Account::microsoft("email").await.unwrap();

ClientBuilder::new()
.set_handler(handle)
Expand Down
4 changes: 4 additions & 0 deletions azalea/src/swarm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ where
let (bots_tx, mut bots_rx) = mpsc::unbounded_channel();
let (swarm_tx, mut swarm_rx) = mpsc::unbounded_channel();

swarm_tx.send(SwarmEvent::Init).unwrap();

let (run_schedule_sender, run_schedule_receiver) = mpsc::unbounded_channel();

let main_schedule_label = self.app.main_schedule_label;
Expand Down Expand Up @@ -377,6 +379,8 @@ where
)
.await;
}

swarm_tx.send(SwarmEvent::Login).unwrap();
});

let swarm_state = self.swarm_state;
Expand Down

0 comments on commit 844ed11

Please sign in to comment.