teabot-redis
v1.0.0
Published
Redis db plugin for TeaBot
Downloads
1
Maintainers
Readme
teabot-redis
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