pub fn send_message(&self, text: &str) {
        let text = text.to_owned();
        let (client, storage, devices) =
            (self.inner.clone(), self.storage.clone(), self.devices.clone());

        let call_closure = Box::new(move |c: &HyperClient| {
            let mut message = GenericMessage::new();
            let uuid = utils::uuid_v1();
            message.set_message_id(uuid.to_string());
            let mut txt = Text::new();
            txt.set_content(text.clone());
            message.set_text(txt);
            client.send_encrypted_message(c, &message, storage.clone(), devices.clone())
        });

        self.event_loop_sender.clone().send(call_closure).wait().map_err(|e| {
            error!("Cannot queue user message in event loop: {}", e);
        }).ok();
    }
/// Send a user text message to the conversation associated with the bot instance.
Send a user text message to the conversation associated with the bot instance.
Send a user text message to the conversation associated with the bot instance .
pub fn send_message(&self, text: &str) {
        let text = text.to_owned();
        let (client, storage, devices) =
            (self.inner.clone(), self.storage.clone(), self.devices.clone());
        let call_closure = Box::new(move |c: &HyperClient| {
            let mut message = GenericMessage::new();
            let uuid = utils::uuid_v1();
            message.set_message_id(uuid.to_string());
            let mut txt = Text::new();
            txt.set_content(text.clone());
            message.set_text(txt);
            client.send_encrypted_message(c, &message, storage.clone(), devices.clone())
        });
        self.event_loop_sender.clone().send(call_closure).wait().map_err(|e| {
            error!("Cannot queue user message in event loop: {}", e);
        }).ok();
    }
pub fn send_message ( & self , text : & str ) { let text = text . to_owned ( ) ; let ( client , storage , devices ) = ( self . inner . clone ( ) , self . storage . clone ( ) , self . devices . clone ( ) ) ; let call_closure = Box :: new ( move | c : & HyperClient | { let mut message = GenericMessage :: new ( ) ; let uuid = utils :: uuid_v1 ( ) ; message . set_message_id ( uuid . to_string ( ) ) ; let mut txt = Text :: new ( ) ; txt . set_content ( text . clone ( ) ) ; message . set_text ( txt ) ; client . send_encrypted_message ( c , & message , storage . clone ( ) , devices . clone ( ) ) } ) ; self . event_loop_sender . clone ( ) . send ( call_closure ) . wait ( ) . map_err ( | e | { error ! ( " " e ) ; } ) . ok ( ) ; }
Send a user text message to the conversation associated with the bot instance.
Send a user text message to the conversation associated with the bot instance .
&self
text
&str