Skip to main content

Built and signed on GitHub Actions

Library for easily manage callback-data

This package works with Bun, Cloudflare Workers, Node.js, Deno, Browsers
JSR Score
100%
Published
a month ago (0.0.3)

@gramio/callback-data

Library for easily manage callback-data.

npm JSR JSR Score

WIP. JSON.stringify is temporarily used under the hood.

Usage with GramIO

const someData = new CallbackData("example").number("id");

new Bot()
    .command("start", (context) =>
        context.send("some", {
            reply_markup: new InlineKeyboard().text(
                "example",
                someData.pack({
                    id: 1,
                })
            ),
        })
    )
    .callbackQuery(someData, (context) => {
        context.queryData; // is type-safe
    });

Use is not recommended at this stage!

Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @gramio/callback-data

Import symbol

import * as mod from "@gramio/callback-data";

Add Package

npx jsr add @gramio/callback-data

Import symbol

import * as mod from "@gramio/callback-data";

Add Package

yarn dlx jsr add @gramio/callback-data

Import symbol

import * as mod from "@gramio/callback-data";

Add Package

pnpm dlx jsr add @gramio/callback-data

Import symbol

import * as mod from "@gramio/callback-data";

Add Package

bunx jsr add @gramio/callback-data

Import symbol

import * as mod from "@gramio/callback-data";