Class: Lita::Handlers::Wit

Inherits:
Handler
  • Object
show all
Defined in:
lib/lita/handlers/wit.rb

Instance Method Summary collapse

Constructor Details

#initialize(robot) ⇒ Wit

Returns a new instance of Wit.



8
9
10
11
12
# File 'lib/lita/handlers/wit.rb', line 8

def initialize(robot)
  super
  @bickle = Utils::Bickle.new(robot)
  @client = Services::WitClient.new(robot)
end

Instance Method Details

#handle(payload) ⇒ Object



14
15
16
17
18
# File 'lib/lita/handlers/wit.rb', line 14

def handle(payload)
  message = payload[:message]
  return unless @bickle.you_talking_to_me?(message)
  respond(message)
end