grammyjs-storage-redis-json-read
v1.0.1
Published
Storage adapter that can be used to [store your session data](https://grammy.dev/plugins/session.html) in [Redis](https://redis.io/) when using sessions.
Downloads
118
Readme
Redis storage adapter for grammY
Storage adapter that can be used to store your session data in Redis when using sessions.
Installation
Node
npm install grammyjs-storage-redis-json-read ioredis --save
npm install @types/ioredis -D
import { RedisAdapter } from "grammyjs-storage-redis-json-read";
import IORedis from "ioredis";
Deno
import { RedisAdapter } from "https://deno.land/x/grammy_storages/redis/src/mod.ts";
import { connect } from "https://deno.land/x/[email protected]/mod.ts";
Usage
You can check examples folder
Vendor Examples
Vercel KV (Upstash)
import { kv as instance } from "@vercel/kv";
import { RedisAdapter } from "grammyjs-storage-redis-json-read";
instance.opts.automaticDeserialization = false;
const storage = new RedisAdapter({instance});
bot.use(session({storage}));