feature: variants #22
@ -1,5 +1,6 @@
|
||||
pub mod application;
|
||||
pub mod db;
|
||||
pub mod message_info;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{Arc, Mutex, PoisonError};
|
||||
use std::time::Duration;
|
||||
|
||||
27
src/botscript/message_info.rs
Normal file
27
src/botscript/message_info.rs
Normal file
@ -0,0 +1,27 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Serialize, Deserialize, Default, Debug, Clone)]
|
||||
pub struct MessageInfo {
|
||||
variant: Option<String>,
|
||||
}
|
||||
|
||||
pub struct MessageInfoBuilder {
|
||||
inner: MessageInfo,
|
||||
}
|
||||
|
||||
impl MessageInfoBuilder {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
inner: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_variant(mut self, variant: Option<String>) -> Self {
|
||||
self.inner.variant = variant;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn build(self) -> MessageInfo {
|
||||
self.inner
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user