https://github.com/gramiojs/callback-data
Library for easily manage callback-data
https://github.com/gramiojs/callback-data
callback-data gramio telegram telegram-bot telegram-bot-api
Last synced: 10 months ago
JSON representation
Library for easily manage callback-data
- Host: GitHub
- URL: https://github.com/gramiojs/callback-data
- Owner: gramiojs
- License: mit
- Created: 2024-03-24T12:45:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-17T14:53:17.000Z (over 1 year ago)
- Last Synced: 2025-03-25T06:36:35.032Z (over 1 year ago)
- Topics: callback-data, gramio, telegram, telegram-bot, telegram-bot-api
- Language: TypeScript
- Homepage: https://gramio.dev/
- Size: 65.4 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @gramio/callback-data
Library for easily manage callback-data.
[](https://www.npmjs.org/package/@gramio/callback-data)
[](https://jsr.io/@gramio/callback-data)
[](https://jsr.io/@gramio/callback-data)
## Usage with [GramIO](https://gramio.dev/)
```typescript
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
});
```