0
mirror of https://github.com/valentineus/iii-client.git synced 2025-04-28 01:41:25 +03:00
2017-06-10 20:42:29 +00:00
2017-06-10 20:42:29 +00:00
2017-06-10 20:42:29 +00:00
2017-05-29 07:02:09 +03:00
2017-05-29 01:46:00 +03:00
2017-05-29 07:02:09 +03:00
2017-06-10 20:42:29 +00:00
2017-05-30 16:03:39 +03:00
2017-05-29 01:46:00 +03:00
2017-06-04 19:03:38 +00:00
2017-06-10 20:42:29 +00:00
2017-06-05 16:38:03 +00:00

III Client

npm dependencies Status devDependencies Status

Simple API for communicating with the bot of the "iii.ru" service.

Features

  • A small and light library.
  • Receiving and sending messages.
  • Installation and processing of sessions.

Installation

npm install --save iii-client

Using

To use the bot will require identification number. The bot address can be of two kinds: http://iii.ru/inf/109cd867-0ef3-4473-af71-7543a9b2fccd and http://109cd867-0ef3-4473-af71-7543a9b2fccd.iii.ru/. In the address line, the value 109cd867-0ef3-4473-af71-7543a9b2fccd is the bot identification number.

An example of a connection, receiving session identification and sending a bot message:

import bot from 'iii-client';

var uuid = '109cd867-0ef3-4473-af71-7543a9b2fccd';

// We connect to the system and get a session
bot.connect(uuid, function(data) {
    const options = {
        cuid: data.cuid,
        text: 'Проверка связи. Ты получил моё сообщение?',
    }

    // Send the message and process the response
    bot.send(options, function(raw) {
        console.log(raw);
    });
});

Enjoy!

API

Description of the internal kitchen can be seen on the documentation page.

Found out a mistake or feel a lack of functionality? issues

Examples

License

JavaScript Style Guide

MIT. Copyright (c) Valentin Popov.

Description
Simple API for communicating with the bot of the “iii.ru” service.
Readme 644 KiB
Languages
JavaScript 100%