diff options
| author | mat <git@matdoes.dev> | 2026-03-18 16:28:46 -1030 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2026-03-20 04:21:58 -0200 |
| commit | 25cd1c0b60604655b70d70f8ec33a54853905eea (patch) | |
| tree | 28911045f6d69b2fffcb8d9c5a92fe32657b5e4b /azalea/examples/testbot | |
| parent | b03d2942e1bef98e13acadde5cbb8856a3f8c74d (diff) | |
| download | azalea-drasl-25cd1c0b60604655b70d70f8ec33a54853905eea.tar.xz | |
optimize pathfinder swarms and write perf guide
Diffstat (limited to 'azalea/examples/testbot')
| -rw-r--r-- | azalea/examples/testbot/killaura.rs | 2 | ||||
| -rw-r--r-- | azalea/examples/testbot/main.rs | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/azalea/examples/testbot/killaura.rs b/azalea/examples/testbot/killaura.rs index 4f29a0f2..136ae7dd 100644 --- a/azalea/examples/testbot/killaura.rs +++ b/azalea/examples/testbot/killaura.rs @@ -6,7 +6,7 @@ use azalea::{ use crate::State; -pub fn tick(bot: Client, state: State) -> anyhow::Result<()> { +pub fn tick(bot: Client, state: State) -> eyre::Result<()> { if !state.killaura { return Ok(()); } diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs index f5f6c096..57bdcc72 100644 --- a/azalea/examples/testbot/main.rs +++ b/azalea/examples/testbot/main.rs @@ -73,8 +73,8 @@ async fn main() -> AppExit { builder .join_delay(Duration::from_millis(100)) .set_swarm_state(SwarmState { - args, - commands: Arc::new(commands), + args: args.into(), + commands: commands.into(), }) // .add_plugins(mspt::MsptPlugin) .start(join_address) @@ -128,11 +128,11 @@ impl State { #[derive(Clone, Default, Resource)] struct SwarmState { - pub args: Args, + pub args: Arc<Args>, pub commands: Arc<CommandDispatcher<Mutex<CommandSource>>>, } -async fn handle(bot: Client, event: azalea::Event, state: State) -> anyhow::Result<()> { +async fn handle(bot: Client, event: azalea::Event, state: State) -> eyre::Result<()> { let swarm = bot.resource::<SwarmState>(); match event { @@ -201,7 +201,7 @@ async fn handle(bot: Client, event: azalea::Event, state: State) -> anyhow::Resu Ok(()) } -async fn swarm_handle(_swarm: Swarm, event: SwarmEvent, _state: SwarmState) -> anyhow::Result<()> { +async fn swarm_handle(_swarm: Swarm, event: SwarmEvent, _state: SwarmState) -> eyre::Result<()> { match &event { SwarmEvent::Disconnect(account, _join_opts) => { println!("bot got kicked! {}", account.username()); |
