mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2026-05-08 17:40:02 +00:00
SuggestedPosts
A bot that handles the channel Direct Messages (suggested post) approval flow.
Functionality
Monitors suggested post events in a channel connected via Direct Messages. When a post is suggested, the bot automatically schedules a decline after a short delay (demonstrating the decline flow). Paid post events and approval/decline confirmations are also tracked and logged.
Arguments
| Position | Value | Description |
|---|---|---|
| 1 | BOT_TOKEN |
Telegram bot token |
Optional arguments (any order after the token):
| Value | Description |
|---|---|
debug |
Enable verbose debug logging |
testServer |
Connect to the Telegram test server instead of production |
Bot Commands
| Command | Description |
|---|---|
/start |
Initialises the bot and confirms it is running |
Capabilities
- Handles
SuggestedPostApprovedevents - Handles
SuggestedPostDeclinedevents - Handles
SuggestedPostPaidandSuggestedPostRefundedevents - Handles
SuggestedPostApprovalFailederrors - Automatically declines new suggestions after a configurable delay to demonstrate the decline API
- Runs via long polling
Launch
../gradlew run --args="BOT_TOKEN"