Merge pull request #184 from mikhailantoshkin/master

Add missing enum variants to the `Update::chat()`
This commit is contained in:
Waffle Maybe 2022-02-20 21:22:47 +03:00 committed by GitHub
commit 3f2906df62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## unreleased
### Fixed
- `Update::chat()` now returns `Some(&Chat)` for `UpdateKind::ChatMember`, `UpdateKind::MyChatMember`,
`UpdateKind::ChatJoinRequest` ([#184][pr184])
[pr184]: https://github.com/teloxide/teloxide-core/pull/184
## 0.4.2 - 2022-02-17
### Deprecated

View file

@ -50,6 +50,9 @@ impl Update {
UpdateKind::ChannelPost(p) => Some(&p.chat),
UpdateKind::EditedChannelPost(p) => Some(&p.chat),
UpdateKind::CallbackQuery(q) => Some(&q.message.as_ref()?.chat),
UpdateKind::ChatMember(m) => Some(&m.chat),
UpdateKind::MyChatMember(m) => Some(&m.chat),
UpdateKind::ChatJoinRequest(c) => Some(&c.chat),
_ => None,
}
}