mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2026-08-17 14:46:12 +00:00
New BotSubscriptionsBot demonstrating the 36.0.0 subscription-updates API: - onBotSubscriptionUpdated trigger reading user / invoicePayload / state - exhaustive handling of the typed BotSubscriptionUpdated.State sealed type (Active / Canceled / Failed data objects + Unknown value-class fallback) - botSubscriptionUpdatedUpdatesFlow raw update flow - waitBotSubscriptionUpdated expectation Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
13 lines
412 B
Markdown
13 lines
412 B
Markdown
# BotSubscriptionsBot
|
|
|
|
Demonstrates Bot Subscriptions (subscription updates) support introduced in Telegram Bot API 10.2.
|
|
|
|
The bot logs and reacts to `subscription` updates — when a user's recurring Telegram Stars subscription to
|
|
the bot becomes active, is canceled, or fails — handling the typed `BotSubscriptionUpdated.State`.
|
|
|
|
## Launch
|
|
|
|
```bash
|
|
../gradlew :BotSubscriptionsBot:run --args="BOT_TOKEN"
|
|
```
|