Library for easily manage callback-data.
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!