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.



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

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

Instance Method Details

#handle(payload) ⇒ Object



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

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