Module

x/grammy/mod.ts>StorageAdapter

The Telegram Bot Framework.
Go to Latest
interface StorageAdapter
import { type StorageAdapter } from "https://deno.land/x/grammy@v1.10.1/mod.ts";

A storage adapter is an abstraction that provides read, write, and delete access to a storage solution of any kind. Storage adapters are used to keep session middleware independent of your database provider, and they allow you to pass your own storage solution.

Properties

read: (key: string) => MaybePromise<T | undefined>

Reads a value for the given key from the storage. May return the value or undefined, or a promise of either.

write: (key: string, value: T) => MaybePromise<void>

Writes a value for the given key to the storage.

delete: (key: string) => MaybePromise<void>

Deletes a value for the given key from the storage.