From f2fd7924767ab03c92c9b36bcd11db270a2992e9 Mon Sep 17 00:00:00 2001 From: Loisaida Sam Date: Wed, 11 Jun 2014 13:37:48 -0400 Subject: [PATCH 1/3] Updating README with some "Under the Hood" info Specifically about how messages are received/sent --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index ed86d21a..ee0db662 100644 --- a/README.md +++ b/README.md @@ -72,3 +72,37 @@ Optional. A comma-separated list of channels to either be blacklisted or whiteli #### HUBOT\_SLACK\_LINK\_NAMES Optional. By default, Slack will not linkify channel names (starting with a '#') and usernames (starting with an '@'). You can enable this behavior by setting HUBOT_SLACK_LINK_NAMES to 1. Otherwise, defaults to 0. See [Slack API : Message Formatting Docs](https://api.slack.com/docs/formatting) for more information. + +## Under the Hood + +#### Receiving Messages: + +The slack adapter adds a path to the robot's router that will accept POST requests to: + +`/hubot/slack-webhook` + +Source: [https://github.com/tinyspeck/hubot-slack/blob/master/src/slack.coffee#L149-165](https://github.com/tinyspeck/hubot-slack/blob/master/src/slack.coffee#L149-165) + +Expected parameters: + +- text +- user_id +- user_name +- channel_id +- channel_name + +If there is a message and it can deduce an author from those paramters, it'll create a new [TextMessage](https://github.com/github/hubot/blob/master/src/message.coffee#L14) object and have the robot receive it, from there proceeding down the regular hubot path. + +#### Sending Messages + +When a script calls `send()` or `reply()` this adapter makes a POST request to your team's specific URL webhook: + +https://.slack.com/services/hooks/hubot + +with a JSON-formatted body including the following dictionary: + +- username +- channel +- text +- link_names (optionally) + From ce375dc77614b39cec56df164faf5ea3a5326d55 Mon Sep 17 00:00:00 2001 From: Loisaida Sam Date: Wed, 11 Jun 2014 13:38:24 -0400 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee0db662..8bfc3fd8 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ If there is a message and it can deduce an author from those paramters, it'll cr When a script calls `send()` or `reply()` this adapter makes a POST request to your team's specific URL webhook: -https://.slack.com/services/hooks/hubot +`https://.slack.com/services/hooks/hubot` with a JSON-formatted body including the following dictionary: From 093f35cf1eb7beb2a1a9767e6f3452d4c479c71f Mon Sep 17 00:00:00 2001 From: Loisaida Sam Date: Wed, 11 Jun 2014 14:59:47 -0400 Subject: [PATCH 3/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8bfc3fd8..5932bac2 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ The slack adapter adds a path to the robot's router that will accept POST reques `/hubot/slack-webhook` -Source: [https://github.com/tinyspeck/hubot-slack/blob/master/src/slack.coffee#L149-165](https://github.com/tinyspeck/hubot-slack/blob/master/src/slack.coffee#L149-165) +Source: [https://github.com/tinyspeck/hubot-slack/blob/2.1.0/src/slack.coffee#L149-L165](https://github.com/tinyspeck/hubot-slack/blob/2.1.0/src/slack.coffee#L149-L165) Expected parameters: @@ -91,7 +91,7 @@ Expected parameters: - channel_id - channel_name -If there is a message and it can deduce an author from those paramters, it'll create a new [TextMessage](https://github.com/github/hubot/blob/master/src/message.coffee#L14) object and have the robot receive it, from there proceeding down the regular hubot path. +If there is a message and it can deduce an author from those paramters, it'll create a new [TextMessage](https://github.com/github/hubot/blob/v2.7.2/src/message.coffee#L14) object and have the robot receive it, from there proceeding down the regular hubot path. #### Sending Messages