aboutsummaryrefslogtreecommitdiff
path: root/azalea/examples/craft_dig_straight_down.rs
diff options
context:
space:
mode:
authorUbuntu <github@matdoes.dev>2023-02-06 19:15:41 +0000
committerUbuntu <github@matdoes.dev>2023-02-06 19:15:41 +0000
commitd51b2a29b2911e4be480727e56553fa27cfbfce0 (patch)
tree880eb62b3e90337cb29d51a30852bce07416bfd8 /azalea/examples/craft_dig_straight_down.rs
parentcbcf1d5e54caefb50ec6340aaf1e8a94312a38c8 (diff)
downloadazalea-drasl-d51b2a29b2911e4be480727e56553fa27cfbfce0.tar.xz
fix some swarm examples/docs
Diffstat (limited to 'azalea/examples/craft_dig_straight_down.rs')
-rwxr-xr-xazalea/examples/craft_dig_straight_down.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/azalea/examples/craft_dig_straight_down.rs b/azalea/examples/craft_dig_straight_down.rs
index 76979406..0632776e 100755
--- a/azalea/examples/craft_dig_straight_down.rs
+++ b/azalea/examples/craft_dig_straight_down.rs
@@ -3,7 +3,7 @@ use azalea::prelude::*;
use parking_lot::Mutex;
use std::sync::Arc;
-#[derive(Default, Clone)]
+#[derive(Default, Clone, Component)]
struct State {
pub started: Arc<Mutex<bool>>,
}
@@ -13,15 +13,11 @@ async fn main() {
let account = Account::offline("bot");
// or let bot = Account::microsoft("email").await;
- azalea::start(azalea::Options {
- account,
- address: "localhost",
- state: State::default(),
- plugins: plugins![],
- handle,
- })
- .await
- .unwrap();
+ azalea::ClientBuilder::new()
+ .set_handler(handle)
+ .start(account, "localhost")
+ .await
+ .unwrap();
}
async fn handle(bot: Client, event: Event, state: State) -> anyhow::Result<()> {