class Cinch::Plugins::Wit

Public Instance Methods

execute(msg, message) click to toggle source

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

# 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

Private Instance Methods

wit_client() click to toggle source
# File lib/cinch/wit.rb, line 26
def wit_client
  @wit_client ||= ::Wit::Client.new(config[:access_token])
end