aboutsummaryrefslogtreecommitdiff
path: root/azalea/examples/echo.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/echo.rs
parentcbcf1d5e54caefb50ec6340aaf1e8a94312a38c8 (diff)
downloadazalea-drasl-d51b2a29b2911e4be480727e56553fa27cfbfce0.tar.xz
fix some swarm examples/docs
Diffstat (limited to 'azalea/examples/echo.rs')
-rwxr-xr-xazalea/examples/echo.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/azalea/examples/echo.rs b/azalea/examples/echo.rs
index f9bafebd..292e12cd 100755
--- a/azalea/examples/echo.rs
+++ b/azalea/examples/echo.rs
@@ -7,15 +7,11 @@ async fn main() {
let account = Account::offline("bot");
// or let account = Account::microsoft("email").await;
- azalea::start(azalea::Options {
- account,
- address: "localhost",
- state: State::default(),
- plugins: plugins![],
- handle,
- })
- .await
- .unwrap();
+ ClientBuilder::new()
+ .set_handler(handle)
+ .start(account, "localhost")
+ .await
+ .unwrap();
}
#[derive(Default, Clone, Component)]
@@ -28,7 +24,7 @@ async fn handle(bot: Client, event: Event, _state: State) -> anyhow::Result<()>
if sender == bot.profile.name {
return Ok(()); // ignore our own messages
}
- bot.chat(&content).await?;
+ bot.chat(&content);
};
}
_ => {}