inline-sdk

0.0.5 • Public • Published

Inline SDK

SDK of the Inline Bot for Node.js

Installation

The Inline SDK can be installed with NPM.

$ npm install inline-sdk

Usage

var SDK = require('inline-sdk');
var CommandType = SDK.CommandType;
var inline = new SDK();

inline.onCommand(function(type, payload) {
  switch(type) {
    case CommandType.MESSAGE:
      inline.sendText('hello');
      break;
    case CommandType.SCHEDULE:
      inline.addSchedule(Date.now() + 1000 * 60 * 5, '5 minutes later');
      break;
    case CommandType.WEBHOOK:
      inline.sendText('hello from webhook');
      break;
    default:
      console.log('Something wrong');
  }
});

License

Copyright (c) 2016, Rollables

Permission to use, copy, modify, and/or distribute this software for any purpose with
or without fee is hereby granted, provided that the above copyright notice and this
permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Package Sidebar

Install

npm i inline-sdk

Weekly Downloads

6

Version

0.0.5

License

ISC

Last publish

Collaborators

  • inlinebot