Skip to content

Commit

Permalink
add OWNER_USERNAME to testbot
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Feb 23, 2024
1 parent 038807e commit 87658ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion azalea/examples/testbot/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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(());
}

Expand Down

0 comments on commit 87658ac

Please sign in to comment.