Very Popular
Go to Latest
function enhanceStorage
import { enhanceStorage } from "https://dotland.deno.dev/x/grammy@v1.12.5/convenience/session.ts";

You can use this function to transform an existing storage adapter, and add more features to it. Currently, you can add session migrations and expiry dates.

You can use this function like so:

const storage = ... // define your storage adapter
const enhanced = enhanceStorage({ storage, millisecondsToLive: 500 })
bot.use(session({ storage: enhanced }))

Parameters

options: MigrationOptions<T>

Session enhancing options

Returns

StorageAdapter<T>

The enhanced storage adapter