lita-slack is an adapter for Lita that allows you to use the robot with Slack. As lita-slack is one way, robot messages to Slack, it depends on lita-slack-handler gem to receive messages from Slack.
Add lita-slack and lita-slack-handler to your Lita instance's Gemfile:
gem "lita-slack"
gem "lita-slack-handler"
First, you need to make sure your Slack team has Incoming WebHooks integration setup. For configuration regarding lita-slack-handler, see its README.
Then, define the following attributes:
incoming_token
(String) – Slack integration token.team_domain
(String) – Slack team domain; subdomain of slack.com.
incoming_url
(String) – Default: https://<team_domain>.slack.com/services/hooks/incoming-webhookusername
(String) – Display name of the robot; default: whatever is set in Slack integrationadd_mention
(Bool) – Always prefix message with mention of the user which it's directed to; this triggers a notification.
Lita.configure do |config|
config.robot.name = "Lita"
config.robot.mention_name = "@lita"
# Select the Slack adapter
config.robot.adapter = :slack
# lita-slack adapter config
config.adapter.incoming_token = "aN1NvAlIdDuMmYt0k3n"
config.adapter.team_domain = "example"
config.adapter.username = "lita"
# Some more handlers and other config
# .....
end