Skip to content

Commit f9c131d

Browse files
update readmes
1 parent 89e1eec commit f9c131d

35 files changed

Lines changed: 1364 additions & 73 deletions

File tree

BoostsInfoBot/README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
1-
# UserChatShared
1+
# BoostsInfoBot
22

3-
Showing info about boosts
3+
A bot that retrieves and displays the boost information for a chat.
4+
5+
## Functionality
6+
7+
On `/start`, the bot sends a reply keyboard with a *Request Channel* button. When the user selects
8+
a channel, the bot calls `getUserChatBoosts` and replies with a formatted list of all active boosts
9+
for that user in the selected chat, including the start and expiration dates of each boost.
10+
11+
## Arguments
12+
13+
| Position | Value | Sample | Description |
14+
|----------|-------|--------|-------------|
15+
| 1 | `BOT_TOKEN` | `1234567890:AABBccDDeeFF` | Telegram bot token |
16+
17+
Optional arguments (any order after the token):
18+
19+
| Value | Description |
20+
|-------|-------------|
21+
| `debug` | Enable verbose debug logging |
22+
| `testServer` | Connect to the Telegram test server instead of production |
23+
24+
## Bot Commands
25+
26+
| Command | Description |
27+
|---------|-------------|
28+
| `/start` | Sends the channel-request keyboard |
29+
30+
## Capabilities
31+
32+
- Reply keyboard with a `RequestChat` button configured for channels
33+
- Retrieves user boost list via `getUserChatBoosts`
34+
- Formats each boost with its add date and expiration date
35+
- Handles `ChatShared` service messages to extract the target chat ID
36+
- Runs via long polling
437

538
## Launch
639

BusinessConnectionsBot/README.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,55 @@
1-
# BusinessConnectionBotBot
1+
# BusinessConnectionsBot
22

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
453

554
## Launch
655

ChatAvatarSetter/README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,41 @@
11
# ChatAvatarSetter
22

3-
This bot will set the chat avatar based on the image sent to bot
3+
A bot that updates a group or channel's avatar using a photo sent to the bot.
4+
5+
## Functionality
6+
7+
When the bot receives a photo message, it downloads the highest-resolution version of the photo
8+
and sets it as the chat photo for the chat the message was sent from. If the operation fails (e.g.,
9+
due to missing admin rights), the bot sends an error message back to the user.
10+
11+
## Arguments
12+
13+
| Position | Value | Description |
14+
|----------|-------|-------------|
15+
| 1 | `BOT_TOKEN` | Telegram bot token |
16+
17+
Optional arguments (any order after the token):
18+
19+
| Value | Description |
20+
|-------|-------------|
21+
| `debug` | Enable verbose debug logging |
22+
| `testServer` | Connect to the Telegram test server instead of production |
23+
24+
## Bot Commands
25+
26+
None.
27+
28+
## Capabilities
29+
30+
- Downloads the largest available photo size from the incoming message
31+
- Calls `setChatPhoto` to apply the downloaded image as the chat's avatar
32+
- Returns a user-facing error message if the update fails
33+
- Runs via long polling
434

535
## Launch
636

737
```bash
838
../gradlew run --args="BOT_TOKEN"
939
```
40+
41+
> **Note:** The bot must be an administrator with *Change group info* permission in the target chat.

ChecklistsBot/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# ChecklistsBot
2+
3+
A bot that handles Telegram premium checklist messages and tracks task completion events.
4+
5+
## Functionality
6+
7+
Listens for messages containing a checklist. When a checklist message is received, the bot sends
8+
a formatted reply showing all tasks with their completion status. It also reacts to task-level
9+
events: when a task is marked as done or a new task is added to an existing checklist, the bot
10+
sends an update reply referencing the affected task.
11+
12+
## Arguments
13+
14+
| Position | Value | Description |
15+
|----------|-------|-------------|
16+
| 1 | `BOT_TOKEN` | Telegram bot token |
17+
18+
Optional arguments (any order after the token):
19+
20+
| Value | Description |
21+
|-------|-------------|
22+
| `debug` | Enable verbose debug logging |
23+
| `testServer` | Connect to the Telegram test server instead of production |
24+
25+
## Bot Commands
26+
27+
None.
28+
29+
## Capabilities
30+
31+
- Detects `ChecklistContent` messages (Telegram Premium feature)
32+
- Formats checklist tasks with ✅ (completed) and ⬜ (pending) indicators
33+
- Handles `ChecklistTasksDone` events — replies when a task is marked complete
34+
- Handles `ChecklistTasksAdded` events — replies when new tasks are appended
35+
- Uses rich text message building for formatted output
36+
- Runs via long polling
37+
38+
## Launch
39+
40+
```bash
41+
../gradlew run --args="BOT_TOKEN"
42+
```

CustomBot/README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,44 @@
11
# CustomBot
22

3-
This bot basically have no any useful behaviour, but you may customize it as a playground
3+
A bot that demonstrates custom middleware, custom subcontext data, and several utility features
4+
of the TelegramBotAPI library.
5+
6+
## Functionality
7+
8+
Shows how to attach a logging middleware to every API request and how to store arbitrary data in
9+
a per-update subcontext. Additionally demonstrates retrieving and sending a user's profile audio
10+
playlist and querying the bot's own star balance.
11+
12+
## Arguments
13+
14+
| Position | Value | Description |
15+
|----------|-------|-------------|
16+
| 1 | `BOT_TOKEN` | Telegram bot token |
17+
18+
Optional arguments (any order after the token):
19+
20+
| Value | Description |
21+
|-------|-------------|
22+
| `debug` | Enable verbose debug logging |
23+
| `testServer` | Connect to the Telegram test server instead of production |
24+
25+
## Bot Commands
26+
27+
| Command | Description |
28+
|---------|-------------|
29+
| `/start` | Retrieves the sender's profile audio files and sends them as an audio media group |
30+
| `/additional_command` | Demo command that accesses and prints custom subcontext data |
31+
| `/getMyStarBalance` | Queries and replies with the bot's current Telegram Star balance |
32+
33+
## Capabilities
34+
35+
- Custom request middleware that logs every outgoing API call
36+
- Custom `BehaviourContext` subcontext with arbitrary stored data
37+
- Profile audio retrieval via `getUserProfilePhotos`-style API for audio
38+
- Audio media group sending (batched uploads)
39+
- Star balance query via `getStarTransactions`
40+
- Channel direct-message configuration tracking via `ChatBoostUpdated` events
41+
- Runs via long polling
442

543
## Launch
644

DeepLinksBot/README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
11
# DeepLinksBot
22

3-
This bot will send you deeplink to this bot when you send some text message and react on the `start` button
3+
A bot that generates and handles Telegram deep links.
4+
5+
## Functionality
6+
7+
Generates a deep link to the bot when the user sends any text message. When a deep link is followed
8+
(i.e., the `/start` command is received with a payload), the bot confirms what payload was received.
9+
10+
## Arguments
11+
12+
| Position | Value | Description |
13+
|----------|-------|-------------|
14+
| 1 | `BOT_TOKEN` | Telegram bot token |
15+
16+
Optional arguments (any order after the token):
17+
18+
| Value | Description |
19+
|-------|-------------|
20+
| `debug` | Enable verbose debug logging |
21+
| `testServer` | Connect to the Telegram test server instead of production |
22+
23+
## Bot Commands
24+
25+
| Command | Description |
26+
|---------|-------------|
27+
| `/start` | Displays a help/welcome message; also handles deep-link payloads |
28+
29+
## Capabilities
30+
31+
- Requires a registered bot username (validates that `getMe` returns a username)
32+
- Generates a `t.me/<username>?start=<payload>` deep link from any incoming text message
33+
- Subscribes to deep-link follow events with `waitDeepLinks()` and confirms the received payload
34+
- Runs via long polling
435

536
## Launch
637

DraftsBot/README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
1-
# Drafts bot
1+
# DraftsBot
22

3-
The main purpose of this bot is just to answer "Oh, hi, " and add user mention here
3+
A bot that demonstrates the message-draft flow API by progressively revealing text to the user.
4+
5+
## Functionality
6+
7+
On `/test_draft_flow`, the bot sends a series of draft text updates to the user, each building
8+
on the previous one, before committing the final message. This illustrates how to use the draft
9+
message API to stream partial content before finalising it.
10+
11+
## Arguments
12+
13+
| Position | Value | Description |
14+
|----------|-------|-------------|
15+
| 1 | `BOT_TOKEN` | Telegram bot token |
16+
17+
Optional arguments (any order after the token):
18+
19+
| Value | Description |
20+
|-------|-------------|
21+
| `debug` | Enable verbose debug logging |
22+
| `testServer` | Connect to the Telegram test server instead of production |
23+
24+
## Bot Commands
25+
26+
| Command | Description |
27+
|---------|-------------|
28+
| `/test_draft_flow` | Starts a draft-message flow that progressively reveals text |
29+
30+
## Capabilities
31+
32+
- Uses the `draftFlow` / `sendDraftMessage` API to emit incremental text updates
33+
- Demonstrates the difference between draft (editable intermediate state) and final message
34+
- Runs via long polling
435

536
## Launch
637

FSMBot/README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,41 @@
1-
# FSM
1+
# FSMBot
22

3-
This bot contains an example of working with FSM included in project
4-
[MicroUtils](https://github.com/InsanusMokrassar/MicroUtils)
3+
A demonstration of the Finite State Machine (FSM) pattern provided by the
4+
[MicroUtils](https://github.com/InsanusMokrassar/MicroUtils) library.
5+
6+
## Functionality
7+
8+
Implements a simple two-state FSM. After `/start` is sent, the bot enters
9+
`ExpectContentOrStopState` and re-sends every message it receives back to the user.
10+
This continues until the user sends `/stop`, at which point the FSM transitions to
11+
`StopState` and content forwarding ends.
12+
13+
## Arguments
14+
15+
| Position | Value | Description |
16+
|----------|-------|-------------|
17+
| 1 | `BOT_TOKEN` | Telegram bot token |
18+
19+
Optional arguments (any order after the token):
20+
21+
| Value | Description |
22+
|-------|-------------|
23+
| `debug` | Enable verbose debug logging |
24+
| `testServer` | Connect to the Telegram test server instead of production |
25+
26+
## Bot Commands
27+
28+
| Command | Description |
29+
|---------|-------------|
30+
| `/start` | Starts the FSM loop — bot begins echoing content back to the user |
31+
| `/stop` | Ends the FSM loop — bot stops echoing |
32+
33+
## Capabilities
34+
35+
- Two-state FSM: `ExpectContentOrStopState``StopState`
36+
- `ExpectContentOrStopState` uses `expectContentOrCommands()` to filter messages
37+
- Erroneous FSM states are caught and handled gracefully
38+
- Runs via long polling
539

640
## Launch
741

0 commit comments

Comments
 (0)