III Client
Simple API for communicating with the bot of the "iii.ru" service.
Features
- Multiplatform library.
- A small and light library.
- Getting session ID.
- Sending and receiving messages.
Installation
NodeJS:
npm install --save iii-client
Browser:
Using
An example of a connection, receiving session identification and sending a bot message:
; var uuid = '109cd867-0ef3-4473-af71-7543a9b2fccd';var cuid = '0340feab-b09e-4960-96e9-c9518b1fb157';var text = 'Hello, World!'; /* We connect to the system and get a session */; /* Send the message and process the response */;
API
Functions
- connect(uuid, callback)
-
Connection to the service and retrieves the session identifier.
- send(cuid, text, callback)
-
Sends a message to bot and returns a response.
connect(uuid, callback)
Connection to the service and retrieves the session identifier.
Param | Type | Description |
---|---|---|
uuid | String |
Bot ID |
callback | function |
Function handler |
send(uuid, text, callback)
Sends a message to bot and returns a response.
Param | Type | Description |
---|---|---|
uuid | String |
Session ID |
text | String |
The message you are sending |
callback | function |
Function handler |
License
MIT. Copyright (c) Valentin Popov.