Struct slack::Sender [−][src]
pub struct Sender { /* fields omitted */ }
Thread-safe API for sending messages asynchronously
Methods
impl Sender
[src]
impl Sender
pub fn get_msg_uid(&self) -> usize
[src]
pub fn get_msg_uid(&self) -> usize
Get the next message id
A value returned from this method must be included in the JSON payload
(the id
field) when constructing your own message.
pub fn send(&self, raw: &str) -> Result<(), Error>
[src]
pub fn send(&self, raw: &str) -> Result<(), Error>
Send a raw message
Must set message.id
using result of get_msg_id()
.
Success from this API does not guarantee the message is delivered successfully since that runs on a separate task.
pub fn send_message(&self, channel_id: &str, msg: &str) -> Result<usize, Error>
[src]
pub fn send_message(&self, channel_id: &str, msg: &str) -> Result<usize, Error>
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
.
pub fn send_typing(&self, channel_id: &str) -> Result<usize, Error>
[src]
pub fn send_typing(&self, channel_id: &str) -> Result<usize, Error>
Marks connected client as being typing to a channel This is mostly used to signal to other peers that a message is being typed. Will have the server send a "user_typing" message to all the peers. Slack doc can be found at https://api.slack.com/rtm under "Typing Indicators"
channel_id
is the slack channel id, e.g. UXYZ1234
, not #general
.
pub fn shutdown(&self) -> Result<(), Error>
[src]
pub fn shutdown(&self) -> Result<(), Error>
Shutdown RtmClient