Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not log connection on reconnect. #229

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### 0.12.1 (Next)

* [#229](https://github.com/slack-ruby/slack-ruby-bot/pull/142): Do not log connection on reconnect - [@dblock](https://github.com/dblock).
* [#209](https://github.com/slack-ruby/slack-ruby-bot/pull/209): Allow `respond_to_slack_message` and `respond_to_slack_messages` without arguments - [@dblock](https://github.com/dblock).
* [#216](https://github.com/slack-ruby/slack-ruby-bot/pull/216): Added `start_typing` RSpec matcher - [@dblock](https://github.com/dblock).
* [#214](https://github.com/slack-ruby/slack-ruby-bot/pull/214): Add passenger deployment documentation - [@cybercrediators](https://github.com/cybercrediators).
Expand Down
3 changes: 3 additions & 0 deletions lib/slack-ruby-bot/hooks/hello.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ module SlackRubyBot
module Hooks
class Hello
attr_accessor :logger
attr_accessor :connected_at

def initialize(logger)
self.logger = logger
end

def call(client, _data)
return unless client && client.team
return if connected_at
logger.info "Successfully connected team #{client.team.name} (#{client.team.id}) to https://#{client.team.domain}.slack.com."
@connected_at = Time.now.utc
end
end
end
Expand Down