pub fn send_message(&self, channel_id: &str, msg: &str) -> Result<usize, Error> {
        let n = self.get_msg_uid();
        let msg_json = serde_json::to_string(&msg)?;
        let mstr = format!(r#"{{"id": {},"type": "message", "channel": "{}","text": "{}"}}"#,
                           n,
                           channel_id,
                           &msg_json[1..msg_json.len() - 1]);

        self.send(&mstr[..])
            .map_err(|err| Error::Internal(format!("{}", err)))?;

        Ok(n)
    }
/// Send a message to the specified channel id
///
/// Success from this API does not guarantee the message is delivered
/// successfully since that runs on a separate task.
///
/// `channel_id` is the slack channel id, e.g. `UXYZ1234`, *not* `#general`.
///
/// Only valid after `RtmClient::run`.
Send a message to the specified channel id
Success from this API does not guarantee the message is delivered
successfully since that runs on a separate task.

`channel_id` is the slack channel id, e.g.

Only valid after `RtmClient::run`.
Send a message to the specified channel id Success from this API does not guarantee the message is delivered successfully since that runs on a separate task . ` channel_id ` is the slack channel id e . g . Only valid after ` RtmClient :: run ` .
pub fn send_message(&self, channel_id: &str, msg: &str) -> Result<usize, Error> {
        let n = self.get_msg_uid();
        let msg_json = serde_json::to_string(&msg)?;
        let mstr = format!(r#"{{"id": {},"type": "message", "channel": "{}","text": "{}"}}"#,
                           n,
                           channel_id,
                           &msg_json[1..msg_json.len() - 1]);
        self.send(&mstr[..])
            .map_err(|err| Error::Internal(format!("{}", err)))?;
        Ok(n)
    }
pub fn send_message ( & self , channel_id : & str , msg : & str ) -> Result < usize , Error > { let n = self . get_msg_uid ( ) ; let msg_json = serde_json :: to_string ( & msg ) ? ; let mstr = format ! ( r#"{{"id": {},"type": "message", "channel": "{}","text": "{}"}}"# n channel_id msg_json [ 1 msg_json len ( ) 1 ] ) ; self . send ( & mstr [ .. ] ) . map_err ( | err | Error :: Internal ( format ! ( " " err ) ) ) ? ; Ok ( n ) }
Send a message to the specified channel id
Success from this API does not guarantee the message is delivered
successfully since that runs on a separate task.
Send a message to the specified channel id Success from this API does not guarantee the message is delivered successfully since that runs on a separate task .
&self
channel_id
&str
msg
&str
&self
channel_id
&str
msg
&str