fromJson static method

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

Implementation

static BotCommands? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return BotCommands(
    botUserId: (json['bot_user_id'] as int?) ?? 0,
    commands: List<BotCommand>.from(
      tdListFromJson(json['commands'])
          .map((item) => BotCommand.fromJson(tdMapFromJson(item)))
          .whereType<BotCommand>(),
    ),
  );
}