jubot.adapter.slack

Jubot adapter for Slack.
https://slack.com/

->SlackAdapter

(->SlackAdapter name server handler)
Positional factory function for class jubot.adapter.slack.SlackAdapter.

app

map->SlackAdapter

(map->SlackAdapter m__5869__auto__)
Factory function for class jubot.adapter.slack.SlackAdapter, taking a map of keywords to field values.

not-from-slackbot

(not-from-slackbot username text)
If the user name of inputted message is "slackbot", return text as it is.
If that's not the case, return nil.

Params
  username - The user name of inputted message.
  text     - Message from user.
Return
  Text string or nil.

process-input

(process-input this handler-fn params)
Process input from Slack.

Params
  this       - REPL adapter.
  handler-fn - A handler function.
  params     - POST parameters.
    {:channel_id   "xxxxxxxxx",
     :token        "xxxxxxxxx",
     :channel_name "test",
     :user_id      "xxxxxxxxx",
     :team_id      "xxxxxxxxx",
     :service_id   "xxxxxxxxx",
     :user_name    "slackbot",
     :team_domain  "uochan",
     :timestamp    "1422058599.000004",
     :text         "foo bar"}
Return
  JSON string or empty string.

process-output

(process-output this text & {:keys [as icon-url]})
Process output to Slack.

Params
  this        - Slack adapter.
    :name     - Bot's name.
  text        - Output text to Slack.
  option
    :as       - Overwrite bot's name if you specify this option.
    :icon-url - Customized icon URL.

valid-outgoing-token

(valid-outgoing-token token text)
If the outgoing token is valid, return text as it is.
If that's not the case, return nil.

Params
  token - Outgoing token passed from slack.
  text  - Message from user.
Return
  Text string or nil.

wrap-adapter

(wrap-adapter handler adapter bot-handler)
Ring middleware to wrap jubot adapter on request.

Params
  handler     - A ring handler.
  adapter     - A jubot adapter.
  bot-handler - A jubot handler function.
Return
  A ring handler.