diff --git a/app/github_app.rb b/app/github_app.rb index e2938c9..8e74f51 100755 --- a/app/github_app.rb +++ b/app/github_app.rb @@ -75,15 +75,11 @@ def sinatra_logger_level logger.debug "Received Slack command: #{payload.inspect}" puts "Received Slack command: #{payload.inspect}" - message = - case payload['event'] - when 'subscribe' - Slack::Subscribe.new.call(payload) - when 'running' - Slack::Running.new.call(payload) - else - 'I am a teapot' - end + message = if payload.key? 'event' + Slack::Running.new.call(payload) + else + Slack::Subscribe.new.call(payload) + end halt 200, message end