impl RunnerConfig::get_command_message

This commit is contained in:
Akulij 2025-05-23 16:27:06 +05:00
parent 31e78be68f
commit 1ff86f641f

View File

@ -574,6 +574,15 @@ pub struct RunnerConfig {
pub dialog: BotDialog,
}
impl RunnerConfig {
/// command without starting `/`
pub fn get_command_message(&self, command: &str) -> Option<BotMessage> {
let bm = self.dialog.commands.get(command).cloned();
bm.map(|bm| bm.fill_literal(command.to_string()))
}
}
impl Parcelable<BotFunction> for RunnerConfig {
fn get_field(&mut self, name: &str) -> Result<ParcelType<BotFunction>, ParcelableError> {
match name {