diff options
Diffstat (limited to 'azalea-client/src/chat.rs')
| -rw-r--r-- | azalea-client/src/chat.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/azalea-client/src/chat.rs b/azalea-client/src/chat.rs index 335261e6..18fa4549 100644 --- a/azalea-client/src/chat.rs +++ b/azalea-client/src/chat.rs @@ -84,8 +84,8 @@ impl Client { /// # } /// ``` pub async fn chat(&self, message: &str) -> Result<(), std::io::Error> { - if message.starts_with('/') { - self.send_command_packet(&message[1..]).await + if let Some(command) = message.strip_prefix('/') { + self.send_command_packet(command).await } else { self.send_chat_packet(message).await } |
