Skip to content
This repository was archived by the owner on Feb 10, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions grammers-client/src/peer/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,16 @@ impl User {
self.user().map(|u| u.scam).unwrap_or(false)
}

/// Does this user have a Telegram Premium subscription?
pub fn is_premium(&self) -> bool {
self.user().map(|u| u.premium).unwrap_or(false)
}

/// Has this user been flagged as a fake account?
pub fn fake(&self) -> bool {
self.user().map(|u| u.fake).unwrap_or(false)
}

/// The reason(s) why this user is restricted, could be empty.
pub fn restriction_reason(&self) -> Vec<RestrictionReason> {
if let Some(reasons) = self.user().and_then(|u| u.restriction_reason.as_ref()) {
Expand Down