diff --git a/README.md b/README.md new file mode 100644 index 0000000..b1dacd7 --- /dev/null +++ b/README.md @@ -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`. diff --git a/src/main.rs b/src/main.rs index 6854298..de8029b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -86,7 +86,7 @@ fn main() -> Result<(), Box> { 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 {