User class

This object represents a Telegram user or bot.

Implemented types
Available extensions

Constructors

User({required int id, required bool isBot, required String firstName, String? lastName, String? username, String? languageCode, bool? isPremium, bool? addedToAttachmentMenu, bool? canJoinGroups, bool? canReadAllGroupMessages, bool? supportsInlineQueries, bool? canConnectToBusiness, bool? hasMainWebApp})
Constructs a User object
const
User.fromJson(Map<String, dynamic> json)
Creates a User object from JSON object
factory

Properties

addedToAttachmentMenu bool?
Optional. True, if this user added the bot to the attachment menu
final
canConnectToBusiness bool?
Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe.
final
canJoinGroups bool?
Optional. True, if the bot can be invited to groups. Returned only in getMe.
final
canReadAllGroupMessages bool?
Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
final
firstName String
User's or bot's first name
final
hashCode int
The hash code for this object.
no setterinherited
hasMainWebApp bool?
Optional. True, if the bot has a main Web App. Returned only in getMe.
final
id int
Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
final
isBot bool
True, if this user is a bot
final
isPremium bool?
Optional. True, if this user is a Telegram Premium user
final
languageCode String?
Optional. IETF language tag of the user's language
final
lastName String?
Optional. User's or bot's last name
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportsInlineQueries bool?
Optional. True, if the bot supports inline queries. Returned only in getMe.
final
username String?
Optional. User's or bot's username
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts a User object to JSON object
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited