Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Make parse mode a config and default to none
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Jan 28, 2016
1 parent 46aa9b5 commit af3586e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Lita.configure do |config|
config.robot.adapter = :slack
config.robot.admins = ["U012A3BCD"]
config.adapters.slack.token = "abcd-1234567890-hWYd21AmMH2UHAkx29vb5c1Y"
config.adapters.slack.parse = "full" # See https://api.slack.com/docs/formatting#parsing_modes
end
```

Expand Down
1 change: 1 addition & 0 deletions lib/lita/adapters/slack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Slack < Adapter
# Required configuration attributes.
config :token, type: String, required: true
config :proxy, type: String
config :parse, type: String

# Provides an object for Slack-specific features.
def chat_service
Expand Down
2 changes: 1 addition & 1 deletion lib/lita/adapters/slack/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def send_messages(channel_id, messages)
as_user: true,
channel: channel_id,
text: messages.join("\n"),
parse: 'full',
parse: config.parse,
)
end

Expand Down
1 change: 1 addition & 0 deletions spec/lita/adapters/slack/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
as_user: true,
channel: room,
text: messages.join("\n"),
parse: nil,
) do
[http_status, {}, http_response]
end
Expand Down

0 comments on commit af3586e

Please sign in to comment.