Skip to content

strikeentco/teabot-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Redis db plugin for TeaBot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published