Add lita-slack to your Lita instance's Gemfile:
token(String) – The bot's Slack API token. Create a bot and get its token at https://my.slack.com/services/new/lita.
proxy(String) – Specify a HTTP proxy URL. (e.g. "http://squid.example.com:3128")
Note: When using lita-slack, the adapter will overwrite the bot's name and mention name with the values set on the server, so
config.robot.mention_name will have no effect.
Each Slack user has a unique ID that never changes even if their real name or username changes. To populate the
config.robot.admins attribute, you'll need to use these IDs for each user you want to mark as an administrator. If you're using Lita version 4.1 or greater, you can get a user's ID by sending Lita the command
users find NICKNAME_OF_USER.
Lita.configure do |config| config.robot.adapter = :slack config.robot.admins = ["U012A3BCD"] config.adapters.slack.token = "abcd-1234567890-hWYd21AmMH2UHAkx29vb5c1Y" end
Lita will join your default channel after initial setup. To have it join additional channels or private groups, simply invite it to them via your Slack client as you would any normal user.
:connected- When the robot has connected to Slack. No payload.
:disconnected- When the robot has disconnected from Slack. No payload.