|
1 | | -# BusinessConnectionBotBot |
| 1 | +# BusinessConnectionsBot |
2 | 2 |
|
3 | | -When bot connected or disconnected to the business chat, it will notify this chat |
| 3 | +A comprehensive bot that demonstrates the Telegram Business Account API, including message |
| 4 | +management, profile editing, star transfers, story posting, and gift listing. |
| 5 | + |
| 6 | +## Functionality |
| 7 | + |
| 8 | +The bot connects to a business account. When a business connection is established it maps the |
| 9 | +business chat ID to the owner's personal chat so that management commands can be used in the |
| 10 | +personal chat. Messages received via the business connection are forwarded to the owner. |
| 11 | +Typing `PIN` or `UNPIN` in a business message pins or unpins it. A wide set of management commands |
| 12 | +is available in the owner's PM. |
| 13 | + |
| 14 | +## Arguments |
| 15 | + |
| 16 | +| Position | Value | Description | |
| 17 | +|----------|-------|-------------| |
| 18 | +| 1 | `BOT_TOKEN` | Telegram bot token | |
| 19 | + |
| 20 | +Optional arguments (any order after the token): |
| 21 | + |
| 22 | +| Value | Description | |
| 23 | +|-------|-------------| |
| 24 | +| `debug` | Enable verbose debug logging | |
| 25 | +| `testServer` | Connect to the Telegram test server instead of production | |
| 26 | + |
| 27 | +## Bot Commands |
| 28 | + |
| 29 | +| Command | Description | |
| 30 | +|---------|-------------| |
| 31 | +| `/get_business_account_info` | Print account name, username, bio, and other details | |
| 32 | +| `/set_business_account_name` | Set the account's first and last name (prompts for input) | |
| 33 | +| `/set_business_account_username` | Set the account's username (prompts for input) | |
| 34 | +| `/set_business_account_bio` | Set the account bio (auto-resets to the old value after 15 seconds) | |
| 35 | +| `/set_business_account_profile_photo` | Set a private profile photo (send a photo in reply) | |
| 36 | +| `/set_business_account_profile_photo_public` | Set a public profile photo (send a photo in reply) | |
| 37 | +| `/get_business_account_star_balance` | Show the current star balance of the business account | |
| 38 | +| `/transfer_business_account_stars` | Transfer stars from the business account to the bot | |
| 39 | +| `/get_business_account_gifts` | List all gifts received by the business account | |
| 40 | +| `/post_story` | Post a story with a link area (send a photo in reply) | |
| 41 | +| `/delete_story` | Delete the most recently posted story | |
| 42 | + |
| 43 | +## Capabilities |
| 44 | + |
| 45 | +- `BusinessConnection` event handling: maps business chat IDs to personal owner chats |
| 46 | +- Forwards business messages to the owner's PM |
| 47 | +- PIN / UNPIN keyword detection to pin or unpin messages in the business chat |
| 48 | +- Business message deletion tracking |
| 49 | +- Mutex-protected concurrent access to the chat mapping |
| 50 | +- Story creation with `InputStoryContentPhoto` and `StoryAreaTypeLink` |
| 51 | +- Checklist content support |
| 52 | +- Runs via long polling |
4 | 53 |
|
5 | 54 | ## Launch |
6 | 55 |
|
|
0 commit comments