Class: Cinch::Plugins::Wit

Inherits:
Object
  • Object
show all
Includes:
Cinch::Plugin
Defined in:
lib/cinch/wit.rb

Instance Method Summary collapse

Instance Method Details

#execute(msg, message) ⇒ Object

Send a message to the Wit API and dispatch an event with the outcome.



17
18
19
20
21
22
# File 'lib/cinch/wit.rb', line 17

def execute(msg, message)
	wit_response = wit_client.message(message.strip)
	outcome = wit_response['outcome']
	debug outcome.to_s
	msg.bot.handlers.dispatch :intent, msg, outcome
end