Registry / storage / droff-redis

droff-redis

JSON →
library0.8.15jsnpmunverified

Redis-backed implementations for the droff Discord client, including cache store, rate limit store, and gateway event proxy. Current version 0.8.15 (unstable, pre-1.0). Enables scaling bot logic separately from gateway handling using Redis as a proxy. Key differentiator: provides a complete Redis-backed infrastructure for large Discord bots needing horizontal scaling, unlike simpler in-memory stores. Release cadence is irregular; breaking changes may occur.

npm install droff-redis
INSTALL
IMPORT
SIG · DROFF-REDIS
D
droff-redis
storagejavascriptv0.8.15
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RedisCacheStore
import { RedisCacheStore } from 'droff-redis'
const RedisCacheStore = require('droff-redis')
ESM-only; use ES import syntax.
RedisRateLimiter
import { RedisRateLimiter } from 'droff-redis'
import { RedisRateLimiter } from 'droff-redis/src/rate-limiter'
Direct path imports are not supported.
RedisGatewayProxy
import { RedisGatewayProxy } from 'droff-redis'
import RedisGatewayProxy from 'droff-redis'
Named export, not default.

Initializes Redis stores and proxy for a droff Discord bot, connecting to Redis and starting the bot.

import { RedisCacheStore, RedisRateLimiter, RedisGatewayProxy } from 'droff-redis'; import { createBot } from 'droff'; import { createClient } from 'redis'; const redis = createClient(); await redis.connect(); const cache = new RedisCacheStore(redis); const rateLimiter = new RedisRateLimiter(redis); const proxy = new RedisGatewayProxy(redis); const bot = createBot({ token: process.env.DISCORD_TOKEN ?? '', cache, rateLimiter, }); // Use proxy for scaling proxy.on('message', (msg) => { console.log('Message:', msg); }); await bot.start();
Debug
Known issues
breakingVersion 0.8.x may have breaking changes between minor versions.
fix
Pin to exact version in package.json.
affects: >=0.8.0 <0.9.0
gotchaRedis client must be connected before creating stores.
fix
Always await redis.connect() before constructing droff-redis classes.
affects: *
gotchaGatewayProxy events may not be received if bot logic and gateway are not properly configured.
fix
Ensure proxies are registered before starting the bot.
affects: *
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'on')
GatewayProxy instance used before creation or subscription made after bot start.
fix
Attach event listeners immediately after creating the proxy, before bot.start().
Error: Redis connection refused
Redis server not running or wrong connection string.
fix
Start Redis server or set REDIS_URL env variable.
Upgrade
Version history
0.8.15latest on npm
Audit
Dependencies
droffrequiredPeer dependency; provides core Discord client types and interfaces.
redisrequiredRequired for Redis client connectivity.
Agent activity
29 hits · last 30 days
node
26
Amazon
1
OpenAI (training)
1
Resources
droff-redis — npm install droff-redis · libregistry