class Lita::Handlers::CleverbotDemo

Public Instance Methods

ask_cleverbot(question) click to toggle source
# File lib/lita/handlers/cleverbot_demo.rb, line 19
def ask_cleverbot(question)
  client.say question
end
client() click to toggle source
# File lib/lita/handlers/cleverbot_demo.rb, line 23
def client
  @_client ||= Cleverbot.new(config.cleverbot_user, config.cleverbot_key)
end
handle_cleverbot(payload) click to toggle source
# File lib/lita/handlers/cleverbot_demo.rb, line 13
def handle_cleverbot(payload)
  clever_input = payload.matches.last

  payload.reply ask_cleverbot(clever_input)
end