diff options
| author | mat <git@matdoes.dev> | 2024-02-22 22:44:05 -0600 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-02-22 22:44:05 -0600 |
| commit | 87658ac4869f1fe458bc87009bc159f8e3362b69 (patch) | |
| tree | 58fa3614a524710c0703b5c0258fb636d828311f /azalea | |
| parent | 038807e607c55757b3d9a9d51f0b9e65a781772b (diff) | |
| download | azalea-drasl-87658ac4869f1fe458bc87009bc159f8e3362b69.tar.xz | |
add OWNER_USERNAME to testbot
Diffstat (limited to 'azalea')
| -rw-r--r-- | azalea/examples/testbot/main.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs index 43e6b179..86395b7e 100644 --- a/azalea/examples/testbot/main.rs +++ b/azalea/examples/testbot/main.rs @@ -28,6 +28,8 @@ use std::time::Duration; const USERNAME: &str = "azalea"; const ADDRESS: &str = "localhost"; +/// The bot will only listen to commands sent by the player with this username. +const OWNER_USERNAME: &str = "py5"; /// Whether the bot should run /particle a ton of times to show where it's /// pathfinding to. You should only have this on if the bot has operator /// permissions, otherwise it'll just spam the server console unnecessarily. @@ -127,7 +129,7 @@ async fn handle(bot: Client, event: azalea::Event, state: State) -> anyhow::Resu let (Some(username), content) = chat.split_sender_and_content() else { return Ok(()); }; - if username != "py5" { + if username != OWNER_USERNAME { return Ok(()); } |
