Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
motemen committed Nov 21, 2019
1 parent 96716f8 commit 97d3745
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# slack-stream-json

Prints Slack's [Real Time Messaging](https://api.slack.com/rtm) (RTM) API streams to stdout.

## Usage

Set `SLACK_TOKEN` environment variable to a token for RTM API, for example obtained from [Legacy Tokens](https://api.slack.com/custom-integrations/legacy-tokens]) page. Once invoked, slack-stream-json prints RTM event JSON line by line.

slack-stream-json 0.1.0

USAGE:
slack-stream-json [FLAGS]

FLAGS:
-f, --format-message Resolve Slack message format, including mentions and links
-h, --help Prints help information
-i, --inflate-fields Inflate "user", "channel" ID fields to corresponding JSON objects
-p, --print-start-response Print rtm.start response JSON before starting RTM stream
-V, --version Prints version information

## Install

* Download binaries from [Releases](https://github.com/motemen/slack-stream-json/releases), or
* Clone this repository and install by `cargo install`.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let message = websocket.read_message()?;

if let tungstenite::Message::Text(text) = message {
// TODO: handle events like "channel_created" to update id_to_object
// TODO: handle events like "team_join", channel_created" to update id_to_object
// TODO: handle "goodbye" event
let mut v: JSONValue = serde_json::from_str(&text)?;
if opt.inflate_fields {
Expand Down

0 comments on commit 97d3745

Please sign in to comment.