rust-slack
A rust crate for sending messages to Slack via webhooks.
Slack is a messaging platform for team collaboration.
Upgrading? See the CHANGELOG.
Requires rust 1.15 or newer.
Usage
Add this to your Cargo.toml
:
[]
= "0.4"
Add the crate to your existing project:
extern crate slack_hook;
use ;
Attachments
To create a payload with just an attachment:
extern crate slack_hook;
use ;
Text with Links
Slack messaging API permits you to send links within text. However, given the different formatting rules, these text fragments need to be specified as follows:
extern crate slack_hook;
use ;
use ;
Sending this payload will print the following in slack (note: each element of the Vec
has been
space-separated):
Hello Google, nice to know you.
This technique can be used for any function that has the Into<SlackText>
trait bound.
License
This library is distributed under similar terms to Rust: dual licensed under the MIT license and the Apache license (version 2.0).
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.