1.1.2 • Published 8 years ago

toby v1.1.2

Weekly downloads
15
License
-
Repository
github
Last release
8 years ago

npm version Build Status

Installation

The easiest way to install toby-node is from NPM. You can run the command below to instally the library:

npm install toby

Or you can clone the source code for toby-node, and install from there.

git clone https://github.com/toby-cloud/toby-node.git
cd toby-node
npm install

Then in your code:

var toby = require("path/to/toby-node");

Testing your installation

Try connecting to Toby with your user bot, like this:

var botId = '{{ username }}'; // Your username from toby.cloud
var secret = '{{ password }}'; // Your password from toby.cloud

var toby = require('toby');

// the callback to be executed when connected
function onConnect() {
  console.log("Connected!");
}

// the callback to be executed when disconnected
function onDisconnect() {
  console.log("Disconnected!");
}

// the callback to be executed when message received
function onMessage(message) {
  console.log("message received:", message.toString());
}

var bot = new toby.Bot(botId, secret, onConnect, onDisconnect, onMessage);
bot.start();
1.1.2

8 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago