add buttons field to BotDialog

This commit is contained in:
Akulij 2025-05-31 10:33:26 +05:00
parent 39e376195c
commit fdf1e352a6

View File

@ -562,6 +562,7 @@ impl Parcelable<BotFunction> for BotMessage {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct BotDialog {
pub commands: HashMap<String, BotMessage>,
pub buttons: HashMap<String, BotMessage>,
stateful_msg_handlers: HashMap<String, BotMessage>,
}
@ -569,6 +570,7 @@ impl Parcelable<BotFunction> for BotDialog {
fn get_field(&mut self, name: &str) -> Result<ParcelType<BotFunction>, ParcelableError> {
match name {
"commands" => Ok(ParcelType::Parcelable(&mut self.commands)),
"buttons" => Ok(ParcelType::Parcelable(&mut self.buttons)),
"stateful_msg_handlers" => Ok(ParcelType::Parcelable(&mut self.stateful_msg_handlers)),
field => Err(ParcelableError::FieldError(format!(
"tried to get field {field}, but this field does not exists or private"