teabot-redis

1.0.0 • Public • Published

teabot-redis License npm npm

Build Status node Test Coverage bitHound Score

teabot-redis a Redis 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-redis --save

You also should install TeaBot and Redis client.

var TeaBot = require('teabot')('TELEGRAM_BOT_TOKEN', 'TELEGRAM_BOT_NAME');
var redis = require('redis');
var client = redis.createClient();
 
TeaBot.use('db', require('teabot-redis')(client));
 
TeaBot.defineCommand(function(dialog, message) {
  dialog.setUserData('some data', 'data'); // data will be stored at Redis db
  dialog.sendMessage('Echo: ' + message.text);
});
 
TeaBot.startPolling();

License

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

Package Sidebar

Install

npm i teabot-redis

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • strikeentco