docomochatter
Docomo Zatsudan(雑談) API Client.
Requirement
- Node v0.12 or more
- Docomo API key (Get it here)
Usage
Set docomo API key to the environment variable, DOCOMO_API_KEY
, then instantiate the object and call create_dialogue()
with your message. create_dialogue()
returns Promise, so you can chain methods by using .then()
and .catch()
.
var Docomochatter = ; client = processenvDOCOMO_API_KEY;client;
via CoffeeScript
Docomochatter = require'docomochatter' client = processenvDOCOMO_API_KEYclientcreate_dialogue'hello' then consolelog responseutt catch consolelog error
Sample API response
{ utt: 'はろー',
yomi: 'はろー',
mode: 'dialog',
da: '30',
context: 'mnqsaABy9i7ByZBB6QxU9Q' }