Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 1014 Bytes

README.md

File metadata and controls

32 lines (25 loc) · 1014 Bytes

@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!