Lonami / grammers

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

message.chat().username() always None #212

Closed AIPACMan closed 10 months ago

AIPACMan commented 10 months ago

Is this the correct behavior when a user writes for the first time, then message.chat().username() == Some('Username'). But when the same user writes subsequent messages, message.chat().username() is always None

Lonami commented 10 months ago

Sounds about right. Telegram doesn't include all sender information because it assumes you already have it. Only way to solve it would be to either add a cache to grammers (not happening, that has a lot of other problems to solve) or always make a request (wasteful, some users won't need it).

Therefore, there's nothing to do here. Code should rely on the ID, not the username.