aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/chat.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-client/src/chat.rs')
-rwxr-xr-xazalea-client/src/chat.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/azalea-client/src/chat.rs b/azalea-client/src/chat.rs
index 0ae0250a..90618c80 100755
--- a/azalea-client/src/chat.rs
+++ b/azalea-client/src/chat.rs
@@ -108,6 +108,16 @@ impl ChatPacket {
overlay: false,
}))
}
+
+ /// Whether this message was sent with /msg (or aliases). It works by
+ /// checking the translation key, so it won't work on servers that use their
+ /// own whisper system.
+ pub fn is_whisper(&self) -> bool {
+ match self.message() {
+ FormattedText::Text(_) => false,
+ FormattedText::Translatable(t) => t.key == "commands.message.display.incoming",
+ }
+ }
}
impl Client {