Number of bot's active users, if available
Color that should be used when rendering replies to their messages and web previews sent by them, as well as to render the chat title
User's or bot's assigned DC (data center). Available only in case the user has set a public profile photo.
Note: this information is approximate; it is based on where Telegram stores a user profile pictures and does not by any means tell you the user location (i.e. a user might travel far away, but will still connect to its assigned DC). More info at Pyrogram FAQ.
User's display name.
First name and last name if available, only first name otherwise.
User's emoji status, if any.
User's or bot's first name
Whether this bot has a main app
Unique identifier for this user or bot
Get this user's input peer for advanced use-cases.
Note: for min users, this method will return
mtcute.dummyInputPeerMinUser
, which is actually not a valid input peer. These are used to indicate that the user is incomplete, and a message reference is needed to resolve the peer.Such objects are handled by TelegramClient.resolvePeer method, so prefer using it whenever you need an input peer.
Whether this user is a bot
Whether this bot can be edited by the current user
Whether this bot offers an attachment menu web app
Whether this user is a bot that has access to all messages
Whether this user is a bot that can't be added to chats
Whether this user is a bot that can be connected to a Telegram Business account to receive its messages
Whether this user is in yout "close friends" list
Whether this user is in your contacts
Whether this user is deleted
Whether this user has been flagged for impersonation
Whether this user's information is incomplete.
This usually only happens in large chats, where the server sometimes sends only a part of the user's information. Basic info like name and profile photo are always available, but other fields may be omitted despite being available.
For a rough list of fields that may be missing, see the official docs.
This currently only ever happens for non-bot users, so if you are building a normal bot, you can safely ignore this field.
To fetch the "complete" user information, use one of these methods:
Learn more: Incomplete peers
Whether you both have each other's contact
Whether this user has Premium subscription
Whether Premium is required to contact this user
Whether this user has been restricted. Bots only. See restrictionReason for details
Whether this user has been flagged for scam
Whether this user is you yourself
Whether this user is part of the Telegram support team
Whether this user has been verified by Telegram
IETF language tag of the user's language
Only available in some contexts
User's or bot's last name
Last time this user was seen online.
Only available if status is offline
Time when this user will automatically go offline.
Only available if status is online
User's phone number
Color that should be used when rendering the header of the user's profile
If null
, a generic header should be used instead
Reason why this bot was restricted
The list of reasons why this bot might be unavailable to some users.
This field is available only in case isRestricted is true
User's Last Seen & Online status
Whether user's online status is hidden because we have hidden our own online status from them, and we don't have Premium subscription.
Whether you have hidden (arhived) this user's stories
Maximum ID of stories this user has (or 0 if none)
User's or bot's username
User's or bot's usernames (including collectibles)
Create a mention for the user.
When available and text
is omitted, this method will return @username
.
Otherwise, text mention is created.
Use null
as text
(first parameter) to force create a text
mention with display name, even if there is a username.
Note: This method doesn't format anything on its own. Instead, it returns a MessageEntity that can later be used with
html
ormd
template tags
Optional
text: null | stringText of the mention.
Create a permanent mention for this user.
Permanent* means that this mention will also contain user's access hash, so even if the user changes their username or the client forgets about that user, it can still be mentioned.
Telegram might change access hash in some cases, so it may not exactly be permanent. The only way to actually make it permanent is to send it as a message somewhere and load it from there if needed.
Note that some users (particularly, users with hidden forwards) may not be mentioned like this outside the chats you have in common.
This method is only needed when the result will be stored somewhere outside current mtcute instance (e.g. saved for later use), otherwise mention will be enough.
Note: This method doesn't format anything on its own. Instead, it returns a MessageEntity that can later be used with
html
ormd
template tags
Note: the resulting text can only be used by clients that support mtcute notation of permanent mention links (
tg://user?id=123&hash=abc
).Also note that these permanent mentions are only valid for current account, since peer access hashes are account-specific and can't be used on another account.
Also note that for some users such mentions might not work at all due to privacy settings.
Optional
text: null | stringMention text
Static
parseOptional
status: TypeUserStatus
Underlying raw TL object