mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-11 04:21:12 +01:00
Merge pull request #184 from mikhailantoshkin/master
Add missing enum variants to the `Update::chat()`
This commit is contained in:
commit
3f2906df62
2 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue