Sha256: d311062f087f16386ee7c7f4e9df19526b7ec4559c6239c54ad3dbf84af49055

Contents?: true

Size: 370 Bytes

Versions: 6

Compression:

Stored size: 370 Bytes

Contents

class Bot::BotController < ActionController::Base
  def notify
    @responses = bot_handler.handle(messages).compact

    adapter.send_messages(@responses) if @responses.present?

    render json: []
  end

  private

  def messages
    Array.wrap(params[:messages])
  end

  def adapter
    Bot.configuration.adapter
  end

  def bot_handler
    params[:bot]
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bot-0.0.22 app/controllers/bot/bot_controller.rb
bot-0.0.20 app/controllers/bot/bot_controller.rb
bot-0.0.19 app/controllers/bot/bot_controller.rb
bot-0.0.18 app/controllers/bot/bot_controller.rb
bot-0.0.17 app/controllers/bot/bot_controller.rb
bot-0.0.16 app/controllers/bot/bot_controller.rb