Skip to content

Commit b00795e

Browse files
committed
Update readme: how to add telegram test env
1 parent 14370bd commit b00795e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,20 @@ To run poller in other cases use:
456456
Telegram::Bot::UpdatesPoller.start(bot, controller_class)
457457
```
458458

459+
#### Telegram Test Environment
460+
461+
Telegram provides a dedicated [environment for **bot testing**](https://core.telegram.org/bots/webapps#testing-mini-apps). It allows safe, isolated testing of bot functionality without affecting production data or users.
462+
463+
To send requests to the test environment, insert `/test` **between the bot token and method name** in your API call. This acts as a shorthand "hack" to avoid changing your code structure.
464+
465+
```ruby
466+
# Normal token:
467+
'123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11'
468+
469+
# Modified for test environment:
470+
'123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/test'
471+
```
472+
459473
### Testing
460474

461475
There is a `Telegram::Bot::ClientStub` class to stub client for tests.

0 commit comments

Comments
 (0)