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.
$ 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();
The MIT License (MIT)
Copyright (c) 2016 Alexey Bystrov