fromMap static method

UserTypeBot? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static UserTypeBot? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  if (_ != CONSTRUCTOR) return null;
  var extra = _map['@extra'];
  var clientId = _map['@clientId'];
  var can_be_edited = _map['can_be_edited']! as bool;
  var can_join_groups = _map['can_join_groups']! as bool;
  var can_read_all_group_messages =
      _map['can_read_all_group_messages']! as bool;
  var is_inline = _map['is_inline']! as bool;
  var inline_query_placeholder = _map['inline_query_placeholder']! as String;
  var need_location = _map['need_location']! as bool;
  var can_be_added_to_attachment_menu =
      _map['can_be_added_to_attachment_menu']! as bool;
  return UserTypeBot(
    extra: extra,
    clientId: clientId,
    can_be_edited: can_be_edited,
    can_join_groups: can_join_groups,
    can_read_all_group_messages: can_read_all_group_messages,
    is_inline: is_inline,
    inline_query_placeholder: inline_query_placeholder,
    need_location: need_location,
    can_be_added_to_attachment_menu: can_be_added_to_attachment_menu,
  );
}