Lonami / grammers

(tele)gramme.rs - use Telegram's API from Rust
https://t.me/gramme_rs
Apache License 2.0
535 stars 103 forks source link

Fix for issue #210 #225

Closed rs-pro0 closed 5 months ago

rs-pro0 commented 5 months ago

Here is my explanation from telegram:

So I looked into issue (https://github.com/Lonami/grammers/issues/210) with is_bot working incorrectly when checking for message.chat(). I think I have a fix. Basically message.chat() just calls utils::always_find_entity, which calls types::Chat::unpack, which for both users and bots just returns empty user with id and access hash. I just made seperate match branch for PackedType::Bot. Not sure if there is a way to make it work better for other fields but at least this field works.