1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-15 13:19:30 +00:00

resolution of #484

This commit is contained in:
2021-10-18 14:45:57 +06:00
parent 65c1f018ac
commit 91212eaa3a
25 changed files with 86 additions and 45 deletions

View File

@@ -24,10 +24,13 @@
* Two new dsl:
* `inlineKeyboard` for creating `InlineKeyboardMarkup`
* `replyKeyboard` for creating `ReplyKeyboardMarkup`
* Cast helpers for `Message`:
* Cast helpers for `Message` (thanks to [madhead](https://github.com/madhead)):
* `asPossiblyReplyMessage`: tries to cast a `Message` to `PossiblyReplyMessage`, returns `null` if the message is not of that type
* `requirePossiblyReplyMessage`: casts a `Message` to `PossiblyReplyMessage`, fails if the message is not of that type
* `whenPossiblyReplyMessage`: tries to cast a `Message` to `PossiblyReplyMessage` and runs the given block of code with it, if the cast is successful
* New type `WithUser` for unioning of all types with `user`
* `FromUser` now extends `WithUser`
* Cast helpers for type `WithUser`: `asWithUser`, `whenWithUser`, `requireWithUser`
* `Behaviour Builder`:
* New expecters and waiters:
* `waitShippingQueries`/`onShippingQuery`