added action msg format

This commit is contained in:
wrk 2023-05-31 01:55:37 +02:00
parent bebde517ec
commit 2a17c3b402
1 changed files with 5 additions and 0 deletions

View File

@ -66,6 +66,7 @@ impl std::fmt::Display for Color {
}
}
#[derive(Clone)]
pub struct Msg(String);
impl std::fmt::Display for Msg {
@ -96,4 +97,8 @@ impl Msg {
self.0 += &Format::Plain.to_string();
self
}
pub fn as_action(mut self) -> Self {
self.0 = format!("\x01ACTION {}\x01", self.0);
self
}
}