1.0.0 • Published 8 years ago

teabot-redis v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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