BotInfo.fromJson constructor

BotInfo.fromJson(
  1. Map<String, dynamic> json
)

Parse from a json

Implementation

factory BotInfo.fromJson(Map<String, dynamic> json) => BotInfo(
      shortDescription: json['short_description'],
      description: json['description'],
      photo: json['photo'] == null ? null : Photo.fromJson(json['photo']),
      animation: json['animation'] == null
          ? null
          : Animation.fromJson(json['animation']),
      menuButton: json['menu_button'] == null
          ? null
          : BotMenuButton.fromJson(json['menu_button']),
      commands: List<BotCommand>.from((json['commands'] ?? [])
          .map((item) => BotCommand.fromJson(item))
          .toList()),
      defaultGroupAdministratorRights:
          json['default_group_administrator_rights'] == null
              ? null
              : ChatAdministratorRights.fromJson(
                  json['default_group_administrator_rights']),
      defaultChannelAdministratorRights:
          json['default_channel_administrator_rights'] == null
              ? null
              : ChatAdministratorRights.fromJson(
                  json['default_channel_administrator_rights']),
      editCommandsLink: json['edit_commands_link'] == null
          ? null
          : InternalLinkType.fromJson(json['edit_commands_link']),
      editDescriptionLink: json['edit_description_link'] == null
          ? null
          : InternalLinkType.fromJson(json['edit_description_link']),
      editDescriptionMediaLink: json['edit_description_media_link'] == null
          ? null
          : InternalLinkType.fromJson(json['edit_description_media_link']),
      editSettingsLink: json['edit_settings_link'] == null
          ? null
          : InternalLinkType.fromJson(json['edit_settings_link']),
    );