User constructor
const
User({
- @JsonKey(name: 'id') required int id,
- @JsonKey(name: 'is_bot') required bool isBot,
- @JsonKey(name: 'first_name') required String firstName,
- @JsonKey(name: 'last_name') String? lastName,
- @JsonKey(name: 'username') String? username,
- @JsonKey(name: 'language_code') String? languageCode,
- @JsonKey(name: 'is_premium') bool? isPremium,
- @JsonKey(name: 'added_to_attachment_menu') bool? addedToAttachmentMenu,
- @JsonKey(name: 'can_join_groups') bool? canJoinGroups,
- @JsonKey(name: 'can_read_all_group_messages') bool? canReadAllGroupMessages,
- @JsonKey(name: 'supports_inline_queries') bool? supportsInlineQueries,
- @JsonKey(name: 'can_connect_to_business') bool? canConnectToBusiness,
- @JsonKey(name: 'has_main_web_app') bool? hasMainWebApp,
Creates a Telegram user or bot
id
Unique identifier for this user or botisBot
True, if this user is a botfirstName
User's or bot's first namelastName
User's or bot's last nameusername
User's or bot's usernamelanguageCode
IETF language tag of the user's languageisPremium
True, if this user is a Telegram Premium useraddedToAttachmentMenu
True, if this user added the bot to the attachment menucanJoinGroups
True, if the bot can be invited to groupscanReadAllGroupMessages
True, if privacy mode is disabled for the botsupportsInlineQueries
True, if the bot supports inline queriescanConnectToBusiness
True, if the bot can be connected to a Telegram Business accounthasMainWebApp
True, 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;