GithubHelp home page GithubHelp logo

botkit-storage-redis's Introduction

botkit-storage-redis

A redis storage module for Botkit

Usage

Just require botkit-storage-redis and pass it your config options (or none if your cool with defaults). Then pass the returned storage when creating your Botkit controller. Botkit will do the rest!

Make sure everything you store has an id property, that's what you'll use to look it up later.

var Botkit = require('botkit'),
    redisConfig = {...}
    redisStorage = require('botkit-storage-redis')(redisConfig),
    controller = Botkit.slackbot({
        storage: redisStorage
    });
// then you can use the Botkit storage api, make sure you have an id property
var beans = {id: 'cool', beans: ['pinto', 'garbanzo']};
controller.storage.teams.save(beans);
beans = controller.storage.teams.get('cool');

Options

You can pass any options that are allowed by node-redis.

Additionally you can pass a namespace property which is used to namespace keys in Redis. namespace defaults to botkit:store.

You can also pass a methods property which is an array of additional custom methods you want to add. The default methods are teams, users, and channels.

botkit-storage-redis's People

Contributors

anonrig avatar benbrown avatar colestrode avatar pavel-kurnosov avatar rafaelcosman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

botkit-storage-redis's Issues

Clean up and follow conventions

Move change test folder to tests for consistency with other storage libs.
Move index.js inside src.
Add contributing.md from botkit master.
Add index.js to main folder with module.exports = require('src/index.js')
Oh, and add some usage to the readme

Be consistent with BotKit api

By default, BotKit implements delete on local storage.users object https://github.com/howdyai/botkit/blob/master/lib/storage/simple_storage.js#L73

Botkit-starage-redis has a different implementation, https://github.com/howdyai/botkit-storage-redis/blob/master/src/index.js#L51. Instead of delete we have remove.

A proposal is to rename the remove function to delete function. But, in your case, it would make more sense to support both remove and delete for backward compatibility.

So it would be nice to keep an API consistent with the BotKit.

[Action Needed] This repo is inactive

This GitHub repository has been identified as a candidate for archival

This repository has had no activity in more than [x amount of time]. Long periods of inactivity present security and code hygiene risks. Archiving will not prevent users from viewing or forking the code. A banner will appear on the repository alerting users that the repository is archived.

Please see https://aka.ms/sunsetting-faq to learn more about this process.

Action

✍️

❗**If this repository is still actively maintained, please simply close this issue. Closing an issue on a repository is considered activity and the repository will not be archived.🔒

If you take no action, this repository is still inactive 30 days from today it will be automatically archived..

Need more help? 🖐️

Add travisci integration

Now that we have unit tests, we should consider adding Travis-CI integration. That will ensure pull requests pass linting and unit tests.

Not compatible with Botkit 4

I've tried to use this with Botkit 4, but it fails with error like this:

Experienced an error inside the turn handler TypeError: this.storage.read is not a function
    at Promise.resolve.then (/Users/home/swirl/swirl-app/node_modules/botbuilder-core/src/botState.ts:87:37)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)
(node:43349) UnhandledPromiseRejectionWarning: TypeError: this.storage.read is not a function
    at Promise.resolve.then (/Users/home/swirl/swirl-app/node_modules/botbuilder-core/src/botState.ts:87:37)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)

is this to be expected? Any plans to update this library?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.