Skip to content

strikeentco/teabot-aerospike

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

teabot-aerospike License npm npm

Build Status node Test Coverage bitHound Score

teabot-aerospike an Aerospike db plugin for TeaBot.

By default, all data is stored in memory, but for synchronization between servers or nodes, you can use this plugin.

Usage

$ npm install teabot-aerospike --save

You also should install TeaBot and Aerospike client.

var TeaBot = require('teabot')('TELEGRAM_BOT_TOKEN', 'TELEGRAM_BOT_NAME');
var aerospike = require('aerospike');
var client = aerospike.client({
  hosts: [{
    addr: '127.0.0.1',
    port: 4000,
  }]
}).connect(function(response) {
  if (response.code == 0) {
    console.log('Connection to Aerospike cluster succeeded!');
  }
});

TeaBot.use('db', require('teabot-aerospike')(client));

TeaBot.defineCommand(function(dialog, message) {
  dialog.setUserData('some data', 'data'); // data will be stored at Aerospike db
  dialog.sendMessage('Echo: ' + message.text);
});

TeaBot.startPolling();

License

The MIT License (MIT)
Copyright (c) 2016 Alexey Bystrov

About

Aerospike db plugin for TeaBot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published