feature: variants #22

Merged
akulij merged 19 commits from dev into main 2025-06-05 20:53:03 +00:00
Showing only changes of commit 06a6542349 - Show all commits

View File

@ -502,8 +502,6 @@ pub struct BotMessage {
/// flag options to command is meta, so it will be appended to user.metas in db /// flag options to command is meta, so it will be appended to user.metas in db
meta: Option<bool>, meta: Option<bool>,
#[serde(default)]
variants: Vec<MessageVariant>,
handler: Option<BotFunction>, handler: Option<BotFunction>,
} }
@ -566,10 +564,6 @@ impl BotMessage {
pub fn meta(&self) -> bool { pub fn meta(&self) -> bool {
self.meta.unwrap_or(false) self.meta.unwrap_or(false)
} }
pub fn variants(&self) -> &[MessageVariant] {
&self.variants
}
} }
impl BotMessage { impl BotMessage {
@ -642,6 +636,7 @@ pub struct BotDialog {
pub commands: HashMap<String, BotMessage>, pub commands: HashMap<String, BotMessage>,
pub buttons: HashMap<String, BotMessage>, pub buttons: HashMap<String, BotMessage>,
stateful_msg_handlers: HashMap<String, BotMessage>, stateful_msg_handlers: HashMap<String, BotMessage>,
variants: HashMap<String, HashMap<String, BotMessage>>,
} }
impl Parcelable<BotFunction> for BotDialog { impl Parcelable<BotFunction> for BotDialog {