create static method

BotInfo create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "botInfo",
  3. String special_return_type = "botInfo",
  4. String? short_description,
  5. String? description,
  6. Photo? photo,
  7. Animation? animation,
  8. BotMenuButton? menu_button,
  9. List<BotCommand>? commands,
  10. String? privacy_policy_url,
  11. ChatAdministratorRights? default_group_administrator_rights,
  12. ChatAdministratorRights? default_channel_administrator_rights,
  13. AffiliateProgramInfo? affiliate_program,
  14. num? web_app_background_light_color,
  15. num? web_app_background_dark_color,
  16. num? web_app_header_light_color,
  17. num? web_app_header_dark_color,
  18. BotVerificationParameters? verification_parameters,
  19. bool? can_get_revenue_statistics,
  20. bool? can_manage_emoji_status,
  21. bool? has_media_previews,
  22. InternalLinkType? edit_commands_link,
  23. InternalLinkType? edit_description_link,
  24. InternalLinkType? edit_description_media_link,
  25. InternalLinkType? edit_settings_link,
})
override

Generate By AZKADEV | Azka Axelion Gibran Script Dont edit by hand or anything manual

Implementation

static BotInfo create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "botInfo",
  String special_return_type = "botInfo",
  String? short_description,
  String? description,
  Photo? photo,
  Animation? animation,
  BotMenuButton? menu_button,
  List<BotCommand>? commands,
  String? privacy_policy_url,
  ChatAdministratorRights? default_group_administrator_rights,
  ChatAdministratorRights? default_channel_administrator_rights,
  AffiliateProgramInfo? affiliate_program,
  num? web_app_background_light_color,
  num? web_app_background_dark_color,
  num? web_app_header_light_color,
  num? web_app_header_dark_color,
  BotVerificationParameters? verification_parameters,
  bool? can_get_revenue_statistics,
  bool? can_manage_emoji_status,
  bool? has_media_previews,
  InternalLinkType? edit_commands_link,
  InternalLinkType? edit_description_link,
  InternalLinkType? edit_description_media_link,
  InternalLinkType? edit_settings_link,
}) {
  // BotInfo botInfo = BotInfo({
  final Map botInfo_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "short_description": short_description,
    "description": description,
    "photo": (photo != null) ? photo.toJson() : null,
    "animation": (animation != null) ? animation.toJson() : null,
    "menu_button": (menu_button != null) ? menu_button.toJson() : null,
    "commands": (commands != null) ? commands.toJson() : null,
    "privacy_policy_url": privacy_policy_url,
    "default_group_administrator_rights": (default_group_administrator_rights != null) ? default_group_administrator_rights.toJson() : null,
    "default_channel_administrator_rights": (default_channel_administrator_rights != null) ? default_channel_administrator_rights.toJson() : null,
    "affiliate_program": (affiliate_program != null) ? affiliate_program.toJson() : null,
    "web_app_background_light_color": web_app_background_light_color,
    "web_app_background_dark_color": web_app_background_dark_color,
    "web_app_header_light_color": web_app_header_light_color,
    "web_app_header_dark_color": web_app_header_dark_color,
    "verification_parameters": (verification_parameters != null) ? verification_parameters.toJson() : null,
    "can_get_revenue_statistics": can_get_revenue_statistics,
    "can_manage_emoji_status": can_manage_emoji_status,
    "has_media_previews": has_media_previews,
    "edit_commands_link": (edit_commands_link != null) ? edit_commands_link.toJson() : null,
    "edit_description_link": (edit_description_link != null) ? edit_description_link.toJson() : null,
    "edit_description_media_link": (edit_description_media_link != null) ? edit_description_media_link.toJson() : null,
    "edit_settings_link": (edit_settings_link != null) ? edit_settings_link.toJson() : null,
  };

  botInfo_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (botInfo_data_create_json.containsKey(key) == false) {
        botInfo_data_create_json[key] = value;
      }
    });
  }
  return BotInfo(botInfo_data_create_json);
}