Giter VIP home page Giter VIP logo

iii-client's Introduction

III Client

GitHub Release NPM Build Status Codacy Badge Codacy Coverage Badge Gitter Badge

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:

<script src="https://unpkg.com/iii-client@latest/dist/bundle.js">
    /* iiiClient - This is the global name for accessing the package */
</script>

Using

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

import { connect, send } from 'iii-client';

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 */
connect(uuid, (request) => {
    console.info(`Session: ${request.result.cuid}`);
});

/* Send the message and process the response */
send(cuid, text, (answer) => {
    console.info(`Answer: ${answer.result.text.value}`);
});

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

JavaScript Style Guide

MIT. Copyright (c) Valentin Popov.

iii-client's People

Contributors

valentineus avatar

Forkers

evilslesh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.