diff --git a/src/command/say.rs b/src/command/say.rs index 471e694..6f92b75 100644 --- a/src/command/say.rs +++ b/src/command/say.rs @@ -1,16 +1,16 @@ #[derive(Default)] pub struct SayCommand { - message: String + message: Option } impl SayCommand { pub fn message(mut self, msg: impl Into) -> Self { - self.message = msg.into(); + self.message = Some(msg.into()); self } pub fn build(self) -> super::Command { - let message = self.message; + let message = self.message.unwrap_or("Hello, world!".to_string()); let s = format!("say {message}"); super::Command(s) }