pub fn init_context(
    flow: String,
    client: Client,
    apps_endpoint: &Option<String>,
    db: &mut Database,
) -> Context {
    let previous_bot = get_previous_bot(&client, db);

    let api_info = match apps_endpoint {
        Some(value) => Some(ApiInfo {
            client,
            apps_endpoint: value.to_owned(),
        }),
        None => None,
    };

    Context {
        current: HashMap::new(),
        metadata: HashMap::new(),
        api_info,
        hold: None,
        step: ContextStepInfo::Normal("start".to_owned()),
        flow,
        previous_bot,
    }
}
/**
 * Initialize the context object for incoming requests
 */
Initialize the context object for incoming requests
Initialize the context object for incoming requests
pub fn init_context(
    flow: String,
    client: Client,
    apps_endpoint: &Option<String>,
    db: &mut Database,
) -> Context {
    let previous_bot = get_previous_bot(&client, db);
    let api_info = match apps_endpoint {
        Some(value) => Some(ApiInfo {
            client,
            apps_endpoint: value.to_owned(),
        }),
        None => None,
    };
    Context {
        current: HashMap::new(),
        metadata: HashMap::new(),
        api_info,
        hold: None,
        step: ContextStepInfo::Normal("start".to_owned()),
        flow,
        previous_bot,
    }
}
pub fn init_context ( flow : String , client : Client , apps_endpoint : & Option < String > , db : & mut Database , ) -> Context { let previous_bot = get_previous_bot ( & client , db ) ; let api_info = match apps_endpoint { Some ( value ) => Some ( ApiInfo { client , apps_endpoint : value . to_owned ( ) , } ) , None => None , } ; Context { current : HashMap :: new ( ) , metadata : HashMap :: new ( ) , api_info , hold : None , step : ContextStepInfo :: Normal ( " " . to_owned ( ) ) , flow , previous_bot , } }
Initialize the context object for incoming requests
Initialize the context object for incoming requests
flow
String
client
Client
apps_endpoint
&Option<String>
db
&mut Database
flow
String
client
Client
apps_endpoint
&Option<String>
db
&mut Database