Merge pull request #352 from teloxide/updating-guide-v0.4.0

Embed an updating guide to v0.4.0 (README.md)
This commit is contained in:
Hirrolot 2021-03-26 10:35:23 -07:00 committed by GitHub
commit 6885e4ab3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View file

@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [unreleased]
## [0.4.0] - 2021-03-19
## [0.4.0] - 2021-03-22
### Added
- Integrate [teloxide-core].

View file

@ -1,3 +1,19 @@
<details>
<summary>FYI: Updating from v0.3.4 to v0.4.0</summary>
- `answer_str` -> `answer`
- `msg.text_owned()` -> `msg.map(ToOwned::to_owned)`
- Use `.auto_send()` to construct your bot: `let bot = Bot::from_env().auto_send();`. This allows not to write `.send()` after each request; now it is done automatically. Also, rewrite `UpdateWithCx<Message>` -> `UpdateWithCx<AutoSend<Bot>, Message>`.
- `ResponseResult<()>` -> `Result<(), Box<dyn Error + Send + Sync>>` (or import `ResponseResult` beforehand: `use teloxide::requests::ResponseResult;`)
- Tokio updated to v1.2.
Note: this list is non-exhaustive; for the full list of changes, see the [teloxide-core changelog] and [teloxide changelog].
[teloxide-core changelog]: https://github.com/teloxide/teloxide-core/blob/master/CHANGELOG.md
[teloxide changelog]: CHANGELOG.md
</details>
<div align="center">
<img src="ICON.png" width="250"/>
<h1>teloxide</h1>
@ -178,7 +194,7 @@ async fn main() {
</div>
### Dialogues management
A dialogue is described by an enumeration where each variant is one of possible dialogue's states. There are also _subtransition functions_, which turn a dialogue from one state to another, thereby forming a [FSM].
A dialogue is described by an enumeration where each variant is one of possible dialogue's states. There are also _subtransition functions_, which turn a dialogue from one state to another, thereby forming an [FSM].
[FSM]: https://en.wikipedia.org/wiki/Finite-state_machine