Module: Pandorified
- Defined in:
- lib/pandorified.rb,
lib/pandorified/result.rb,
lib/pandorified/session.rb,
lib/pandorified/version.rb
Overview
This is the top-level module for interacting with the Pandorabots API.
There are some sugar methods which delegate to Session under the hood.
Defined Under Namespace
Classes: PandorabotsError, Result, Session
Constant Summary collapse
- API_URL =
'https://www.pandorabots.com/pandora/talk-xml'
- VERSION =
'0.9.13'
Class Method Summary collapse
-
.talk(input, botid, custid = nil) ⇒ Pandorified::Result
Send a message to a bot and receive a response.
-
.talk!(input, botid, custid = nil) ⇒ String
Send a message to a bot and receive a response (if successsful).
Class Method Details
.talk(input, botid, custid = nil) ⇒ Pandorified::Result
25 26 27 |
# File 'lib/pandorified.rb', line 25 def self.talk(input, botid, custid = nil) Pandorified::Session.new(botid, custid).talk(input) end |
.talk!(input, botid, custid = nil) ⇒ String
Send a message to a bot and receive a response (if successsful).
If Pandorabots responds with an error, PandorabotsError is raised.
If you’d rather check for and handle the error yourself, use talk instead of this method.
If you want to remember the botid and custid between multiple calls, you should use Pandorabots::Session instead of this method.
45 46 47 |
# File 'lib/pandorified.rb', line 45 def self.talk!(input, botid, custid = nil) Pandorified::Session.new(botid, custid).talk!(input).to_s end |