mc-rcon/src/command/say.rs
2026-07-28 17:34:33 +02:00

17 lines
No EOL
410 B
Rust

#[derive(Default)]
pub struct SayCommand {
message: Option<String>
}
impl SayCommand {
pub fn message(mut self, msg: impl Into<String>) -> Self {
self.message = Some(msg.into());
self
}
pub fn build(self) -> super::Command {
let message = self.message.unwrap_or("Hello, world!".to_string());
let s = format!("say {message}");
super::Command(s)
}
}