From d51b2a29b2911e4be480727e56553fa27cfbfce0 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 6 Feb 2023 19:15:41 +0000 Subject: fix some swarm examples/docs --- azalea/examples/echo.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'azalea/examples/echo.rs') 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); }; } _ => {} -- cgit v1.2.3