update BotNotification specification
This commit is contained in:
parent
57652c2776
commit
91bf739365
@ -604,12 +604,13 @@ impl Parcelable<BotFunction> for BotDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
#[serde(untagged)]
|
||||||
pub enum NotificationTime {
|
pub enum NotificationTime {
|
||||||
Delta(Duration),
|
Delta(isize),
|
||||||
Specific(SpecificTime),
|
Specific(SpecificTime),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
#[serde(try_from = "SpecificTimeFormat")]
|
#[serde(try_from = "SpecificTimeFormat")]
|
||||||
pub struct SpecificTime {
|
pub struct SpecificTime {
|
||||||
hour: u8,
|
hour: u8,
|
||||||
@ -645,18 +646,27 @@ impl TryFrom<SpecificTimeFormat> for SpecificTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Default, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Default, Debug, Clone)]
|
||||||
|
#[serde(untagged)]
|
||||||
pub enum NotificationFilter {
|
pub enum NotificationFilter {
|
||||||
#[default]
|
#[default]
|
||||||
|
#[serde(rename = "all")]
|
||||||
All,
|
All,
|
||||||
/// Send to randomly selected N people
|
/// Send to randomly selected N people
|
||||||
Random(usize),
|
Random { random: u8 },
|
||||||
/// Function that returns list of user id's who should get notification
|
/// Function that returns list of user id's who should get notification
|
||||||
BotFunction(BotFunction),
|
BotFunction(BotFunction),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
#[serde(untagged)]
|
||||||
pub enum NotificationMessage {
|
pub enum NotificationMessage {
|
||||||
Literal(String),
|
Literal {
|
||||||
|
literal: String,
|
||||||
|
},
|
||||||
|
Text {
|
||||||
|
text: String,
|
||||||
|
},
|
||||||
|
/// Function can accept user which will be notified and then return generated message
|
||||||
BotFunction(BotFunction),
|
BotFunction(BotFunction),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user