User constructor
const
User({
- @JsonKey.new(name: 'id') required int id,
- @JsonKey.new(name: 'is_bot') required bool isBot,
- @JsonKey.new(name: 'first_name') required String firstName,
- @JsonKey.new(name: 'last_name') String? lastName,
- @JsonKey.new(name: 'username') String? username,
- @JsonKey.new(name: 'language_code') String? languageCode,
- @JsonKey.new(name: 'is_premium') bool? isPremium,
- @JsonKey.new(name: 'added_to_attachment_menu') bool? addedToAttachmentMenu,
- @JsonKey.new(name: 'can_join_groups') bool? canJoinGroups,
- @JsonKey.new(name: 'can_read_all_group_messages') bool? canReadAllGroupMessages,
- @JsonKey.new(name: 'supports_inline_queries') bool? supportsInlineQueries,
- @JsonKey.new(name: 'can_connect_to_business') bool? canConnectToBusiness,
- @JsonKey.new(name: 'has_main_web_app') bool? hasMainWebApp,
Creates a Telegram user or bot
idUnique identifier for this user or botisBotTrue, if this user is a botfirstNameUser's or bot's first namelastNameUser's or bot's last nameusernameUser's or bot's usernamelanguageCodeIETF language tag of the user's languageisPremiumTrue, if this user is a Telegram Premium useraddedToAttachmentMenuTrue, if this user added the bot to the attachment menucanJoinGroupsTrue, if the bot can be invited to groupscanReadAllGroupMessagesTrue, if privacy mode is disabled for the botsupportsInlineQueriesTrue, if the bot supports inline queriescanConnectToBusinessTrue, if the bot can be connected to a Telegram Business accounthasMainWebAppTrue, if the bot has a main Web App
Implementation
const factory User({
/// 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.
@JsonKey(name: 'id') required int id,
/// True, if this user is a bot
@JsonKey(name: 'is_bot') required bool isBot,
/// User's or bot's first name
@JsonKey(name: 'first_name') required String firstName,
/// Optional. User's or bot's last name
@JsonKey(name: 'last_name') String? lastName,
/// Optional. User's or bot's username
@JsonKey(name: 'username') String? username,
/// Optional. IETF language tag of the user's language
@JsonKey(name: 'language_code') String? languageCode,
/// Optional. True, if this user is a Telegram Premium user
@JsonKey(name: 'is_premium') bool? isPremium,
/// Optional. True, if this user added the bot to the attachment menu
@JsonKey(name: 'added_to_attachment_menu') bool? addedToAttachmentMenu,
/// Optional. True, if the bot can be invited to groups. Returned only in
/// getMe.
@JsonKey(name: 'can_join_groups') bool? canJoinGroups,
/// Optional. True, if privacy mode is disabled for the bot. Returned only
/// in getMe.
@JsonKey(name: 'can_read_all_group_messages') bool? canReadAllGroupMessages,
/// Optional. True, if the bot supports inline queries. Returned only in
/// getMe.
@JsonKey(name: 'supports_inline_queries') bool? supportsInlineQueries,
/// Optional. True, if the bot can be connected to a Telegram Business
/// account to receive its messages. Returned only in getMe.
@JsonKey(name: 'can_connect_to_business') bool? canConnectToBusiness,
/// Optional. True, if the bot has a main Web App. Returned only in getMe.
@JsonKey(name: 'has_main_web_app') bool? hasMainWebApp,
}) = _User;