From 2a17c3b4021daa3abe2d9b154303db1d0f8ca6b7 Mon Sep 17 00:00:00 2001 From: wrk Date: Wed, 31 May 2023 01:55:37 +0200 Subject: [PATCH] added action msg format --- src/format.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/format.rs b/src/format.rs index 7d65083..3cfec15 100644 --- a/src/format.rs +++ b/src/format.rs @@ -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 + } }