Class: Lita::Handlers::CleverbotDemo
- Inherits:
-
Handler
- Object
- Handler
- Lita::Handlers::CleverbotDemo
- Defined in:
- lib/lita/handlers/cleverbot_demo.rb
Instance Method Summary collapse
Instance Method Details
#ask_cleverbot(question) ⇒ Object
19 20 21 |
# File 'lib/lita/handlers/cleverbot_demo.rb', line 19 def ask_cleverbot(question) client.say question end |
#client ⇒ Object
23 24 25 |
# File 'lib/lita/handlers/cleverbot_demo.rb', line 23 def client @_client ||= Cleverbot.new(config.cleverbot_user, config.cleverbot_key) end |
#handle_cleverbot(payload) ⇒ Object
13 14 15 16 17 |
# 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 |