diff --git a/src/botscript.rs b/src/botscript.rs index 81dc3ac..f455f8c 100644 --- a/src/botscript.rs +++ b/src/botscript.rs @@ -574,6 +574,15 @@ pub struct RunnerConfig { pub dialog: BotDialog, } +impl RunnerConfig { + /// command without starting `/` + pub fn get_command_message(&self, command: &str) -> Option { + let bm = self.dialog.commands.get(command).cloned(); + + bm.map(|bm| bm.fill_literal(command.to_string())) + } +} + impl Parcelable for RunnerConfig { fn get_field(&mut self, name: &str) -> Result, ParcelableError> { match name {