Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/grammy/convenience/session.ts>Migrations

The Telegram Bot Framework.
Very Popular
Go to Latest
interface Migrations
import { type Migrations } from "https://deno.land/x/grammy@v1.13.0/convenience/session.ts";

A mapping from version numbers to session migration functions. Each entry in this object has a version number as a key, and a function as a value.

For a key n, the respective value should be a function that takes the previous session data and migrates it to conform with the data that is used by version n. The previous session data is defined by the next key less than n, such as n-1. Versions don't have to be integers, nor do all versions have to be adjacent. For example, you can use [1, 1.5, 4] as versions. If n is the lowest value in the set of keys, the function stored for n can be used to migrate session data that was stored before migrations were used.

Index Signatures

[version: number]: (old: any) => any