add buttons field to BotDialog
This commit is contained in:
parent
39e376195c
commit
fdf1e352a6
@ -562,6 +562,7 @@ impl Parcelable<BotFunction> for BotMessage {
|
|||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub struct BotDialog {
|
pub struct BotDialog {
|
||||||
pub commands: HashMap<String, BotMessage>,
|
pub commands: HashMap<String, BotMessage>,
|
||||||
|
pub buttons: HashMap<String, BotMessage>,
|
||||||
stateful_msg_handlers: 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> {
|
fn get_field(&mut self, name: &str) -> Result<ParcelType<BotFunction>, ParcelableError> {
|
||||||
match name {
|
match name {
|
||||||
"commands" => Ok(ParcelType::Parcelable(&mut self.commands)),
|
"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)),
|
"stateful_msg_handlers" => Ok(ParcelType::Parcelable(&mut self.stateful_msg_handlers)),
|
||||||
field => Err(ParcelableError::FieldError(format!(
|
field => Err(ParcelableError::FieldError(format!(
|
||||||
"tried to get field {field}, but this field does not exists or private"
|
"tried to get field {field}, but this field does not exists or private"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user