From e548d3a19f87c6e9f629095454a906d74a4ebc2e Mon Sep 17 00:00:00 2001 From: Aleksandr Razumov Date: Mon, 16 Sep 2024 12:25:49 +0300 Subject: [PATCH] feat: update embedded documentation --- examples/go.mod | 16 +- examples/go.sum | 8 + go.mod | 4 +- go.sum | 8 +- tg/tl_account_accept_authorization_gen.go | 1 + tg/tl_account_business_chat_links_gen.go | 10 +- tg/tl_account_connected_bots_gen.go | 8 +- ...l_account_create_business_chat_link_gen.go | 15 +- ...l_account_delete_business_chat_link_gen.go | 18 +- ..._account_disable_peer_connected_bot_gen.go | 26 +- tg/tl_account_edit_business_chat_link_gen.go | 20 +- tg/tl_account_emoji_statuses_gen.go | 2 +- tg/tl_account_get_authorization_form_gen.go | 1 + ...account_get_bot_business_connection_gen.go | 54 ++- tg/tl_account_get_business_chat_links_gen.go | 8 + ..._get_channel_default_emoji_statuses_gen.go | 2 +- ...et_channel_restricted_status_emojis_gen.go | 2 +- tg/tl_account_get_chat_themes_gen.go | 2 +- tg/tl_account_get_connected_bots_gen.go | 8 + ...count_get_default_background_emojis_gen.go | 2 +- ..._account_get_default_emoji_statuses_gen.go | 2 +- ...ount_get_default_group_photo_emojis_gen.go | 2 +- ...nt_get_default_profile_photo_emojis_gen.go | 2 +- ...count_get_reactions_notify_settings_gen.go | 8 + ...l_account_get_recent_emoji_statuses_gen.go | 2 +- tg/tl_account_get_saved_ringtones_gen.go | 2 +- tg/tl_account_get_themes_gen.go | 2 +- tg/tl_account_get_wall_papers_gen.go | 2 +- tg/tl_account_reorder_usernames_gen.go | 1 + ..._account_resolve_business_chat_link_gen.go | 18 +- ...ccount_resolved_business_chat_links_gen.go | 22 +- tg/tl_account_save_auto_save_settings_gen.go | 1 - tg/tl_account_save_ringtone_gen.go | 4 + tg/tl_account_save_secure_value_gen.go | 1 + tg/tl_account_save_theme_gen.go | 4 + tg/tl_account_saved_ringtones_gen.go | 2 +- tg/tl_account_send_verify_email_code_gen.go | 1 + ...account_set_global_privacy_settings_gen.go | 3 +- ...count_set_reactions_notify_settings_gen.go | 10 +- tg/tl_account_themes_gen.go | 2 +- ...account_toggle_connected_bot_paused_gen.go | 18 +- ...l_account_toggle_sponsored_messages_gen.go | 16 +- tg/tl_account_toggle_username_gen.go | 1 + tg/tl_account_update_birthday_gen.go | 19 +- ...ccount_update_business_away_message_gen.go | 15 +- ...nt_update_business_greeting_message_gen.go | 15 +- tg/tl_account_update_business_intro_gen.go | 15 +- tg/tl_account_update_business_location_gen.go | 26 +- ..._account_update_business_work_hours_gen.go | 35 +- tg/tl_account_update_color_gen.go | 1 + tg/tl_account_update_connected_bot_gen.go | 33 +- tg/tl_account_update_personal_channel_gen.go | 21 +- tg/tl_account_upload_ringtone_gen.go | 4 + tg/tl_account_upload_theme_gen.go | 1 + tg/tl_account_verify_email_gen.go | 2 + tg/tl_account_wall_papers_gen.go | 2 +- tg/tl_attach_menu_bots_gen.go | 2 +- tg/tl_auth_check_recovery_password_gen.go | 1 + tg/tl_auth_report_missing_code_gen.go | 18 +- tg/tl_auth_request_firebase_sms_gen.go | 6 +- tg/tl_auth_resend_code_gen.go | 12 +- tg/tl_auth_send_code_gen.go | 1 + tg/tl_auth_sent_code_type_gen.go | 23 +- tg/tl_auth_sign_in_gen.go | 1 + tg/tl_auth_sign_up_gen.go | 8 +- tg/tl_available_effect_gen.go | 44 ++- tg/tl_birthday_gen.go | 18 +- tg/tl_boost_gen.go | 6 +- tg/tl_bot_business_connection_gen.go | 31 +- tg/tl_bot_info_gen.go | 6 +- tg/tl_bot_inline_message_gen.go | 3 +- tg/tl_bot_preview_media_gen.go | 8 +- tg/tl_bots_add_preview_media_gen.go | 27 +- tg/tl_bots_answer_webhook_json_query_gen.go | 1 + tg/tl_bots_delete_preview_media_gen.go | 27 +- tg/tl_bots_edit_preview_media_gen.go | 32 +- tg/tl_bots_get_bot_commands_gen.go | 1 + tg/tl_bots_get_bot_info_gen.go | 1 + tg/tl_bots_get_popular_app_bots_gen.go | 21 +- tg/tl_bots_get_preview_info_gen.go | 28 +- tg/tl_bots_get_preview_medias_gen.go | 14 +- ..._bots_invoke_web_view_custom_method_gen.go | 1 + tg/tl_bots_popular_app_bots_gen.go | 20 +- tg/tl_bots_preview_info_gen.go | 15 +- tg/tl_bots_reorder_preview_medias_gen.go | 24 +- tg/tl_bots_reorder_usernames_gen.go | 2 +- tg/tl_bots_reset_bot_commands_gen.go | 1 + tg/tl_bots_send_custom_request_gen.go | 1 + ..._bot_broadcast_default_admin_rights_gen.go | 1 + tg/tl_bots_set_bot_menu_button_gen.go | 1 + tg/tl_bots_toggle_username_gen.go | 2 +- tg/tl_broadcast_revenue_balances_gen.go | 14 +- tg/tl_broadcast_revenue_transaction_gen.go | 49 ++- tg/tl_business_away_message_gen.go | 23 +- tg/tl_business_away_message_schedule_gen.go | 19 +- tg/tl_business_bot_recipients_gen.go | 27 +- tg/tl_business_chat_link_gen.go | 26 +- tg/tl_business_greeting_message_gen.go | 16 +- tg/tl_business_intro_gen.go | 24 +- tg/tl_business_location_gen.go | 13 +- tg/tl_business_recipients_gen.go | 27 +- tg/tl_business_weekly_open_gen.go | 16 +- tg/tl_business_work_hours_gen.go | 35 +- tg/tl_channel_admin_log_event_action_gen.go | 8 +- ...l_channels_deactivate_all_usernames_gen.go | 5 +- tg/tl_channels_edit_admin_gen.go | 2 +- tg/tl_channels_edit_creator_gen.go | 2 +- tg/tl_channels_edit_location_gen.go | 1 + ...hannels_get_admined_public_channels_gen.go | 7 +- ...hannels_get_channel_recommendations_gen.go | 9 +- tg/tl_channels_get_forum_topics_by_id_gen.go | 1 - tg/tl_channels_get_send_as_gen.go | 1 + tg/tl_channels_invite_to_channel_gen.go | 14 - tg/tl_channels_leave_channel_gen.go | 2 +- ...hannels_reorder_pinned_forum_topics_gen.go | 5 +- tg/tl_channels_reorder_usernames_gen.go | 2 +- ...els_report_anti_spam_false_positive_gen.go | 5 +- ...l_channels_report_sponsored_message_gen.go | 26 +- ...hannels_restrict_sponsored_messages_gen.go | 22 +- tg/tl_channels_search_posts_gen.go | 32 +- ..._set_boosts_to_unblock_restrictions_gen.go | 28 +- tg/tl_channels_set_emoji_stickers_gen.go | 24 +- ...els_sponsored_message_report_result_gen.go | 12 +- tg/tl_channels_toggle_anti_spam_gen.go | 2 +- tg/tl_channels_toggle_forum_gen.go | 2 +- ...channels_toggle_participants_hidden_gen.go | 2 +- tg/tl_channels_toggle_username_gen.go | 4 +- tg/tl_channels_update_color_gen.go | 7 +- tg/tl_channels_update_emoji_status_gen.go | 8 +- ..._channels_update_pinned_forum_topic_gen.go | 2 +- tg/tl_chat_full_gen.go | 71 +++- tg/tl_chat_gen.go | 125 ++++++- tg/tl_chatlists_check_chatlist_invite_gen.go | 1 - tg/tl_chatlists_delete_exported_invite_gen.go | 1 - tg/tl_chatlists_edit_exported_invite_gen.go | 5 +- tg/tl_chatlists_export_chatlist_invite_gen.go | 2 +- tg/tl_chatlists_get_chatlist_updates_gen.go | 1 - tg/tl_chatlists_get_exported_invites_gen.go | 5 +- ...ists_get_leave_chatlist_suggestions_gen.go | 1 - tg/tl_chatlists_hide_chatlist_updates_gen.go | 1 - tg/tl_chatlists_join_chatlist_invite_gen.go | 1 - tg/tl_chatlists_join_chatlist_updates_gen.go | 1 - tg/tl_chatlists_leave_chatlist_gen.go | 5 +- tg/tl_code_settings_gen.go | 3 +- tg/tl_connected_bot_gen.go | 19 +- tg/tl_contact_birthday_gen.go | 5 +- tg/tl_contacts_contact_birthdays_gen.go | 5 +- tg/tl_contacts_export_contact_token_gen.go | 1 - tg/tl_contacts_get_birthdays_gen.go | 18 + tg/tl_contacts_get_contact_ids_gen.go | 2 +- tg/tl_contacts_get_contacts_gen.go | 12 +- tg/tl_contacts_get_located_gen.go | 1 + tg/tl_contacts_get_saved_gen.go | 1 + tg/tl_contacts_get_top_peers_gen.go | 7 +- tg/tl_contacts_import_contact_token_gen.go | 1 - tg/tl_dialog_filter_gen.go | 14 +- tg/tl_document_attribute_gen.go | 3 +- tg/tl_draft_message_gen.go | 5 +- tg/tl_emoji_group_gen.go | 29 +- tg/tl_emoji_list_gen.go | 2 +- tg/tl_errors_gen.go | 332 +++++++++++++++++- tg/tl_fact_check_gen.go | 27 +- tg/tl_found_story_gen.go | 8 +- tg/tl_fragment_collectible_info_gen.go | 28 +- tg/tl_fragment_get_collectible_info_gen.go | 17 +- tg/tl_geo_point_address_gen.go | 17 +- tg/tl_global_privacy_settings_gen.go | 33 +- tg/tl_help_app_config_gen.go | 2 +- tg/tl_help_countries_list_gen.go | 2 +- tg/tl_help_edit_user_info_gen.go | 2 +- tg/tl_help_get_app_config_gen.go | 2 +- tg/tl_help_get_countries_list_gen.go | 2 +- tg/tl_help_get_passport_config_gen.go | 2 +- tg/tl_help_get_peer_colors_gen.go | 2 +- tg/tl_help_get_peer_profile_colors_gen.go | 2 +- tg/tl_help_get_timezones_list_gen.go | 15 +- tg/tl_help_passport_config_gen.go | 2 +- tg/tl_help_peer_color_option_gen.go | 12 +- tg/tl_help_peer_colors_gen.go | 2 +- tg/tl_help_set_bot_updates_status_gen.go | 4 + tg/tl_help_timezones_list_gen.go | 13 +- tg/tl_init_connection_gen.go | 10 +- tg/tl_input_business_away_message_gen.go | 23 +- tg/tl_input_business_bot_recipients_gen.go | 25 +- tg/tl_input_business_chat_link_gen.go | 20 +- tg/tl_input_business_greeting_message_gen.go | 16 +- tg/tl_input_business_intro_gen.go | 18 +- tg/tl_input_business_recipients_gen.go | 27 +- tg/tl_input_collectible_gen.go | 12 +- tg/tl_input_file_gen.go | 7 +- tg/tl_input_invoice_gen.go | 20 +- tg/tl_input_media_gen.go | 13 +- tg/tl_input_privacy_key_gen.go | 21 +- tg/tl_input_privacy_rule_gen.go | 6 + tg/tl_input_quick_reply_shortcut_gen.go | 12 +- tg/tl_input_reply_to_gen.go | 2 +- tg/tl_input_stars_transaction_gen.go | 13 +- tg/tl_input_store_payment_purpose_gen.go | 55 ++- tg/tl_invoice_gen.go | 3 +- tg/tl_invoke_with_apns_secret_gen.go | 7 +- tg/tl_invoke_with_business_connection_gen.go | 13 +- ...l_invoke_with_google_play_integrity_gen.go | 7 +- tg/tl_keyboard_button_gen.go | 32 +- tg/tl_langpack_get_difference_gen.go | 8 +- tg/tl_langpack_get_lang_pack_gen.go | 8 +- tg/tl_langpack_get_language_gen.go | 7 +- tg/tl_langpack_get_languages_gen.go | 2 +- tg/tl_langpack_get_strings_gen.go | 7 +- tg/tl_media_area_coordinates_gen.go | 7 +- tg/tl_media_area_gen.go | 32 +- tg/tl_message_action_gen.go | 95 +++-- tg/tl_message_entity_gen.go | 7 +- tg/tl_message_extended_media_gen.go | 19 +- tg/tl_message_gen.go | 44 ++- tg/tl_message_media_gen.go | 24 +- tg/tl_message_reactions_gen.go | 6 +- tg/tl_message_reply_header_gen.go | 2 +- tg/tl_messages_add_chat_user_gen.go | 14 - tg/tl_messages_all_stickers_gen.go | 2 +- tg/tl_messages_available_effects_gen.go | 17 +- tg/tl_messages_available_reactions_gen.go | 2 +- ...messages_check_quick_reply_shortcut_gen.go | 18 +- tg/tl_messages_create_chat_gen.go | 14 - tg/tl_messages_delete_fact_check_gen.go | 23 +- ...essages_delete_quick_reply_messages_gen.go | 23 +- ...essages_delete_quick_reply_shortcut_gen.go | 27 +- ..._messages_delete_scheduled_messages_gen.go | 1 + tg/tl_messages_dialog_filters_gen.go | 16 +- tg/tl_messages_edit_chat_title_gen.go | 1 + tg/tl_messages_edit_fact_check_gen.go | 28 +- tg/tl_messages_edit_inline_bot_message_gen.go | 2 +- tg/tl_messages_edit_message_gen.go | 8 +- ..._messages_edit_quick_reply_shortcut_gen.go | 24 +- tg/tl_messages_emoji_groups_gen.go | 8 +- tg/tl_messages_faved_stickers_gen.go | 2 +- tg/tl_messages_featured_stickers_gen.go | 2 +- tg/tl_messages_forward_messages_gen.go | 13 +- tg/tl_messages_found_sticker_sets_gen.go | 2 +- tg/tl_messages_get_all_stickers_gen.go | 2 +- tg/tl_messages_get_attach_menu_bots_gen.go | 2 +- tg/tl_messages_get_attached_stickers_gen.go | 4 + tg/tl_messages_get_available_effects_gen.go | 13 +- tg/tl_messages_get_available_reactions_gen.go | 2 +- tg/tl_messages_get_bot_app_gen.go | 4 +- tg/tl_messages_get_bot_callback_answer_gen.go | 1 + tg/tl_messages_get_default_history_ttl_gen.go | 1 - ..._messages_get_default_tag_reactions_gen.go | 13 +- tg/tl_messages_get_dialogs_gen.go | 2 +- tg/tl_messages_get_emoji_groups_gen.go | 13 +- ...ages_get_emoji_profile_photo_groups_gen.go | 7 +- tg/tl_messages_get_emoji_status_groups_gen.go | 7 +- ...l_messages_get_emoji_sticker_groups_gen.go | 13 +- tg/tl_messages_get_emoji_stickers_gen.go | 2 +- tg/tl_messages_get_extended_media_gen.go | 22 +- tg/tl_messages_get_fact_check_gen.go | 19 +- tg/tl_messages_get_faved_stickers_gen.go | 2 +- ...essages_get_featured_emoji_stickers_gen.go | 2 +- tg/tl_messages_get_featured_stickers_gen.go | 2 +- tg/tl_messages_get_mask_stickers_gen.go | 2 +- ...sages_get_message_read_participants_gen.go | 2 +- tg/tl_messages_get_messages_reactions_gen.go | 1 + tg/tl_messages_get_my_stickers_gen.go | 18 +- ..._messages_get_old_featured_stickers_gen.go | 2 +- tg/tl_messages_get_outbox_read_date_gen.go | 49 ++- tg/tl_messages_get_quick_replies_gen.go | 14 +- ...l_messages_get_quick_reply_messages_gen.go | 26 +- tg/tl_messages_get_recent_locations_gen.go | 2 +- tg/tl_messages_get_recent_reactions_gen.go | 2 +- tg/tl_messages_get_recent_stickers_gen.go | 2 +- tg/tl_messages_get_replies_gen.go | 2 +- tg/tl_messages_get_saved_dialogs_gen.go | 2 +- tg/tl_messages_get_saved_gifs_gen.go | 6 +- tg/tl_messages_get_saved_reaction_tags_gen.go | 23 +- tg/tl_messages_get_scheduled_history_gen.go | 4 +- ...essages_get_search_results_calendar_gen.go | 1 + ...ssages_get_search_results_positions_gen.go | 4 + tg/tl_messages_get_sticker_set_gen.go | 2 +- tg/tl_messages_get_stickers_gen.go | 2 +- tg/tl_messages_get_top_reactions_gen.go | 2 +- tg/tl_messages_get_unread_reactions_gen.go | 4 + tg/tl_messages_get_web_page_gen.go | 7 +- tg/tl_messages_get_web_page_preview_gen.go | 2 +- tg/tl_messages_hide_peer_settings_bar_gen.go | 4 + tg/tl_messages_init_history_import_gen.go | 3 + tg/tl_messages_invited_users_gen.go | 10 +- tg/tl_messages_my_stickers_gen.go | 8 +- tg/tl_messages_prolong_web_view_gen.go | 4 + tg/tl_messages_quick_replies_gen.go | 16 +- tg/tl_messages_reactions_gen.go | 2 +- tg/tl_messages_read_encrypted_history_gen.go | 1 + tg/tl_messages_recent_stickers_gen.go | 2 +- tg/tl_messages_reorder_quick_replies_gen.go | 21 +- tg/tl_messages_report_reaction_gen.go | 1 + tg/tl_messages_request_app_web_view_gen.go | 7 +- tg/tl_messages_request_main_web_view_gen.go | 42 ++- tg/tl_messages_request_simple_web_view_gen.go | 16 +- tg/tl_messages_request_web_view_gen.go | 10 +- tg/tl_messages_save_draft_gen.go | 7 +- tg/tl_messages_saved_gifs_gen.go | 2 +- tg/tl_messages_saved_reaction_tags_gen.go | 15 +- tg/tl_messages_search_custom_emoji_gen.go | 3 +- ..._messages_search_emoji_sticker_sets_gen.go | 2 +- tg/tl_messages_search_gen.go | 6 +- tg/tl_messages_search_global_gen.go | 7 +- tg/tl_messages_search_sticker_sets_gen.go | 2 +- tg/tl_messages_send_bot_requested_peer_gen.go | 4 + tg/tl_messages_send_inline_bot_result_gen.go | 11 +- tg/tl_messages_send_media_gen.go | 23 +- tg/tl_messages_send_message_gen.go | 23 +- tg/tl_messages_send_multi_media_gen.go | 17 +- ..._messages_send_quick_reply_messages_gen.go | 23 +- tg/tl_messages_send_reaction_gen.go | 2 +- tg/tl_messages_send_scheduled_messages_gen.go | 1 + tg/tl_messages_send_web_view_data_gen.go | 4 + ...ssages_send_web_view_result_message_gen.go | 1 + ...essages_set_bot_precheckout_results_gen.go | 1 + ...l_messages_set_bot_shipping_results_gen.go | 1 + ...ssages_set_chat_available_reactions_gen.go | 14 +- tg/tl_messages_set_chat_wall_paper_gen.go | 1 - tg/tl_messages_set_default_history_ttl_gen.go | 1 - tg/tl_messages_set_history_ttl_gen.go | 1 + tg/tl_messages_set_inline_bot_results_gen.go | 2 + tg/tl_messages_stickers_gen.go | 2 +- ..._messages_toggle_bot_in_attach_menu_gen.go | 4 + ..._messages_toggle_dialog_filter_tags_gen.go | 14 +- ...l_messages_toggle_peer_translations_gen.go | 5 +- tg/tl_messages_translate_text_gen.go | 1 + tg/tl_messages_unpin_all_messages_gen.go | 1 + tg/tl_messages_update_dialog_filter_gen.go | 2 + ..._messages_update_saved_reaction_tag_gen.go | 26 +- tg/tl_messages_upload_encrypted_file_gen.go | 4 + tg/tl_messages_upload_imported_media_gen.go | 1 + tg/tl_messages_upload_media_gen.go | 11 +- tg/tl_missing_invitee_gen.go | 29 +- tg/tl_outbox_read_date_gen.go | 3 +- ...yments_assign_app_store_transaction_gen.go | 4 + ...ents_assign_play_market_transaction_gen.go | 4 + tg/tl_payments_can_purchase_premium_gen.go | 4 + tg/tl_payments_check_gift_code_gen.go | 1 + tg/tl_payments_get_payment_form_gen.go | 1 + tg/tl_payments_get_stars_gift_options_gen.go | 17 +- ...s_get_stars_revenue_ads_account_url_gen.go | 18 +- tg/tl_payments_get_stars_revenue_stats_gen.go | 24 +- ...ts_get_stars_revenue_withdrawal_url_gen.go | 23 +- tg/tl_payments_get_stars_status_gen.go | 18 +- tg/tl_payments_get_stars_topup_options_gen.go | 10 + ...yments_get_stars_transactions_by_id_gen.go | 16 +- tg/tl_payments_get_stars_transactions_gen.go | 45 ++- tg/tl_payments_payment_form_gen.go | 24 +- tg/tl_payments_payment_receipt_gen.go | 32 +- tg/tl_payments_refund_stars_charge_gen.go | 21 +- tg/tl_payments_send_payment_form_gen.go | 1 + tg/tl_payments_send_stars_form_gen.go | 23 +- ...ments_stars_revenue_ads_account_url_gen.go | 7 +- tg/tl_payments_stars_revenue_stats_gen.go | 11 +- ...yments_stars_revenue_withdrawal_url_gen.go | 9 +- tg/tl_payments_stars_status_gen.go | 23 +- tg/tl_payments_validate_requested_info_gen.go | 1 + tg/tl_peer_settings_gen.go | 28 +- tg/tl_phone_call_gen.go | 4 +- tg/tl_phone_check_group_call_gen.go | 1 + ...l_phone_edit_group_call_participant_gen.go | 4 + tg/tl_phone_edit_group_call_title_gen.go | 1 + tg/tl_phone_export_group_call_invite_gen.go | 1 + ...hone_get_group_call_stream_rtmp_url_gen.go | 1 + tg/tl_phone_get_group_participants_gen.go | 4 + tg/tl_phone_invite_to_group_call_gen.go | 1 + ..._phone_join_group_call_presentation_gen.go | 1 + tg/tl_phone_leave_group_call_gen.go | 4 + ...phone_leave_group_call_presentation_gen.go | 4 + tg/tl_phone_save_call_log_gen.go | 4 + ...one_save_default_group_call_join_as_gen.go | 1 + tg/tl_phone_send_signaling_data_gen.go | 4 + tg/tl_phone_start_scheduled_group_call_gen.go | 5 + tg/tl_phone_toggle_group_call_record_gen.go | 1 + tg/tl_phone_toggle_group_call_settings_gen.go | 1 + ...oggle_group_call_start_subscription_gen.go | 1 + ...photos_upload_contact_profile_photo_gen.go | 1 - tg/tl_poll_answer_gen.go | 7 +- tg/tl_poll_gen.go | 6 +- tg/tl_premium_boosts_status_gen.go | 15 +- tg/tl_premium_get_boosts_list_gen.go | 10 +- tg/tl_premium_get_boosts_status_gen.go | 4 +- tg/tl_premium_get_user_boosts_gen.go | 10 +- tg/tl_privacy_key_gen.go | 16 +- tg/tl_privacy_rule_gen.go | 6 + tg/tl_quick_reply_gen.go | 12 +- tg/tl_reaction_notifications_from_gen.go | 2 + tg/tl_reactions_notify_settings_gen.go | 27 +- tg/tl_requested_peer_gen.go | 68 +++- tg/tl_saved_reaction_tag_gen.go | 18 +- tg/tl_sms_job_gen.go | 7 +- tg/tl_smsjobs_eligible_to_join_gen.go | 5 +- tg/tl_smsjobs_finish_job_gen.go | 15 +- tg/tl_smsjobs_get_sms_job_gen.go | 8 +- tg/tl_smsjobs_get_status_gen.go | 6 + tg/tl_smsjobs_is_eligible_to_join_gen.go | 6 + tg/tl_smsjobs_join_gen.go | 6 + tg/tl_smsjobs_leave_gen.go | 6 + tg/tl_smsjobs_status_gen.go | 22 +- tg/tl_smsjobs_update_settings_gen.go | 13 +- tg/tl_sponsored_message_gen.go | 22 +- tg/tl_sponsored_message_report_option_gen.go | 11 +- tg/tl_stars_gift_option_gen.go | 28 +- tg/tl_stars_revenue_status_gen.go | 23 +- tg/tl_stars_topup_option_gen.go | 28 +- tg/tl_stars_transaction_gen.go | 57 ++- tg/tl_stars_transaction_peer_gen.go | 42 ++- tg/tl_stats_broadcast_revenue_stats_gen.go | 17 +- ...tats_broadcast_revenue_transactions_gen.go | 8 +- ...ts_broadcast_revenue_withdrawal_url_gen.go | 7 +- ...l_stats_get_broadcast_revenue_stats_gen.go | 22 +- ..._get_broadcast_revenue_transactions_gen.go | 24 +- ...et_broadcast_revenue_withdrawal_url_gen.go | 21 +- tg/tl_sticker_set_gen.go | 5 +- tg/tl_stickers_add_sticker_to_set_gen.go | 9 +- tg/tl_stickers_change_sticker_gen.go | 5 +- tg/tl_stickers_change_sticker_position_gen.go | 8 +- tg/tl_stickers_create_sticker_set_gen.go | 4 +- tg/tl_stickers_delete_sticker_set_gen.go | 5 +- tg/tl_stickers_remove_sticker_from_set_gen.go | 9 +- tg/tl_stickers_rename_sticker_set_gen.go | 4 +- tg/tl_stickers_replace_sticker_gen.go | 17 +- tg/tl_stories_activate_stealth_mode_gen.go | 4 + tg/tl_stories_delete_stories_gen.go | 1 + tg/tl_stories_found_stories_gen.go | 19 +- tg/tl_stories_get_stories_by_id_gen.go | 1 + tg/tl_stories_search_posts_gen.go | 47 ++- tg/tl_stories_send_reaction_gen.go | 1 + tg/tl_stories_send_story_gen.go | 1 + tg/tl_stories_stories_gen.go | 7 +- tg/tl_stories_toggle_pinned_to_top_gen.go | 20 +- tg/tl_story_item_gen.go | 2 +- tg/tl_timezone_gen.go | 8 +- tg/tl_top_peer_category_gen.go | 4 + tg/tl_update_gen.go | 263 +++++++++++--- tg/tl_updates_channel_difference_gen.go | 15 +- tg/tl_upload_get_cdn_file_gen.go | 4 + tg/tl_upload_get_cdn_file_hashes_gen.go | 2 +- tg/tl_upload_get_file_gen.go | 2 +- tg/tl_upload_reupload_cdn_file_gen.go | 4 +- tg/tl_user_full_gen.go | 81 ++++- tg/tl_user_gen.go | 201 +++++++++-- tg/tl_user_status_gen.go | 39 +- ..._get_is_premium_required_to_contact_gen.go | 14 +- tg/tl_users_get_users_gen.go | 1 + tg/tl_web_page_attribute_gen.go | 24 +- tg/tl_web_page_gen.go | 7 +- tg/tl_web_view_result_url_gen.go | 15 +- 449 files changed, 4745 insertions(+), 1073 deletions(-) diff --git a/examples/go.mod b/examples/go.mod index a3ddc96ff7..4ceadc7371 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -11,8 +11,8 @@ require ( go.etcd.io/bbolt v1.3.9 go.uber.org/atomic v1.11.0 go.uber.org/zap v1.27.0 - golang.org/x/sync v0.7.0 - golang.org/x/term v0.22.0 + golang.org/x/sync v0.8.0 + golang.org/x/term v0.24.0 golang.org/x/time v0.5.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) @@ -43,14 +43,14 @@ require ( github.com/prometheus/procfs v0.12.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/segmentio/asm v1.2.0 // indirect - go.opentelemetry.io/otel v1.28.0 // indirect - go.opentelemetry.io/otel/trace v1.28.0 // indirect + go.opentelemetry.io/otel v1.29.0 // indirect + go.opentelemetry.io/otel/trace v1.29.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.25.0 // indirect + golang.org/x/crypto v0.27.0 // indirect golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect - golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect google.golang.org/protobuf v1.33.0 // indirect nhooyr.io/websocket v1.8.11 // indirect rsc.io/qr v0.2.0 // indirect diff --git a/examples/go.sum b/examples/go.sum index 933ad3585c..4c82ff1af2 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -85,10 +85,12 @@ go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs= go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA= go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0= go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -103,6 +105,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -114,25 +117,30 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/go.mod b/go.mod index 42505642f4..5f942b0fe0 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/go-faster/jx v1.1.0 github.com/go-faster/xor v1.0.0 github.com/go-openapi/inflect v0.21.0 - github.com/gotd/getdoc v0.42.0 + github.com/gotd/getdoc v0.43.0 github.com/gotd/ige v0.2.2 github.com/gotd/neo v0.1.5 github.com/gotd/tl v0.4.0 @@ -31,7 +31,7 @@ require ( ) require ( - github.com/PuerkitoBio/goquery v1.9.1 // indirect + github.com/PuerkitoBio/goquery v1.9.2 // indirect github.com/andybalholm/cascadia v1.3.2 // indirect github.com/benbjohnson/clock v1.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/go.sum b/go.sum index 755b2b362d..70d842fb31 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/PuerkitoBio/goquery v1.9.1 h1:mTL6XjbJTZdpfL+Gwl5U2h1l9yEkJjhmlTeV9VPW7UI= -github.com/PuerkitoBio/goquery v1.9.1/go.mod h1:cW1n6TmIMDoORQU5IU/P1T3tGFunOeXEpGP2WHRwkbY= +github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4yPeE= +github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk= github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= @@ -21,8 +21,8 @@ github.com/go-openapi/inflect v0.21.0 h1:FoBjBTQEcbg2cJUWX6uwL9OyIW8eqc9k4KhN4lf github.com/go-openapi/inflect v0.21.0/go.mod h1:INezMuUu7SJQc2AyR3WO0DqqYUJSj8Kb4hBd7WtjlAw= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/gotd/getdoc v0.42.0 h1:sfOZVc1mTVOW09Wv33cUAME3KCzYYtMmAaOb2mVp9XQ= -github.com/gotd/getdoc v0.42.0/go.mod h1:MazeR5T7jiXeISn5/j8jyd/w+fIerlNDsE9IASlGgYM= +github.com/gotd/getdoc v0.43.0 h1:8ZsO1VebDxxxsFvNIuT2ER/ArmjzCCxWvY4zwF/OaNY= +github.com/gotd/getdoc v0.43.0/go.mod h1:6kVssCElTsjbo5l1JclXjavzJVWTKW8nMFEJEuL3gZg= github.com/gotd/ige v0.2.2 h1:XQ9dJZwBfDnOGSTxKXBGP4gMud3Qku2ekScRjDWWfEk= github.com/gotd/ige v0.2.2/go.mod h1:tuCRb+Y5Y3eNTo3ypIfNpQ4MFjrnONiL2jN2AKZXmb0= github.com/gotd/neo v0.1.5 h1:oj0iQfMbGClP8xI59x7fE/uHoTJD7NZH9oV1WNuPukQ= diff --git a/tg/tl_account_accept_authorization_gen.go b/tg/tl_account_accept_authorization_gen.go index 74b40c8322..ac1a69ec36 100644 --- a/tg/tl_account_accept_authorization_gen.go +++ b/tg/tl_account_accept_authorization_gen.go @@ -291,6 +291,7 @@ func (a *AccountAcceptAuthorizationRequest) GetCredentials() (value SecureCreden // // Possible errors: // +// 400 BOT_INVALID: This is not a valid bot. // 400 PUBLIC_KEY_REQUIRED: A public key is required. // // See https://core.telegram.org/method/account.acceptAuthorization for reference. diff --git a/tg/tl_account_business_chat_links_gen.go b/tg/tl_account_business_chat_links_gen.go index e0131d5ecd..56f099a5ff 100644 --- a/tg/tl_account_business_chat_links_gen.go +++ b/tg/tl_account_business_chat_links_gen.go @@ -32,14 +32,18 @@ var ( ) // AccountBusinessChatLinks represents TL type `account.businessChatLinks#ec43a2d1`. +// Contains info about business chat deep links »¹ created by the current account. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links // // See https://core.telegram.org/constructor/account.businessChatLinks for reference. type AccountBusinessChatLinks struct { - // Links field of AccountBusinessChatLinks. + // Links Links []BusinessChatLink - // Chats field of AccountBusinessChatLinks. + // Mentioned chats Chats []ChatClass - // Users field of AccountBusinessChatLinks. + // Mentioned users Users []UserClass } diff --git a/tg/tl_account_connected_bots_gen.go b/tg/tl_account_connected_bots_gen.go index c38996f8e8..65a042bfe4 100644 --- a/tg/tl_account_connected_bots_gen.go +++ b/tg/tl_account_connected_bots_gen.go @@ -32,12 +32,16 @@ var ( ) // AccountConnectedBots represents TL type `account.connectedBots#17d7f87b`. +// Info about currently connected business bots¹. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots // // See https://core.telegram.org/constructor/account.connectedBots for reference. type AccountConnectedBots struct { - // ConnectedBots field of AccountConnectedBots. + // Info about the connected bots ConnectedBots []ConnectedBot - // Users field of AccountConnectedBots. + // Bot information Users []UserClass } diff --git a/tg/tl_account_create_business_chat_link_gen.go b/tg/tl_account_create_business_chat_link_gen.go index f92d7450c0..470be13020 100644 --- a/tg/tl_account_create_business_chat_link_gen.go +++ b/tg/tl_account_create_business_chat_link_gen.go @@ -32,10 +32,14 @@ var ( ) // AccountCreateBusinessChatLinkRequest represents TL type `account.createBusinessChatLink#8851e68e`. +// Create a business chat deep link »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links // // See https://core.telegram.org/method/account.createBusinessChatLink for reference. type AccountCreateBusinessChatLinkRequest struct { - // Link field of AccountCreateBusinessChatLinkRequest. + // Info about the link to create. Link InputBusinessChatLink } @@ -161,6 +165,15 @@ func (c *AccountCreateBusinessChatLinkRequest) GetLink() (value InputBusinessCha } // AccountCreateBusinessChatLink invokes method account.createBusinessChatLink#8851e68e returning error if any. +// Create a business chat deep link »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links +// +// Possible errors: +// +// 400 CHATLINKS_TOO_MUCH: Too many business chat links were created, please delete some older links. +// 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // // See https://core.telegram.org/method/account.createBusinessChatLink for reference. func (c *Client) AccountCreateBusinessChatLink(ctx context.Context, link InputBusinessChatLink) (*BusinessChatLink, error) { diff --git a/tg/tl_account_delete_business_chat_link_gen.go b/tg/tl_account_delete_business_chat_link_gen.go index 101a6d4a40..18c3334129 100644 --- a/tg/tl_account_delete_business_chat_link_gen.go +++ b/tg/tl_account_delete_business_chat_link_gen.go @@ -32,10 +32,17 @@ var ( ) // AccountDeleteBusinessChatLinkRequest represents TL type `account.deleteBusinessChatLink#60073674`. +// Delete a business chat deep link »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links // // See https://core.telegram.org/method/account.deleteBusinessChatLink for reference. type AccountDeleteBusinessChatLinkRequest struct { - // Slug field of AccountDeleteBusinessChatLinkRequest. + // Slug of the link, obtained as specified here »¹. + // + // Links: + // 1) https://core.telegram.org/api/links#business-chat-links Slug string } @@ -161,6 +168,15 @@ func (d *AccountDeleteBusinessChatLinkRequest) GetSlug() (value string) { } // AccountDeleteBusinessChatLink invokes method account.deleteBusinessChatLink#60073674 returning error if any. +// Delete a business chat deep link »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links +// +// Possible errors: +// +// 400 CHATLINK_SLUG_EMPTY: The specified slug is empty. +// 400 CHATLINK_SLUG_EXPIRED: The specified business chat link has expired. // // See https://core.telegram.org/method/account.deleteBusinessChatLink for reference. func (c *Client) AccountDeleteBusinessChatLink(ctx context.Context, slug string) (bool, error) { diff --git a/tg/tl_account_disable_peer_connected_bot_gen.go b/tg/tl_account_disable_peer_connected_bot_gen.go index 20c0018d17..5fb5da7205 100644 --- a/tg/tl_account_disable_peer_connected_bot_gen.go +++ b/tg/tl_account_disable_peer_connected_bot_gen.go @@ -32,10 +32,19 @@ var ( ) // AccountDisablePeerConnectedBotRequest represents TL type `account.disablePeerConnectedBot#5e437ed9`. +// Permanently disconnect a specific chat from all business bots »¹ (equivalent to +// specifying it in recipients.exclude_users during initial configuration with account +// updateConnectedBot »²); to reconnect of a chat disconnected using this method the +// user must reconnect the entire bot by invoking account.updateConnectedBot »³. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots +// 2. https://core.telegram.org/method/account.updateConnectedBot +// 3. https://core.telegram.org/method/account.updateConnectedBot // // See https://core.telegram.org/method/account.disablePeerConnectedBot for reference. type AccountDisablePeerConnectedBotRequest struct { - // Peer field of AccountDisablePeerConnectedBotRequest. + // The chat to disconnect Peer InputPeerClass } @@ -166,6 +175,21 @@ func (d *AccountDisablePeerConnectedBotRequest) GetPeer() (value InputPeerClass) } // AccountDisablePeerConnectedBot invokes method account.disablePeerConnectedBot#5e437ed9 returning error if any. +// Permanently disconnect a specific chat from all business bots »¹ (equivalent to +// specifying it in recipients.exclude_users during initial configuration with account +// updateConnectedBot »²); to reconnect of a chat disconnected using this method the +// user must reconnect the entire bot by invoking account.updateConnectedBot »³. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots +// 2. https://core.telegram.org/method/account.updateConnectedBot +// 3. https://core.telegram.org/method/account.updateConnectedBot +// +// Possible errors: +// +// 400 BOT_ALREADY_DISABLED: The connected business bot was already disabled for the specified peer. +// 400 BOT_NOT_CONNECTED_YET: No business bot is connected to the currently logged in user. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/account.disablePeerConnectedBot for reference. func (c *Client) AccountDisablePeerConnectedBot(ctx context.Context, peer InputPeerClass) (bool, error) { diff --git a/tg/tl_account_edit_business_chat_link_gen.go b/tg/tl_account_edit_business_chat_link_gen.go index 9aedcf3b33..9c59d59fb9 100644 --- a/tg/tl_account_edit_business_chat_link_gen.go +++ b/tg/tl_account_edit_business_chat_link_gen.go @@ -32,12 +32,19 @@ var ( ) // AccountEditBusinessChatLinkRequest represents TL type `account.editBusinessChatLink#8c3410af`. +// Edit a created business chat deep link »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links // // See https://core.telegram.org/method/account.editBusinessChatLink for reference. type AccountEditBusinessChatLinkRequest struct { - // Slug field of AccountEditBusinessChatLinkRequest. + // Slug of the link, obtained as specified here »¹. + // + // Links: + // 1) https://core.telegram.org/api/links#business-chat-links Slug string - // Link field of AccountEditBusinessChatLinkRequest. + // New link information. Link InputBusinessChatLink } @@ -188,6 +195,15 @@ func (e *AccountEditBusinessChatLinkRequest) GetLink() (value InputBusinessChatL } // AccountEditBusinessChatLink invokes method account.editBusinessChatLink#8c3410af returning error if any. +// Edit a created business chat deep link »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links +// +// Possible errors: +// +// 400 CHATLINK_SLUG_EMPTY: The specified slug is empty. +// 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // // See https://core.telegram.org/method/account.editBusinessChatLink for reference. func (c *Client) AccountEditBusinessChatLink(ctx context.Context, request *AccountEditBusinessChatLinkRequest) (*BusinessChatLink, error) { diff --git a/tg/tl_account_emoji_statuses_gen.go b/tg/tl_account_emoji_statuses_gen.go index 4ef5063607..91bf2f80d6 100644 --- a/tg/tl_account_emoji_statuses_gen.go +++ b/tg/tl_account_emoji_statuses_gen.go @@ -144,7 +144,7 @@ func (e *AccountEmojiStatusesNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/account.emojiStatuses for reference. type AccountEmojiStatuses struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_get_authorization_form_gen.go b/tg/tl_account_get_authorization_form_gen.go index 4803dc8ab7..6e90b44d01 100644 --- a/tg/tl_account_get_authorization_form_gen.go +++ b/tg/tl_account_get_authorization_form_gen.go @@ -220,6 +220,7 @@ func (g *AccountGetAuthorizationFormRequest) GetPublicKey() (value string) { // // Possible errors: // +// 400 BOT_INVALID: This is not a valid bot. // 400 PUBLIC_KEY_REQUIRED: A public key is required. // // See https://core.telegram.org/method/account.getAuthorizationForm for reference. diff --git a/tg/tl_account_get_bot_business_connection_gen.go b/tg/tl_account_get_bot_business_connection_gen.go index e1fd8a3fa7..ace93c4da3 100644 --- a/tg/tl_account_get_bot_business_connection_gen.go +++ b/tg/tl_account_get_bot_business_connection_gen.go @@ -32,10 +32,35 @@ var ( ) // AccountGetBotBusinessConnectionRequest represents TL type `account.getBotBusinessConnection#76a86270`. +// Bots may invoke this method to re-fetch the updateBotBusinessConnect¹ constructor +// associated with a specific business connection_id, see here »² for more info on +// connected business bots. +// This is needed for example for freshly logged in bots that are receiving some +// updateBotNewBusinessMessage³, etc. updates because some users have already connected +// to the bot before it could login. +// In this case, the bot is receiving messages from the business connection, but it +// hasn't cached the associated updateBotBusinessConnect⁴ with info about the +// connection (can it reply to messages? etc.) yet, and cannot receive the old ones +// because they were sent when the bot wasn't logged into the session yet. +// This method can be used to fetch info about a not-yet-cached business connection, and +// should not be invoked if the info is already cached or to fetch changes, as eventual +// changes will automatically be sent as new updateBotBusinessConnect⁵ updates to the +// bot using the usual update delivery methods »⁶. +// +// Links: +// 1. https://core.telegram.org/constructor/updateBotBusinessConnect +// 2. https://core.telegram.org/api/business#connected-bots +// 3. https://core.telegram.org/constructor/updateBotNewBusinessMessage +// 4. https://core.telegram.org/constructor/updateBotBusinessConnect +// 5. https://core.telegram.org/constructor/updateBotBusinessConnect +// 6. https://core.telegram.org/api/updates // // See https://core.telegram.org/method/account.getBotBusinessConnection for reference. type AccountGetBotBusinessConnectionRequest struct { - // ConnectionID field of AccountGetBotBusinessConnectionRequest. + // Business connection ID »¹. + // + // Links: + // 1) https://core.telegram.org/api/business#connected-bots ConnectionID string } @@ -161,8 +186,35 @@ func (g *AccountGetBotBusinessConnectionRequest) GetConnectionID() (value string } // AccountGetBotBusinessConnection invokes method account.getBotBusinessConnection#76a86270 returning error if any. +// Bots may invoke this method to re-fetch the updateBotBusinessConnect¹ constructor +// associated with a specific business connection_id, see here »² for more info on +// connected business bots. +// This is needed for example for freshly logged in bots that are receiving some +// updateBotNewBusinessMessage³, etc. updates because some users have already connected +// to the bot before it could login. +// In this case, the bot is receiving messages from the business connection, but it +// hasn't cached the associated updateBotBusinessConnect⁴ with info about the +// connection (can it reply to messages? etc.) yet, and cannot receive the old ones +// because they were sent when the bot wasn't logged into the session yet. +// This method can be used to fetch info about a not-yet-cached business connection, and +// should not be invoked if the info is already cached or to fetch changes, as eventual +// changes will automatically be sent as new updateBotBusinessConnect⁵ updates to the +// bot using the usual update delivery methods »⁶. +// +// Links: +// 1. https://core.telegram.org/constructor/updateBotBusinessConnect +// 2. https://core.telegram.org/api/business#connected-bots +// 3. https://core.telegram.org/constructor/updateBotNewBusinessMessage +// 4. https://core.telegram.org/constructor/updateBotBusinessConnect +// 5. https://core.telegram.org/constructor/updateBotBusinessConnect +// 6. https://core.telegram.org/api/updates +// +// Possible errors: +// +// 400 CONNECTION_ID_INVALID: The specified connection ID is invalid. // // See https://core.telegram.org/method/account.getBotBusinessConnection for reference. +// Can be used by bots. func (c *Client) AccountGetBotBusinessConnection(ctx context.Context, connectionid string) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_account_get_business_chat_links_gen.go b/tg/tl_account_get_business_chat_links_gen.go index f0dfe71073..8ec89607ee 100644 --- a/tg/tl_account_get_business_chat_links_gen.go +++ b/tg/tl_account_get_business_chat_links_gen.go @@ -32,6 +32,10 @@ var ( ) // AccountGetBusinessChatLinksRequest represents TL type `account.getBusinessChatLinks#6f70dde1`. +// List all created business chat deep links »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links // // See https://core.telegram.org/method/account.getBusinessChatLinks for reference. type AccountGetBusinessChatLinksRequest struct { @@ -128,6 +132,10 @@ func (g *AccountGetBusinessChatLinksRequest) DecodeBare(b *bin.Buffer) error { } // AccountGetBusinessChatLinks invokes method account.getBusinessChatLinks#6f70dde1 returning error if any. +// List all created business chat deep links »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links // // See https://core.telegram.org/method/account.getBusinessChatLinks for reference. func (c *Client) AccountGetBusinessChatLinks(ctx context.Context) (*AccountBusinessChatLinks, error) { diff --git a/tg/tl_account_get_channel_default_emoji_statuses_gen.go b/tg/tl_account_get_channel_default_emoji_statuses_gen.go index 5764d45d23..513fb02c79 100644 --- a/tg/tl_account_get_channel_default_emoji_statuses_gen.go +++ b/tg/tl_account_get_channel_default_emoji_statuses_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/account.getChannelDefaultEmojiStatuses for reference. type AccountGetChannelDefaultEmojiStatusesRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_get_channel_restricted_status_emojis_gen.go b/tg/tl_account_get_channel_restricted_status_emojis_gen.go index d5e3dcae8b..401bc2098b 100644 --- a/tg/tl_account_get_channel_restricted_status_emojis_gen.go +++ b/tg/tl_account_get_channel_restricted_status_emojis_gen.go @@ -41,7 +41,7 @@ var ( // // See https://core.telegram.org/method/account.getChannelRestrictedStatusEmojis for reference. type AccountGetChannelRestrictedStatusEmojisRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_get_chat_themes_gen.go b/tg/tl_account_get_chat_themes_gen.go index 828484bfb8..f2cf88e81f 100644 --- a/tg/tl_account_get_chat_themes_gen.go +++ b/tg/tl_account_get_chat_themes_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/account.getChatThemes for reference. type AccountGetChatThemesRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_get_connected_bots_gen.go b/tg/tl_account_get_connected_bots_gen.go index 2b8bd944f7..8053d49ccd 100644 --- a/tg/tl_account_get_connected_bots_gen.go +++ b/tg/tl_account_get_connected_bots_gen.go @@ -32,6 +32,10 @@ var ( ) // AccountGetConnectedBotsRequest represents TL type `account.getConnectedBots#4ea4c80f`. +// List all currently connected business bots »¹ +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots // // See https://core.telegram.org/method/account.getConnectedBots for reference. type AccountGetConnectedBotsRequest struct { @@ -128,6 +132,10 @@ func (g *AccountGetConnectedBotsRequest) DecodeBare(b *bin.Buffer) error { } // AccountGetConnectedBots invokes method account.getConnectedBots#4ea4c80f returning error if any. +// List all currently connected business bots »¹ +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots // // See https://core.telegram.org/method/account.getConnectedBots for reference. func (c *Client) AccountGetConnectedBots(ctx context.Context) (*AccountConnectedBots, error) { diff --git a/tg/tl_account_get_default_background_emojis_gen.go b/tg/tl_account_get_default_background_emojis_gen.go index 67547c2e0e..bd8115de2f 100644 --- a/tg/tl_account_get_default_background_emojis_gen.go +++ b/tg/tl_account_get_default_background_emojis_gen.go @@ -41,7 +41,7 @@ var ( // // See https://core.telegram.org/method/account.getDefaultBackgroundEmojis for reference. type AccountGetDefaultBackgroundEmojisRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_get_default_emoji_statuses_gen.go b/tg/tl_account_get_default_emoji_statuses_gen.go index 0b90e510bc..264a08b155 100644 --- a/tg/tl_account_get_default_emoji_statuses_gen.go +++ b/tg/tl_account_get_default_emoji_statuses_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/account.getDefaultEmojiStatuses for reference. type AccountGetDefaultEmojiStatusesRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_get_default_group_photo_emojis_gen.go b/tg/tl_account_get_default_group_photo_emojis_gen.go index 35489801a8..91eeb72ec9 100644 --- a/tg/tl_account_get_default_group_photo_emojis_gen.go +++ b/tg/tl_account_get_default_group_photo_emojis_gen.go @@ -40,7 +40,7 @@ var ( // // See https://core.telegram.org/method/account.getDefaultGroupPhotoEmojis for reference. type AccountGetDefaultGroupPhotoEmojisRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_get_default_profile_photo_emojis_gen.go b/tg/tl_account_get_default_profile_photo_emojis_gen.go index 0f97f77a3b..2d67a2abf2 100644 --- a/tg/tl_account_get_default_profile_photo_emojis_gen.go +++ b/tg/tl_account_get_default_profile_photo_emojis_gen.go @@ -40,7 +40,7 @@ var ( // // See https://core.telegram.org/method/account.getDefaultProfilePhotoEmojis for reference. type AccountGetDefaultProfilePhotoEmojisRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_get_reactions_notify_settings_gen.go b/tg/tl_account_get_reactions_notify_settings_gen.go index 0dbc640a6f..bfc53262dc 100644 --- a/tg/tl_account_get_reactions_notify_settings_gen.go +++ b/tg/tl_account_get_reactions_notify_settings_gen.go @@ -32,6 +32,10 @@ var ( ) // AccountGetReactionsNotifySettingsRequest represents TL type `account.getReactionsNotifySettings#6dd654c`. +// Get the current reaction notification settings »¹. +// +// Links: +// 1. https://core.telegram.org/api/reactions#notifications-about-reactions // // See https://core.telegram.org/method/account.getReactionsNotifySettings for reference. type AccountGetReactionsNotifySettingsRequest struct { @@ -128,6 +132,10 @@ func (g *AccountGetReactionsNotifySettingsRequest) DecodeBare(b *bin.Buffer) err } // AccountGetReactionsNotifySettings invokes method account.getReactionsNotifySettings#6dd654c returning error if any. +// Get the current reaction notification settings »¹. +// +// Links: +// 1. https://core.telegram.org/api/reactions#notifications-about-reactions // // See https://core.telegram.org/method/account.getReactionsNotifySettings for reference. func (c *Client) AccountGetReactionsNotifySettings(ctx context.Context) (*ReactionsNotifySettings, error) { diff --git a/tg/tl_account_get_recent_emoji_statuses_gen.go b/tg/tl_account_get_recent_emoji_statuses_gen.go index a936822ccd..f3ef1f535c 100644 --- a/tg/tl_account_get_recent_emoji_statuses_gen.go +++ b/tg/tl_account_get_recent_emoji_statuses_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/account.getRecentEmojiStatuses for reference. type AccountGetRecentEmojiStatusesRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_get_saved_ringtones_gen.go b/tg/tl_account_get_saved_ringtones_gen.go index ee2a560287..bdc68ecba4 100644 --- a/tg/tl_account_get_saved_ringtones_gen.go +++ b/tg/tl_account_get_saved_ringtones_gen.go @@ -36,7 +36,7 @@ var ( // // See https://core.telegram.org/method/account.getSavedRingtones for reference. type AccountGetSavedRingtonesRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_get_themes_gen.go b/tg/tl_account_get_themes_gen.go index 054fc178e2..057b625b3d 100644 --- a/tg/tl_account_get_themes_gen.go +++ b/tg/tl_account_get_themes_gen.go @@ -38,7 +38,7 @@ var ( type AccountGetThemesRequest struct { // Theme format, a string that identifies the theming engines supported by the client Format string - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_get_wall_papers_gen.go b/tg/tl_account_get_wall_papers_gen.go index f03fa8ead3..f3eb94824a 100644 --- a/tg/tl_account_get_wall_papers_gen.go +++ b/tg/tl_account_get_wall_papers_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/account.getWallPapers for reference. type AccountGetWallPapersRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_reorder_usernames_gen.go b/tg/tl_account_reorder_usernames_gen.go index 2c29842901..e80bd2f6b6 100644 --- a/tg/tl_account_reorder_usernames_gen.go +++ b/tg/tl_account_reorder_usernames_gen.go @@ -180,6 +180,7 @@ func (r *AccountReorderUsernamesRequest) GetOrder() (value []string) { // Possible errors: // // 400 ORDER_INVALID: The specified username order is invalid. +// 400 USERNAME_NOT_MODIFIED: The username was not modified. // // See https://core.telegram.org/method/account.reorderUsernames for reference. func (c *Client) AccountReorderUsernames(ctx context.Context, order []string) (bool, error) { diff --git a/tg/tl_account_resolve_business_chat_link_gen.go b/tg/tl_account_resolve_business_chat_link_gen.go index 5f5afc475e..dfb4b49dac 100644 --- a/tg/tl_account_resolve_business_chat_link_gen.go +++ b/tg/tl_account_resolve_business_chat_link_gen.go @@ -32,10 +32,17 @@ var ( ) // AccountResolveBusinessChatLinkRequest represents TL type `account.resolveBusinessChatLink#5492e5ee`. +// Resolve a business chat deep link »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links // // See https://core.telegram.org/method/account.resolveBusinessChatLink for reference. type AccountResolveBusinessChatLinkRequest struct { - // Slug field of AccountResolveBusinessChatLinkRequest. + // Slug of the link, obtained as specified here »¹. + // + // Links: + // 1) https://core.telegram.org/api/links#business-chat-links Slug string } @@ -161,6 +168,15 @@ func (r *AccountResolveBusinessChatLinkRequest) GetSlug() (value string) { } // AccountResolveBusinessChatLink invokes method account.resolveBusinessChatLink#5492e5ee returning error if any. +// Resolve a business chat deep link »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links +// +// Possible errors: +// +// 400 CHATLINK_SLUG_EMPTY: The specified slug is empty. +// 400 CHATLINK_SLUG_EXPIRED: The specified business chat link has expired. // // See https://core.telegram.org/method/account.resolveBusinessChatLink for reference. func (c *Client) AccountResolveBusinessChatLink(ctx context.Context, slug string) (*AccountResolvedBusinessChatLinks, error) { diff --git a/tg/tl_account_resolved_business_chat_links_gen.go b/tg/tl_account_resolved_business_chat_links_gen.go index 713e2865c1..44b92ffa79 100644 --- a/tg/tl_account_resolved_business_chat_links_gen.go +++ b/tg/tl_account_resolved_business_chat_links_gen.go @@ -32,22 +32,32 @@ var ( ) // AccountResolvedBusinessChatLinks represents TL type `account.resolvedBusinessChatLinks#9a23af21`. +// Contains info about a single resolved business chat deep link »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links // // See https://core.telegram.org/constructor/account.resolvedBusinessChatLinks for reference. type AccountResolvedBusinessChatLinks struct { - // Flags field of AccountResolvedBusinessChatLinks. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Peer field of AccountResolvedBusinessChatLinks. + // Destination peer Peer PeerClass - // Message field of AccountResolvedBusinessChatLinks. + // Message to pre-fill in the message input field. Message string - // Entities field of AccountResolvedBusinessChatLinks. + // Message entities for styled text¹ + // + // Links: + // 1) https://core.telegram.org/api/entities // // Use SetEntities and GetEntities helpers. Entities []MessageEntityClass - // Chats field of AccountResolvedBusinessChatLinks. + // Mentioned chats Chats []ChatClass - // Users field of AccountResolvedBusinessChatLinks. + // Mentioned users Users []UserClass } diff --git a/tg/tl_account_save_auto_save_settings_gen.go b/tg/tl_account_save_auto_save_settings_gen.go index 8c9ca0e844..337fdbca87 100644 --- a/tg/tl_account_save_auto_save_settings_gen.go +++ b/tg/tl_account_save_auto_save_settings_gen.go @@ -351,7 +351,6 @@ func (s *AccountSaveAutoSaveSettingsRequest) GetSettings() (value AutoSaveSettin // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/account.saveAutoSaveSettings for reference. -// Can be used by bots. func (c *Client) AccountSaveAutoSaveSettings(ctx context.Context, request *AccountSaveAutoSaveSettingsRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_account_save_ringtone_gen.go b/tg/tl_account_save_ringtone_gen.go index 621e8a1a31..2a8078c57d 100644 --- a/tg/tl_account_save_ringtone_gen.go +++ b/tg/tl_account_save_ringtone_gen.go @@ -226,6 +226,10 @@ func (s *AccountSaveRingtoneRequest) GetIDAsNotEmpty() (*InputDocument, bool) { // 2. https://core.telegram.org/constructor/account.savedRingtoneConverted // 3. https://core.telegram.org/constructor/document // +// Possible errors: +// +// 400 RINGTONE_INVALID: The specified ringtone is invalid. +// // See https://core.telegram.org/method/account.saveRingtone for reference. func (c *Client) AccountSaveRingtone(ctx context.Context, request *AccountSaveRingtoneRequest) (AccountSavedRingtoneClass, error) { var result AccountSavedRingtoneBox diff --git a/tg/tl_account_save_secure_value_gen.go b/tg/tl_account_save_secure_value_gen.go index 813dbcc633..efaa0076ea 100644 --- a/tg/tl_account_save_secure_value_gen.go +++ b/tg/tl_account_save_secure_value_gen.go @@ -208,6 +208,7 @@ func (s *AccountSaveSecureValueRequest) GetSecureSecretID() (value int64) { // Possible errors: // // 400 PASSWORD_REQUIRED: A 2FA password must be configured to use Telegram Passport. +// 400 SECURE_SECRET_REQUIRED: A secure secret is required. // // See https://core.telegram.org/method/account.saveSecureValue for reference. func (c *Client) AccountSaveSecureValue(ctx context.Context, request *AccountSaveSecureValueRequest) (*SecureValue, error) { diff --git a/tg/tl_account_save_theme_gen.go b/tg/tl_account_save_theme_gen.go index 1708bd20f9..d54b6028b8 100644 --- a/tg/tl_account_save_theme_gen.go +++ b/tg/tl_account_save_theme_gen.go @@ -196,6 +196,10 @@ func (s *AccountSaveThemeRequest) GetUnsave() (value bool) { // AccountSaveTheme invokes method account.saveTheme#f257106c returning error if any. // Save a theme // +// Possible errors: +// +// 400 THEME_INVALID: Invalid theme provided. +// // See https://core.telegram.org/method/account.saveTheme for reference. func (c *Client) AccountSaveTheme(ctx context.Context, request *AccountSaveThemeRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_account_saved_ringtones_gen.go b/tg/tl_account_saved_ringtones_gen.go index 4927db97bf..5545718440 100644 --- a/tg/tl_account_saved_ringtones_gen.go +++ b/tg/tl_account_saved_ringtones_gen.go @@ -138,7 +138,7 @@ func (s *AccountSavedRingtonesNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/account.savedRingtones for reference. type AccountSavedRingtones struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_send_verify_email_code_gen.go b/tg/tl_account_send_verify_email_code_gen.go index 815f28a64d..c1beffd5aa 100644 --- a/tg/tl_account_send_verify_email_code_gen.go +++ b/tg/tl_account_send_verify_email_code_gen.go @@ -199,6 +199,7 @@ func (s *AccountSendVerifyEmailCodeRequest) GetEmail() (value string) { // Possible errors: // // 400 EMAIL_INVALID: The specified email is invalid. +// 400 EMAIL_NOT_ALLOWED: The specified email cannot be used to complete the operation. // 400 EMAIL_NOT_SETUP: In order to change the login email with emailVerifyPurposeLoginChange, an existing login email must already be set using emailVerifyPurposeLoginSetup. // 400 PHONE_HASH_EXPIRED: An invalid or expired phone_code_hash was provided. // 400 PHONE_NUMBER_INVALID: The phone number is invalid. diff --git a/tg/tl_account_set_global_privacy_settings_gen.go b/tg/tl_account_set_global_privacy_settings_gen.go index e22ccbca94..7305c46f8f 100644 --- a/tg/tl_account_set_global_privacy_settings_gen.go +++ b/tg/tl_account_set_global_privacy_settings_gen.go @@ -166,7 +166,8 @@ func (s *AccountSetGlobalPrivacySettingsRequest) GetSettings() (value GlobalPriv // // Possible errors: // -// 400 AUTOARCHIVE_NOT_AVAILABLE: The autoarchive setting is not available at this time: please check the value of the autoarchive_setting_available field in client config » before calling this method. +// 400 AUTOARCHIVE_NOT_AVAILABLE: The autoarchive setting is not available at this time: please check the value of the autoarchive_setting_available field in client config » before calling this method. +// 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // // See https://core.telegram.org/method/account.setGlobalPrivacySettings for reference. func (c *Client) AccountSetGlobalPrivacySettings(ctx context.Context, settings GlobalPrivacySettings) (*GlobalPrivacySettings, error) { diff --git a/tg/tl_account_set_reactions_notify_settings_gen.go b/tg/tl_account_set_reactions_notify_settings_gen.go index 3567bd82b5..c9867de3d0 100644 --- a/tg/tl_account_set_reactions_notify_settings_gen.go +++ b/tg/tl_account_set_reactions_notify_settings_gen.go @@ -32,10 +32,14 @@ var ( ) // AccountSetReactionsNotifySettingsRequest represents TL type `account.setReactionsNotifySettings#316ce548`. +// Change the reaction notification settings »¹. +// +// Links: +// 1. https://core.telegram.org/api/reactions#notifications-about-reactions // // See https://core.telegram.org/method/account.setReactionsNotifySettings for reference. type AccountSetReactionsNotifySettingsRequest struct { - // Settings field of AccountSetReactionsNotifySettingsRequest. + // New reaction notification settings. Settings ReactionsNotifySettings } @@ -161,6 +165,10 @@ func (s *AccountSetReactionsNotifySettingsRequest) GetSettings() (value Reaction } // AccountSetReactionsNotifySettings invokes method account.setReactionsNotifySettings#316ce548 returning error if any. +// Change the reaction notification settings »¹. +// +// Links: +// 1. https://core.telegram.org/api/reactions#notifications-about-reactions // // See https://core.telegram.org/method/account.setReactionsNotifySettings for reference. func (c *Client) AccountSetReactionsNotifySettings(ctx context.Context, settings ReactionsNotifySettings) (*ReactionsNotifySettings, error) { diff --git a/tg/tl_account_themes_gen.go b/tg/tl_account_themes_gen.go index fdd920931e..1d448da04b 100644 --- a/tg/tl_account_themes_gen.go +++ b/tg/tl_account_themes_gen.go @@ -138,7 +138,7 @@ func (t *AccountThemesNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/account.themes for reference. type AccountThemes struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_account_toggle_connected_bot_paused_gen.go b/tg/tl_account_toggle_connected_bot_paused_gen.go index 2a1e91a11c..32464665c0 100644 --- a/tg/tl_account_toggle_connected_bot_paused_gen.go +++ b/tg/tl_account_toggle_connected_bot_paused_gen.go @@ -32,12 +32,17 @@ var ( ) // AccountToggleConnectedBotPausedRequest represents TL type `account.toggleConnectedBotPaused#646e1097`. +// Pause or unpause a specific chat, temporarily disconnecting it from all business bots +// »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots // // See https://core.telegram.org/method/account.toggleConnectedBotPaused for reference. type AccountToggleConnectedBotPausedRequest struct { - // Peer field of AccountToggleConnectedBotPausedRequest. + // The chat to pause Peer InputPeerClass - // Paused field of AccountToggleConnectedBotPausedRequest. + // Whether to pause or unpause the chat Paused bool } @@ -193,6 +198,15 @@ func (t *AccountToggleConnectedBotPausedRequest) GetPaused() (value bool) { } // AccountToggleConnectedBotPaused invokes method account.toggleConnectedBotPaused#646e1097 returning error if any. +// Pause or unpause a specific chat, temporarily disconnecting it from all business bots +// »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/account.toggleConnectedBotPaused for reference. func (c *Client) AccountToggleConnectedBotPaused(ctx context.Context, request *AccountToggleConnectedBotPausedRequest) (bool, error) { diff --git a/tg/tl_account_toggle_sponsored_messages_gen.go b/tg/tl_account_toggle_sponsored_messages_gen.go index 55e139f716..5a03c2ba79 100644 --- a/tg/tl_account_toggle_sponsored_messages_gen.go +++ b/tg/tl_account_toggle_sponsored_messages_gen.go @@ -32,10 +32,17 @@ var ( ) // AccountToggleSponsoredMessagesRequest represents TL type `account.toggleSponsoredMessages#b9d9a38d`. +// Disable or re-enable Telegram ads for the current Premium¹ account. +// Useful for business owners that may want to launch and view their own Telegram ads via +// the Telegram ad platform »¹. +// +// Links: +// 1. https://core.telegram.org/api/premium +// 2. https://ads.telegram.org // // See https://core.telegram.org/method/account.toggleSponsoredMessages for reference. type AccountToggleSponsoredMessagesRequest struct { - // Enabled field of AccountToggleSponsoredMessagesRequest. + // Enable or disable ads. Enabled bool } @@ -161,6 +168,13 @@ func (t *AccountToggleSponsoredMessagesRequest) GetEnabled() (value bool) { } // AccountToggleSponsoredMessages invokes method account.toggleSponsoredMessages#b9d9a38d returning error if any. +// Disable or re-enable Telegram ads for the current Premium¹ account. +// Useful for business owners that may want to launch and view their own Telegram ads via +// the Telegram ad platform »¹. +// +// Links: +// 1. https://core.telegram.org/api/premium +// 2. https://ads.telegram.org // // See https://core.telegram.org/method/account.toggleSponsoredMessages for reference. func (c *Client) AccountToggleSponsoredMessages(ctx context.Context, enabled bool) (bool, error) { diff --git a/tg/tl_account_toggle_username_gen.go b/tg/tl_account_toggle_username_gen.go index e8f2dfc933..0514e6348c 100644 --- a/tg/tl_account_toggle_username_gen.go +++ b/tg/tl_account_toggle_username_gen.go @@ -203,6 +203,7 @@ func (t *AccountToggleUsernameRequest) GetActive() (value bool) { // // 400 USERNAMES_ACTIVE_TOO_MUCH: The maximum number of active usernames was reached. // 400 USERNAME_INVALID: The provided username is not valid. +// 400 USERNAME_NOT_MODIFIED: The username was not modified. // // See https://core.telegram.org/method/account.toggleUsername for reference. func (c *Client) AccountToggleUsername(ctx context.Context, request *AccountToggleUsernameRequest) (bool, error) { diff --git a/tg/tl_account_update_birthday_gen.go b/tg/tl_account_update_birthday_gen.go index 43c7a543a6..0d355dfdcc 100644 --- a/tg/tl_account_update_birthday_gen.go +++ b/tg/tl_account_update_birthday_gen.go @@ -32,12 +32,19 @@ var ( ) // AccountUpdateBirthdayRequest represents TL type `account.updateBirthday#cc6e0c11`. +// Update our birthday, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#birthday // // See https://core.telegram.org/method/account.updateBirthday for reference. type AccountUpdateBirthdayRequest struct { - // Flags field of AccountUpdateBirthdayRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Birthday field of AccountUpdateBirthdayRequest. + // Birthday. // // Use SetBirthday and GetBirthday helpers. Birthday Birthday @@ -200,6 +207,14 @@ func (u *AccountUpdateBirthdayRequest) GetBirthday() (value Birthday, ok bool) { } // AccountUpdateBirthday invokes method account.updateBirthday#cc6e0c11 returning error if any. +// Update our birthday, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#birthday +// +// Possible errors: +// +// 400 BIRTHDAY_INVALID: An invalid age was specified, must be between 0 and 150 years. // // See https://core.telegram.org/method/account.updateBirthday for reference. func (c *Client) AccountUpdateBirthday(ctx context.Context, request *AccountUpdateBirthdayRequest) (bool, error) { diff --git a/tg/tl_account_update_business_away_message_gen.go b/tg/tl_account_update_business_away_message_gen.go index 0ffe8f71ec..f5dd16469d 100644 --- a/tg/tl_account_update_business_away_message_gen.go +++ b/tg/tl_account_update_business_away_message_gen.go @@ -32,12 +32,19 @@ var ( ) // AccountUpdateBusinessAwayMessageRequest represents TL type `account.updateBusinessAwayMessage#a26a7fa5`. +// Set a list of Telegram Business away messages¹. +// +// Links: +// 1. https://core.telegram.org/api/business#away-messages // // See https://core.telegram.org/method/account.updateBusinessAwayMessage for reference. type AccountUpdateBusinessAwayMessageRequest struct { - // Flags field of AccountUpdateBusinessAwayMessageRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Message field of AccountUpdateBusinessAwayMessageRequest. + // Away message configuration and contents. // // Use SetMessage and GetMessage helpers. Message InputBusinessAwayMessage @@ -200,6 +207,10 @@ func (u *AccountUpdateBusinessAwayMessageRequest) GetMessage() (value InputBusin } // AccountUpdateBusinessAwayMessage invokes method account.updateBusinessAwayMessage#a26a7fa5 returning error if any. +// Set a list of Telegram Business away messages¹. +// +// Links: +// 1. https://core.telegram.org/api/business#away-messages // // See https://core.telegram.org/method/account.updateBusinessAwayMessage for reference. func (c *Client) AccountUpdateBusinessAwayMessage(ctx context.Context, request *AccountUpdateBusinessAwayMessageRequest) (bool, error) { diff --git a/tg/tl_account_update_business_greeting_message_gen.go b/tg/tl_account_update_business_greeting_message_gen.go index 8ef99cb5e2..5f194f21ff 100644 --- a/tg/tl_account_update_business_greeting_message_gen.go +++ b/tg/tl_account_update_business_greeting_message_gen.go @@ -32,12 +32,19 @@ var ( ) // AccountUpdateBusinessGreetingMessageRequest represents TL type `account.updateBusinessGreetingMessage#66cdafc4`. +// Set a list of Telegram Business greeting messages¹. +// +// Links: +// 1. https://core.telegram.org/api/business#greeting-messages // // See https://core.telegram.org/method/account.updateBusinessGreetingMessage for reference. type AccountUpdateBusinessGreetingMessageRequest struct { - // Flags field of AccountUpdateBusinessGreetingMessageRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Message field of AccountUpdateBusinessGreetingMessageRequest. + // Greeting message configuration and contents. // // Use SetMessage and GetMessage helpers. Message InputBusinessGreetingMessage @@ -200,6 +207,10 @@ func (u *AccountUpdateBusinessGreetingMessageRequest) GetMessage() (value InputB } // AccountUpdateBusinessGreetingMessage invokes method account.updateBusinessGreetingMessage#66cdafc4 returning error if any. +// Set a list of Telegram Business greeting messages¹. +// +// Links: +// 1. https://core.telegram.org/api/business#greeting-messages // // See https://core.telegram.org/method/account.updateBusinessGreetingMessage for reference. func (c *Client) AccountUpdateBusinessGreetingMessage(ctx context.Context, request *AccountUpdateBusinessGreetingMessageRequest) (bool, error) { diff --git a/tg/tl_account_update_business_intro_gen.go b/tg/tl_account_update_business_intro_gen.go index 67eb6b772a..a6a33986cf 100644 --- a/tg/tl_account_update_business_intro_gen.go +++ b/tg/tl_account_update_business_intro_gen.go @@ -32,12 +32,19 @@ var ( ) // AccountUpdateBusinessIntroRequest represents TL type `account.updateBusinessIntro#a614d034`. +// Set or remove the Telegram Business introduction »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-introduction // // See https://core.telegram.org/method/account.updateBusinessIntro for reference. type AccountUpdateBusinessIntroRequest struct { - // Flags field of AccountUpdateBusinessIntroRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Intro field of AccountUpdateBusinessIntroRequest. + // Telegram Business introduction, to remove it call the method without setting this flag. // // Use SetIntro and GetIntro helpers. Intro InputBusinessIntro @@ -200,6 +207,10 @@ func (u *AccountUpdateBusinessIntroRequest) GetIntro() (value InputBusinessIntro } // AccountUpdateBusinessIntro invokes method account.updateBusinessIntro#a614d034 returning error if any. +// Set or remove the Telegram Business introduction »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-introduction // // See https://core.telegram.org/method/account.updateBusinessIntro for reference. func (c *Client) AccountUpdateBusinessIntro(ctx context.Context, request *AccountUpdateBusinessIntroRequest) (bool, error) { diff --git a/tg/tl_account_update_business_location_gen.go b/tg/tl_account_update_business_location_gen.go index 2de177c904..a765048b50 100644 --- a/tg/tl_account_update_business_location_gen.go +++ b/tg/tl_account_update_business_location_gen.go @@ -32,16 +32,28 @@ var ( ) // AccountUpdateBusinessLocationRequest represents TL type `account.updateBusinessLocation#9e6b131a`. +// Businesses »¹ may advertise their location using this method, see here »² for more +// info. +// To remove business location information invoke the method without setting any of the +// parameters. +// +// Links: +// 1. https://core.telegram.org/api/business#location +// 2. https://core.telegram.org/api/business#location // // See https://core.telegram.org/method/account.updateBusinessLocation for reference. type AccountUpdateBusinessLocationRequest struct { - // Flags field of AccountUpdateBusinessLocationRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // GeoPoint field of AccountUpdateBusinessLocationRequest. + // Optional, contains a set of geographical coordinates. // // Use SetGeoPoint and GetGeoPoint helpers. GeoPoint InputGeoPointClass - // Address field of AccountUpdateBusinessLocationRequest. + // Mandatory when setting/updating the location, contains a textual description of the + // address (max 96 UTF-8 chars). // // Use SetAddress and GetAddress helpers. Address string @@ -262,6 +274,14 @@ func (u *AccountUpdateBusinessLocationRequest) GetGeoPointAsNotEmpty() (*InputGe } // AccountUpdateBusinessLocation invokes method account.updateBusinessLocation#9e6b131a returning error if any. +// Businesses »¹ may advertise their location using this method, see here »² for more +// info. +// To remove business location information invoke the method without setting any of the +// parameters. +// +// Links: +// 1. https://core.telegram.org/api/business#location +// 2. https://core.telegram.org/api/business#location // // See https://core.telegram.org/method/account.updateBusinessLocation for reference. func (c *Client) AccountUpdateBusinessLocation(ctx context.Context, request *AccountUpdateBusinessLocationRequest) (bool, error) { diff --git a/tg/tl_account_update_business_work_hours_gen.go b/tg/tl_account_update_business_work_hours_gen.go index d0d36ce4aa..ce6a2e6ebe 100644 --- a/tg/tl_account_update_business_work_hours_gen.go +++ b/tg/tl_account_update_business_work_hours_gen.go @@ -32,12 +32,26 @@ var ( ) // AccountUpdateBusinessWorkHoursRequest represents TL type `account.updateBusinessWorkHours#4b00e066`. +// Specify a set of Telegram Business opening hours¹. +// This info will be contained in userFull².business_work_hours. +// To remove all opening hours, invoke the method without setting the business_work_hours +// field. +// Note that the opening hours specified by the user must be appropriately validated and +// transformed before invoking the method, as specified here »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#opening-hours +// 2. https://core.telegram.org/constructor/userFull +// 3. https://core.telegram.org/api/business#opening-hours // // See https://core.telegram.org/method/account.updateBusinessWorkHours for reference. type AccountUpdateBusinessWorkHoursRequest struct { - // Flags field of AccountUpdateBusinessWorkHoursRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // BusinessWorkHours field of AccountUpdateBusinessWorkHoursRequest. + // Opening hours (optional, if not set removes all opening hours). // // Use SetBusinessWorkHours and GetBusinessWorkHours helpers. BusinessWorkHours BusinessWorkHours @@ -200,6 +214,23 @@ func (u *AccountUpdateBusinessWorkHoursRequest) GetBusinessWorkHours() (value Bu } // AccountUpdateBusinessWorkHours invokes method account.updateBusinessWorkHours#4b00e066 returning error if any. +// Specify a set of Telegram Business opening hours¹. +// This info will be contained in userFull².business_work_hours. +// To remove all opening hours, invoke the method without setting the business_work_hours +// field. +// Note that the opening hours specified by the user must be appropriately validated and +// transformed before invoking the method, as specified here »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#opening-hours +// 2. https://core.telegram.org/constructor/userFull +// 3. https://core.telegram.org/api/business#opening-hours +// +// Possible errors: +// +// 400 BUSINESS_WORK_HOURS_EMPTY: No work hours were specified. +// 400 BUSINESS_WORK_HOURS_PERIOD_INVALID: The specified work hours are invalid, see here » for the exact requirements. +// 400 TIMEZONE_INVALID: The specified timezone does not exist. // // See https://core.telegram.org/method/account.updateBusinessWorkHours for reference. func (c *Client) AccountUpdateBusinessWorkHours(ctx context.Context, request *AccountUpdateBusinessWorkHoursRequest) (bool, error) { diff --git a/tg/tl_account_update_color_gen.go b/tg/tl_account_update_color_gen.go index 80e6679e1b..ec4f2f4d20 100644 --- a/tg/tl_account_update_color_gen.go +++ b/tg/tl_account_update_color_gen.go @@ -303,6 +303,7 @@ func (u *AccountUpdateColorRequest) GetBackgroundEmojiID() (value int64, ok bool // Possible errors: // // 400 COLOR_INVALID: The specified color palette ID was invalid. +// 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // // See https://core.telegram.org/method/account.updateColor for reference. func (c *Client) AccountUpdateColor(ctx context.Context, request *AccountUpdateColorRequest) (bool, error) { diff --git a/tg/tl_account_update_connected_bot_gen.go b/tg/tl_account_update_connected_bot_gen.go index 5d4ab9d1df..2814e6ac24 100644 --- a/tg/tl_account_update_connected_bot_gen.go +++ b/tg/tl_account_update_connected_bot_gen.go @@ -32,18 +32,30 @@ var ( ) // AccountUpdateConnectedBotRequest represents TL type `account.updateConnectedBot#43d8521d`. +// Connect a business bot »¹ to the current account, or to change the current +// connection settings. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots // // See https://core.telegram.org/method/account.updateConnectedBot for reference. type AccountUpdateConnectedBotRequest struct { - // Flags field of AccountUpdateConnectedBotRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // CanReply field of AccountUpdateConnectedBotRequest. + // Whether the bot can reply to messages it receives from us, on behalf of us using the + // business connection¹. + // + // Links: + // 1) https://core.telegram.org/api/business#connected-bots CanReply bool - // Deleted field of AccountUpdateConnectedBotRequest. + // Whether to fully disconnect the bot from the current account. Deleted bool - // Bot field of AccountUpdateConnectedBotRequest. + // The bot to connect or disconnect Bot InputUserClass - // Recipients field of AccountUpdateConnectedBotRequest. + // Configuration for the business connection Recipients InputBusinessBotRecipients } @@ -281,6 +293,17 @@ func (u *AccountUpdateConnectedBotRequest) GetRecipients() (value InputBusinessB } // AccountUpdateConnectedBot invokes method account.updateConnectedBot#43d8521d returning error if any. +// Connect a business bot »¹ to the current account, or to change the current +// connection settings. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots +// +// Possible errors: +// +// 400 BOT_BUSINESS_MISSING: The specified bot is not a business bot (the user.bot_business flag is not set). +// 400 BUSINESS_RECIPIENTS_EMPTY: You didn't set any flag in inputBusinessBotRecipients, thus the bot cannot work with any peer. +// 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // // See https://core.telegram.org/method/account.updateConnectedBot for reference. func (c *Client) AccountUpdateConnectedBot(ctx context.Context, request *AccountUpdateConnectedBotRequest) (UpdatesClass, error) { diff --git a/tg/tl_account_update_personal_channel_gen.go b/tg/tl_account_update_personal_channel_gen.go index b8a303a348..51d7135bcc 100644 --- a/tg/tl_account_update_personal_channel_gen.go +++ b/tg/tl_account_update_personal_channel_gen.go @@ -32,10 +32,21 @@ var ( ) // AccountUpdatePersonalChannelRequest represents TL type `account.updatePersonalChannel#d94305e0`. +// Associate (or remove) a personal channel »¹, that will be listed on our personal +// profile page »². +// Changing it will emit an updateUser¹ update. +// +// Links: +// 1. https://core.telegram.org/api/channel +// 2. https://core.telegram.org/api/profile#personal-channel +// 3. https://core.telegram.org/constructor/updateUser // // See https://core.telegram.org/method/account.updatePersonalChannel for reference. type AccountUpdatePersonalChannelRequest struct { - // Channel field of AccountUpdatePersonalChannelRequest. + // The channel, pass inputChannelEmpty¹ to remove it. + // + // Links: + // 1) https://core.telegram.org/constructor/inputChannelEmpty Channel InputChannelClass } @@ -171,6 +182,14 @@ func (u *AccountUpdatePersonalChannelRequest) GetChannelAsNotEmpty() (NotEmptyIn } // AccountUpdatePersonalChannel invokes method account.updatePersonalChannel#d94305e0 returning error if any. +// Associate (or remove) a personal channel »¹, that will be listed on our personal +// profile page »². +// Changing it will emit an updateUser¹ update. +// +// Links: +// 1. https://core.telegram.org/api/channel +// 2. https://core.telegram.org/api/profile#personal-channel +// 3. https://core.telegram.org/constructor/updateUser // // See https://core.telegram.org/method/account.updatePersonalChannel for reference. func (c *Client) AccountUpdatePersonalChannel(ctx context.Context, channel InputChannelClass) (bool, error) { diff --git a/tg/tl_account_upload_ringtone_gen.go b/tg/tl_account_upload_ringtone_gen.go index 78f13e4e02..a45b048893 100644 --- a/tg/tl_account_upload_ringtone_gen.go +++ b/tg/tl_account_upload_ringtone_gen.go @@ -231,6 +231,10 @@ func (u *AccountUploadRingtoneRequest) GetMimeType() (value string) { // Links: // 1. https://core.telegram.org/method/account.saveRingtone // +// Possible errors: +// +// 400 RINGTONE_MIME_INVALID: The MIME type for the ringtone is invalid. +// // See https://core.telegram.org/method/account.uploadRingtone for reference. func (c *Client) AccountUploadRingtone(ctx context.Context, request *AccountUploadRingtoneRequest) (DocumentClass, error) { var result DocumentBox diff --git a/tg/tl_account_upload_theme_gen.go b/tg/tl_account_upload_theme_gen.go index 9151ed7910..101e681413 100644 --- a/tg/tl_account_upload_theme_gen.go +++ b/tg/tl_account_upload_theme_gen.go @@ -304,6 +304,7 @@ func (u *AccountUploadThemeRequest) GetMimeType() (value string) { // Possible errors: // // 400 THEME_FILE_INVALID: Invalid theme file provided. +// 400 THEME_MIME_INVALID: The theme's MIME type is invalid. // // See https://core.telegram.org/method/account.uploadTheme for reference. func (c *Client) AccountUploadTheme(ctx context.Context, request *AccountUploadThemeRequest) (DocumentClass, error) { diff --git a/tg/tl_account_verify_email_gen.go b/tg/tl_account_verify_email_gen.go index db187fba39..cc633734a0 100644 --- a/tg/tl_account_verify_email_gen.go +++ b/tg/tl_account_verify_email_gen.go @@ -204,7 +204,9 @@ func (v *AccountVerifyEmailRequest) GetVerification() (value EmailVerificationCl // Possible errors: // // 400 EMAIL_INVALID: The specified email is invalid. +// 400 EMAIL_NOT_ALLOWED: The specified email cannot be used to complete the operation. // 400 EMAIL_VERIFY_EXPIRED: The verification email has expired. +// 400 PHONE_NUMBER_INVALID: The phone number is invalid. // // See https://core.telegram.org/method/account.verifyEmail for reference. func (c *Client) AccountVerifyEmail(ctx context.Context, request *AccountVerifyEmailRequest) (AccountEmailVerifiedClass, error) { diff --git a/tg/tl_account_wall_papers_gen.go b/tg/tl_account_wall_papers_gen.go index 743ce3333a..6aad68af52 100644 --- a/tg/tl_account_wall_papers_gen.go +++ b/tg/tl_account_wall_papers_gen.go @@ -144,7 +144,7 @@ func (w *AccountWallPapersNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/account.wallPapers for reference. type AccountWallPapers struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_attach_menu_bots_gen.go b/tg/tl_attach_menu_bots_gen.go index 033e25212d..aab9129044 100644 --- a/tg/tl_attach_menu_bots_gen.go +++ b/tg/tl_attach_menu_bots_gen.go @@ -141,7 +141,7 @@ func (a *AttachMenuBotsNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/attachMenuBots for reference. type AttachMenuBots struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_auth_check_recovery_password_gen.go b/tg/tl_auth_check_recovery_password_gen.go index 402e768ec9..3f025006d7 100644 --- a/tg/tl_auth_check_recovery_password_gen.go +++ b/tg/tl_auth_check_recovery_password_gen.go @@ -178,6 +178,7 @@ func (c *AuthCheckRecoveryPasswordRequest) GetCode() (value string) { // // Possible errors: // +// 400 CODE_EMPTY: The provided code is empty. // 400 PASSWORD_RECOVERY_EXPIRED: The recovery code has expired. // // See https://core.telegram.org/method/auth.checkRecoveryPassword for reference. diff --git a/tg/tl_auth_report_missing_code_gen.go b/tg/tl_auth_report_missing_code_gen.go index 5f8adb3df7..76d12d1209 100644 --- a/tg/tl_auth_report_missing_code_gen.go +++ b/tg/tl_auth_report_missing_code_gen.go @@ -32,14 +32,21 @@ var ( ) // AuthReportMissingCodeRequest represents TL type `auth.reportMissingCode#cb9deff6`. +// Official apps only, reports that the SMS authentication code wasn't delivered. // // See https://core.telegram.org/method/auth.reportMissingCode for reference. type AuthReportMissingCodeRequest struct { - // PhoneNumber field of AuthReportMissingCodeRequest. + // Phone number where we were supposed to receive the code PhoneNumber string - // PhoneCodeHash field of AuthReportMissingCodeRequest. + // The phone code hash obtained from auth.sendCode¹ + // + // Links: + // 1) https://core.telegram.org/method/auth.sendCode PhoneCodeHash string - // Mnc field of AuthReportMissingCodeRequest. + // MNC¹ of the current network operator. + // + // Links: + // 1) https://en.wikipedia.org/wiki/Mobile_country_code Mnc string } @@ -215,6 +222,11 @@ func (r *AuthReportMissingCodeRequest) GetMnc() (value string) { } // AuthReportMissingCode invokes method auth.reportMissingCode#cb9deff6 returning error if any. +// Official apps only, reports that the SMS authentication code wasn't delivered. +// +// Possible errors: +// +// 400 PHONE_NUMBER_INVALID: The phone number is invalid. // // See https://core.telegram.org/method/auth.reportMissingCode for reference. func (c *Client) AuthReportMissingCode(ctx context.Context, request *AuthReportMissingCodeRequest) (bool, error) { diff --git a/tg/tl_auth_request_firebase_sms_gen.go b/tg/tl_auth_request_firebase_sms_gen.go index d8ab02fb89..62083d7fbb 100644 --- a/tg/tl_auth_request_firebase_sms_gen.go +++ b/tg/tl_auth_request_firebase_sms_gen.go @@ -55,7 +55,10 @@ type AuthRequestFirebaseSMSRequest struct { // // Use SetSafetyNetToken and GetSafetyNetToken helpers. SafetyNetToken string - // PlayIntegrityToken field of AuthRequestFirebaseSMSRequest. + // On Android, an object obtained as described in the auth documentation »¹ + // + // Links: + // 1) https://core.telegram.org/api/auth // // Use SetPlayIntegrityToken and GetPlayIntegrityToken helpers. PlayIntegrityToken string @@ -364,6 +367,7 @@ func (r *AuthRequestFirebaseSMSRequest) GetIosPushSecret() (value string, ok boo // // Possible errors: // +// 400 PHONE_CODE_EMPTY: phone_code is missing. // 400 PHONE_NUMBER_INVALID: The phone number is invalid. // // See https://core.telegram.org/method/auth.requestFirebaseSms for reference. diff --git a/tg/tl_auth_resend_code_gen.go b/tg/tl_auth_resend_code_gen.go index ceeb2619a3..6f63dd9198 100644 --- a/tg/tl_auth_resend_code_gen.go +++ b/tg/tl_auth_resend_code_gen.go @@ -40,7 +40,10 @@ var ( // // See https://core.telegram.org/method/auth.resendCode for reference. type AuthResendCodeRequest struct { - // Flags field of AuthResendCodeRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // The phone number PhoneNumber string @@ -49,7 +52,12 @@ type AuthResendCodeRequest struct { // Links: // 1) https://core.telegram.org/method/auth.sendCode PhoneCodeHash string - // Reason field of AuthResendCodeRequest. + // Official clients only, used if the device integrity verification failed, and no secret + // could be obtained to invoke auth.requestFirebaseSms¹: in this case, the device + // integrity verification failure reason must be passed here. + // + // Links: + // 1) https://core.telegram.org/method/auth.requestFirebaseSms // // Use SetReason and GetReason helpers. Reason string diff --git a/tg/tl_auth_send_code_gen.go b/tg/tl_auth_send_code_gen.go index 33bbf01260..3c1a6dedb9 100644 --- a/tg/tl_auth_send_code_gen.go +++ b/tg/tl_auth_send_code_gen.go @@ -263,6 +263,7 @@ func (s *AuthSendCodeRequest) GetSettings() (value CodeSettings) { // 406 PHONE_PASSWORD_FLOOD: You have tried logging in too many times. // 400 PHONE_PASSWORD_PROTECTED: This phone is password protected. // 400 SMS_CODE_CREATE_FAILED: An error occurred while creating the SMS code. +// 406 UPDATE_APP_TO_LOGIN: Please update to the latest version of MadelineProto to login. // // See https://core.telegram.org/method/auth.sendCode for reference. func (c *Client) AuthSendCode(ctx context.Context, request *AuthSendCodeRequest) (AuthSentCodeClass, error) { diff --git a/tg/tl_auth_sent_code_type_gen.go b/tg/tl_auth_sent_code_type_gen.go index 2e8e06ed9b..ad9b6fa13a 100644 --- a/tg/tl_auth_sent_code_type_gen.go +++ b/tg/tl_auth_sent_code_type_gen.go @@ -1494,11 +1494,11 @@ type AuthSentCodeTypeFirebaseSMS struct { // // Use SetNonce and GetNonce helpers. Nonce []byte - // PlayIntegrityProjectID field of AuthSentCodeTypeFirebaseSMS. + // Google Play Integrity project ID // // Use SetPlayIntegrityProjectID and GetPlayIntegrityProjectID helpers. PlayIntegrityProjectID int64 - // PlayIntegrityNonce field of AuthSentCodeTypeFirebaseSMS. + // Play Integrity API nonce // // Use SetPlayIntegrityNonce and GetPlayIntegrityNonce helpers. PlayIntegrityNonce []byte @@ -1883,12 +1883,18 @@ func (s *AuthSentCodeTypeFirebaseSMS) GetLength() (value int) { } // AuthSentCodeTypeSMSWord represents TL type `auth.sentCodeTypeSmsWord#a416ac81`. +// The code was sent via SMS as a secret word, starting with the letter specified in +// beginning // // See https://core.telegram.org/constructor/auth.sentCodeTypeSmsWord for reference. type AuthSentCodeTypeSMSWord struct { - // Flags field of AuthSentCodeTypeSMSWord. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Beginning field of AuthSentCodeTypeSMSWord. + // If set, the secret word in the sent SMS (which may contain multiple words) starts with + // this letter. // // Use SetBeginning and GetBeginning helpers. Beginning string @@ -2056,12 +2062,17 @@ func (s *AuthSentCodeTypeSMSWord) GetBeginning() (value string, ok bool) { } // AuthSentCodeTypeSMSPhrase represents TL type `auth.sentCodeTypeSmsPhrase#b37794af`. +// The code was sent via SMS as a secret phrase starting with the word specified in +// beginning // // See https://core.telegram.org/constructor/auth.sentCodeTypeSmsPhrase for reference. type AuthSentCodeTypeSMSPhrase struct { - // Flags field of AuthSentCodeTypeSMSPhrase. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Beginning field of AuthSentCodeTypeSMSPhrase. + // If set, the secret phrase (and the SMS) starts with this word. // // Use SetBeginning and GetBeginning helpers. Beginning string diff --git a/tg/tl_auth_sign_in_gen.go b/tg/tl_auth_sign_in_gen.go index bc06adadd3..347af94013 100644 --- a/tg/tl_auth_sign_in_gen.go +++ b/tg/tl_auth_sign_in_gen.go @@ -325,6 +325,7 @@ func (s *AuthSignInRequest) GetEmailVerification() (value EmailVerificationClass // 406 PHONE_NUMBER_INVALID: The phone number is invalid. // 400 PHONE_NUMBER_UNOCCUPIED: The phone number is not yet being used. // 500 SIGN_IN_FAILED: Failure while signing in. +// 406 UPDATE_APP_TO_LOGIN: Please update to the latest version of MadelineProto to login. // // See https://core.telegram.org/method/auth.signIn for reference. func (c *Client) AuthSignIn(ctx context.Context, request *AuthSignInRequest) (AuthAuthorizationClass, error) { diff --git a/tg/tl_auth_sign_up_gen.go b/tg/tl_auth_sign_up_gen.go index 963b89aa9e..1f8866d0be 100644 --- a/tg/tl_auth_sign_up_gen.go +++ b/tg/tl_auth_sign_up_gen.go @@ -36,9 +36,13 @@ var ( // // See https://core.telegram.org/method/auth.signUp for reference. type AuthSignUpRequest struct { - // Flags field of AuthSignUpRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // NoJoinedNotifications field of AuthSignUpRequest. + // If set, users on Telegram that have already added phone_number to their contacts will + // not receive signup notifications about this user. NoJoinedNotifications bool // Phone number in the international format PhoneNumber string diff --git a/tg/tl_available_effect_gen.go b/tg/tl_available_effect_gen.go index 6b20973d23..a71b7f4c85 100644 --- a/tg/tl_available_effect_gen.go +++ b/tg/tl_available_effect_gen.go @@ -32,24 +32,54 @@ var ( ) // AvailableEffect represents TL type `availableEffect#93c3e27e`. +// Represents a message effect »¹. +// All long IDs except for id are document¹.ids from the containing messages +// availableEffects² constructor. +// See here »¹ for more info on how to use following fields. +// +// Links: +// 1. https://core.telegram.org/api/effects +// 2. https://core.telegram.org/constructor/document +// 3. https://core.telegram.org/constructor/messages.availableEffects +// 4. https://core.telegram.org/api/effects // // See https://core.telegram.org/constructor/availableEffect for reference. type AvailableEffect struct { - // Flags field of AvailableEffect. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // PremiumRequired field of AvailableEffect. + // Whether a Premium¹ subscription is required to use this effect. + // + // Links: + // 1) https://core.telegram.org/api/premium PremiumRequired bool - // ID field of AvailableEffect. + // Unique effect ID. ID int64 - // Emoticon field of AvailableEffect. + // Emoji corresponding to the effect, to be used as icon for the effect if static_icon_id + // is not set. Emoticon string - // StaticIconID field of AvailableEffect. + // ID of the document containing the static icon (WEBP) of the effect. // // Use SetStaticIconID and GetStaticIconID helpers. StaticIconID int64 - // EffectStickerID field of AvailableEffect. + // Contains the preview animation (TGS format »)¹, used for the effect selection menu. + // + // Links: + // 1) https://core.telegram.org/api/stickers#animated-stickers EffectStickerID int64 - // EffectAnimationID field of AvailableEffect. + // If set, contains the actual animated effect (TGS format »)¹. If not set, the + // animated effect must be set equal to the premium animated sticker effect² associated + // to the animated sticker specified in effect_sticker_id (always different from the + // preview animation, fetched thanks to the videoSize³ of type f as specified here + // »⁴). + // + // Links: + // 1) https://core.telegram.org/api/stickers#animated-stickers + // 2) https://core.telegram.org/api/stickers#premium-animated-sticker-effects + // 3) https://core.telegram.org/constructor/videoSize + // 4) https://core.telegram.org/api/stickers#premium-animated-sticker-effects // // Use SetEffectAnimationID and GetEffectAnimationID helpers. EffectAnimationID int64 diff --git a/tg/tl_birthday_gen.go b/tg/tl_birthday_gen.go index 9a41b8c141..0d38e73a3f 100644 --- a/tg/tl_birthday_gen.go +++ b/tg/tl_birthday_gen.go @@ -32,16 +32,26 @@ var ( ) // Birthday represents TL type `birthday#6c8e1e06`. +// Birthday¹ information for a user. +// Also used to invite users to gift Telegram Premium subscriptions »¹ to other users +// with birthdays within a +1/-1 day time range, related to the current day. +// +// Links: +// 1. https://core.telegram.org/api/profile#birthday +// 2. https://core.telegram.org/api/premium#gifting-telegram-premium // // See https://core.telegram.org/constructor/birthday for reference. type Birthday struct { - // Flags field of Birthday. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Day field of Birthday. + // Birth day Day int - // Month field of Birthday. + // Birth month Month int - // Year field of Birthday. + // (Optional) birth year. // // Use SetYear and GetYear helpers. Year int diff --git a/tg/tl_boost_gen.go b/tg/tl_boost_gen.go index 32b03a615d..acf6b675c4 100644 --- a/tg/tl_boost_gen.go +++ b/tg/tl_boost_gen.go @@ -44,14 +44,14 @@ type Boost struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Whether this boost was applied because the channel directly gifted a subscription to - // the user¹. + // Whether this boost was applied because the channel/supergroup directly gifted a + // subscription to the user¹. // // Links: // 1) https://core.telegram.org/api/giveaways Gift bool // Whether this boost was applied because the user was chosen in a giveaway started by - // the channel¹. + // the channel/supergroup¹. // // Links: // 1) https://core.telegram.org/api/giveaways diff --git a/tg/tl_bot_business_connection_gen.go b/tg/tl_bot_business_connection_gen.go index 87710a3fbf..3c774ef1b3 100644 --- a/tg/tl_bot_business_connection_gen.go +++ b/tg/tl_bot_business_connection_gen.go @@ -32,22 +32,39 @@ var ( ) // BotBusinessConnection represents TL type `botBusinessConnection#896433b4`. +// Contains info about a bot business connection¹. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots // // See https://core.telegram.org/constructor/botBusinessConnection for reference. type BotBusinessConnection struct { - // Flags field of BotBusinessConnection. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // CanReply field of BotBusinessConnection. + // Whether the bot can reply on behalf of the user to messages it receives through the + // business connection CanReply bool - // Disabled field of BotBusinessConnection. + // Whether this business connection is currently disabled Disabled bool - // ConnectionID field of BotBusinessConnection. + // Business connection ID, used to identify messages coming from the connection and to + // reply to them as specified here »¹. + // + // Links: + // 1) https://core.telegram.org/api/business#connected-bots ConnectionID string - // UserID field of BotBusinessConnection. + // ID of the user that the bot is connected to via this connection. UserID int64 - // DCID field of BotBusinessConnection. + // ID of the datacenter where to send queries wrapped in a invokeWithBusinessConnection¹ + // as specified here »². + // + // Links: + // 1) https://core.telegram.org/method/invokeWithBusinessConnection + // 2) https://core.telegram.org/api/business#connected-bots DCID int - // Date field of BotBusinessConnection. + // When was the connection created. Date int } diff --git a/tg/tl_bot_info_gen.go b/tg/tl_bot_info_gen.go index 25ca2dcb19..6964aa3b42 100644 --- a/tg/tl_bot_info_gen.go +++ b/tg/tl_bot_info_gen.go @@ -41,7 +41,11 @@ type BotInfo struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // HasPreviewMedias field of BotInfo. + // If set, the bot has some preview medias for the configured Main Mini App, see here + // »¹ for more info on Main Mini App preview medias. + // + // Links: + // 1) https://core.telegram.org/api/bots/webapps#main-mini-app-previews HasPreviewMedias bool // ID of the bot // diff --git a/tg/tl_bot_inline_message_gen.go b/tg/tl_bot_inline_message_gen.go index b781852ee6..2fefcaa0ed 100644 --- a/tg/tl_bot_inline_message_gen.go +++ b/tg/tl_bot_inline_message_gen.go @@ -1740,10 +1740,11 @@ type BotInlineMessageMediaInvoice struct { // // Use SetPhoto and GetPhoto helpers. Photo WebDocumentClass - // Three-letter ISO 4217 currency¹ code + // Three-letter ISO 4217 currency¹ code, or XTR for Telegram Stars². // // Links: // 1) https://core.telegram.org/bots/payments#supported-currencies + // 2) https://core.telegram.org/api/stars Currency string // Total price in the smallest units of the currency (integer, not float/double). For // example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in diff --git a/tg/tl_bot_preview_media_gen.go b/tg/tl_bot_preview_media_gen.go index 83ffc9bf86..3bcd09cfa5 100644 --- a/tg/tl_bot_preview_media_gen.go +++ b/tg/tl_bot_preview_media_gen.go @@ -32,12 +32,16 @@ var ( ) // BotPreviewMedia represents TL type `botPreviewMedia#23e91ba3`. +// Represents a Main Mini App preview media, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews // // See https://core.telegram.org/constructor/botPreviewMedia for reference. type BotPreviewMedia struct { - // Date field of BotPreviewMedia. + // When was this media last updated. Date int - // Media field of BotPreviewMedia. + // The actual photo/video. Media MessageMediaClass } diff --git a/tg/tl_bots_add_preview_media_gen.go b/tg/tl_bots_add_preview_media_gen.go index c4b75f56d0..ee8e50c1eb 100644 --- a/tg/tl_bots_add_preview_media_gen.go +++ b/tg/tl_bots_add_preview_media_gen.go @@ -32,14 +32,24 @@ var ( ) // BotsAddPreviewMediaRequest represents TL type `bots.addPreviewMedia#17aeb75a`. +// Add a main mini app preview, see here »¹ for more info. +// Only owners of bots with a configured Main Mini App can use this method, see see here +// »¹ for more info on how to check if you can invoke this method. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// 2. https://core.telegram.org/api/bots/webapps#main-mini-app-previews // // See https://core.telegram.org/method/bots.addPreviewMedia for reference. type BotsAddPreviewMediaRequest struct { - // Bot field of BotsAddPreviewMediaRequest. + // The bot that owns the Main Mini App. Bot InputUserClass - // LangCode field of BotsAddPreviewMediaRequest. + // ISO 639-1 language code, indicating the localization of the preview to add. LangCode string - // Media field of BotsAddPreviewMediaRequest. + // The photo/video preview, uploaded using messages.uploadMedia¹. + // + // Links: + // 1) https://core.telegram.org/method/messages.uploadMedia Media InputMediaClass } @@ -225,6 +235,17 @@ func (a *BotsAddPreviewMediaRequest) GetMedia() (value InputMediaClass) { } // BotsAddPreviewMedia invokes method bots.addPreviewMedia#17aeb75a returning error if any. +// Add a main mini app preview, see here »¹ for more info. +// Only owners of bots with a configured Main Mini App can use this method, see see here +// »¹ for more info on how to check if you can invoke this method. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// 2. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. // // See https://core.telegram.org/method/bots.addPreviewMedia for reference. func (c *Client) BotsAddPreviewMedia(ctx context.Context, request *BotsAddPreviewMediaRequest) (*BotPreviewMedia, error) { diff --git a/tg/tl_bots_answer_webhook_json_query_gen.go b/tg/tl_bots_answer_webhook_json_query_gen.go index 4afe9bdb28..08ea73b26e 100644 --- a/tg/tl_bots_answer_webhook_json_query_gen.go +++ b/tg/tl_bots_answer_webhook_json_query_gen.go @@ -196,6 +196,7 @@ func (a *BotsAnswerWebhookJSONQueryRequest) GetData() (value DataJSON) { // 400 DATA_JSON_INVALID: The provided JSON data is invalid. // 400 QUERY_ID_INVALID: The query ID is invalid. // 403 USER_BOT_INVALID: User accounts must provide the bot method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts. +// 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.answerWebhookJSONQuery for reference. // Can be used by bots. diff --git a/tg/tl_bots_delete_preview_media_gen.go b/tg/tl_bots_delete_preview_media_gen.go index 7a453d3d09..e86c0791d3 100644 --- a/tg/tl_bots_delete_preview_media_gen.go +++ b/tg/tl_bots_delete_preview_media_gen.go @@ -32,14 +32,24 @@ var ( ) // BotsDeletePreviewMediaRequest represents TL type `bots.deletePreviewMedia#2d0135b3`. +// Delete a main mini app preview, see here »¹ for more info. +// Only owners of bots with a configured Main Mini App can use this method, see see here +// »¹ for more info on how to check if you can invoke this method. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// 2. https://core.telegram.org/api/bots/webapps#main-mini-app-previews // // See https://core.telegram.org/method/bots.deletePreviewMedia for reference. type BotsDeletePreviewMediaRequest struct { - // Bot field of BotsDeletePreviewMediaRequest. + // The bot that owns the Main Mini App. Bot InputUserClass - // LangCode field of BotsDeletePreviewMediaRequest. + // ISO 639-1 language code, indicating the localization of the preview to delete. LangCode string - // Media field of BotsDeletePreviewMediaRequest. + // The photo/video preview to delete, previously fetched as specified here »¹. + // + // Links: + // 1) https://core.telegram.org/api/bots/webapps#main-mini-app-previews Media []InputMediaClass } @@ -243,6 +253,17 @@ func (d *BotsDeletePreviewMediaRequest) MapMedia() (value InputMediaClassArray) } // BotsDeletePreviewMedia invokes method bots.deletePreviewMedia#2d0135b3 returning error if any. +// Delete a main mini app preview, see here »¹ for more info. +// Only owners of bots with a configured Main Mini App can use this method, see see here +// »¹ for more info on how to check if you can invoke this method. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// 2. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. // // See https://core.telegram.org/method/bots.deletePreviewMedia for reference. func (c *Client) BotsDeletePreviewMedia(ctx context.Context, request *BotsDeletePreviewMediaRequest) (bool, error) { diff --git a/tg/tl_bots_edit_preview_media_gen.go b/tg/tl_bots_edit_preview_media_gen.go index 21c00cb77b..aa00c0d956 100644 --- a/tg/tl_bots_edit_preview_media_gen.go +++ b/tg/tl_bots_edit_preview_media_gen.go @@ -32,16 +32,29 @@ var ( ) // BotsEditPreviewMediaRequest represents TL type `bots.editPreviewMedia#8525606f`. +// Edit a main mini app preview, see here »¹ for more info. +// Only owners of bots with a configured Main Mini App can use this method, see see here +// »¹ for more info on how to check if you can invoke this method. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// 2. https://core.telegram.org/api/bots/webapps#main-mini-app-previews // // See https://core.telegram.org/method/bots.editPreviewMedia for reference. type BotsEditPreviewMediaRequest struct { - // Bot field of BotsEditPreviewMediaRequest. + // The bot that owns the Main Mini App. Bot InputUserClass - // LangCode field of BotsEditPreviewMediaRequest. + // ISO 639-1 language code, indicating the localization of the preview to edit. LangCode string - // Media field of BotsEditPreviewMediaRequest. + // The photo/video preview to replace, previously fetched as specified here »¹. + // + // Links: + // 1) https://core.telegram.org/api/bots/webapps#main-mini-app-previews Media InputMediaClass - // NewMedia field of BotsEditPreviewMediaRequest. + // The new photo/video preview, uploaded using messages.uploadMedia¹. + // + // Links: + // 1) https://core.telegram.org/method/messages.uploadMedia NewMedia InputMediaClass } @@ -257,6 +270,17 @@ func (e *BotsEditPreviewMediaRequest) GetNewMedia() (value InputMediaClass) { } // BotsEditPreviewMedia invokes method bots.editPreviewMedia#8525606f returning error if any. +// Edit a main mini app preview, see here »¹ for more info. +// Only owners of bots with a configured Main Mini App can use this method, see see here +// »¹ for more info on how to check if you can invoke this method. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// 2. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. // // See https://core.telegram.org/method/bots.editPreviewMedia for reference. func (c *Client) BotsEditPreviewMedia(ctx context.Context, request *BotsEditPreviewMediaRequest) (*BotPreviewMedia, error) { diff --git a/tg/tl_bots_get_bot_commands_gen.go b/tg/tl_bots_get_bot_commands_gen.go index 499a10ed93..c6064a615b 100644 --- a/tg/tl_bots_get_bot_commands_gen.go +++ b/tg/tl_bots_get_bot_commands_gen.go @@ -199,6 +199,7 @@ func (g *BotsGetBotCommandsRequest) GetLangCode() (value string) { // Possible errors: // // 400 USER_BOT_INVALID: User accounts must provide the bot method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts. +// 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.getBotCommands for reference. // Can be used by bots. diff --git a/tg/tl_bots_get_bot_info_gen.go b/tg/tl_bots_get_bot_info_gen.go index 102cfe55a3..bf848d61ce 100644 --- a/tg/tl_bots_get_bot_info_gen.go +++ b/tg/tl_bots_get_bot_info_gen.go @@ -243,6 +243,7 @@ func (g *BotsGetBotInfoRequest) GetLangCode() (value string) { // // Possible errors: // +// 400 BOT_INVALID: This is not a valid bot. // 400 LANG_CODE_INVALID: The specified language code is invalid. // 400 USER_BOT_INVALID: User accounts must provide the bot method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts. // diff --git a/tg/tl_bots_get_popular_app_bots_gen.go b/tg/tl_bots_get_popular_app_bots_gen.go index 9a00a5d1de..c8edfe7926 100644 --- a/tg/tl_bots_get_popular_app_bots_gen.go +++ b/tg/tl_bots_get_popular_app_bots_gen.go @@ -32,12 +32,24 @@ var ( ) // BotsGetPopularAppBotsRequest represents TL type `bots.getPopularAppBots#c2510192`. +// Fetch popular Main Mini Apps¹, to be used in the apps tab of global search »². +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-apps +// 2. https://core.telegram.org/api/search#apps-tab // // See https://core.telegram.org/method/bots.getPopularAppBots for reference. type BotsGetPopularAppBotsRequest struct { - // Offset field of BotsGetPopularAppBotsRequest. + // Offset for pagination¹, initially an empty string, then re-use the next_offset + // returned by the previous query. + // + // Links: + // 1) https://core.telegram.org/api/offsets Offset string - // Limit field of BotsGetPopularAppBotsRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -188,6 +200,11 @@ func (g *BotsGetPopularAppBotsRequest) GetLimit() (value int) { } // BotsGetPopularAppBots invokes method bots.getPopularAppBots#c2510192 returning error if any. +// Fetch popular Main Mini Apps¹, to be used in the apps tab of global search »². +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-apps +// 2. https://core.telegram.org/api/search#apps-tab // // See https://core.telegram.org/method/bots.getPopularAppBots for reference. func (c *Client) BotsGetPopularAppBots(ctx context.Context, request *BotsGetPopularAppBotsRequest) (*BotsPopularAppBots, error) { diff --git a/tg/tl_bots_get_preview_info_gen.go b/tg/tl_bots_get_preview_info_gen.go index 4408ce3bbe..0087c2e779 100644 --- a/tg/tl_bots_get_preview_info_gen.go +++ b/tg/tl_bots_get_preview_info_gen.go @@ -32,12 +32,22 @@ var ( ) // BotsGetPreviewInfoRequest represents TL type `bots.getPreviewInfo#423ab3ad`. +// Bot owners only, fetch main mini app preview information, see here »¹ for more info. +// Note: technically non-owners may also invoke this method, but it will always behave +// exactly as bots.getPreviewMedias¹, returning only previews for the current language +// and an empty lang_codes array, regardless of the passed lang_code, so please only use +// bots.getPreviewMedias² if you're not the owner of the bot. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// 2. https://core.telegram.org/method/bots.getPreviewMedias +// 3. https://core.telegram.org/method/bots.getPreviewMedias // // See https://core.telegram.org/method/bots.getPreviewInfo for reference. type BotsGetPreviewInfoRequest struct { - // Bot field of BotsGetPreviewInfoRequest. + // The bot that owns the Main Mini App. Bot InputUserClass - // LangCode field of BotsGetPreviewInfoRequest. + // Fetch previews for the specified ISO 639-1 language code. LangCode string } @@ -193,6 +203,20 @@ func (g *BotsGetPreviewInfoRequest) GetLangCode() (value string) { } // BotsGetPreviewInfo invokes method bots.getPreviewInfo#423ab3ad returning error if any. +// Bot owners only, fetch main mini app preview information, see here »¹ for more info. +// Note: technically non-owners may also invoke this method, but it will always behave +// exactly as bots.getPreviewMedias¹, returning only previews for the current language +// and an empty lang_codes array, regardless of the passed lang_code, so please only use +// bots.getPreviewMedias² if you're not the owner of the bot. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// 2. https://core.telegram.org/method/bots.getPreviewMedias +// 3. https://core.telegram.org/method/bots.getPreviewMedias +// +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. // // See https://core.telegram.org/method/bots.getPreviewInfo for reference. func (c *Client) BotsGetPreviewInfo(ctx context.Context, request *BotsGetPreviewInfoRequest) (*BotsPreviewInfo, error) { diff --git a/tg/tl_bots_get_preview_medias_gen.go b/tg/tl_bots_get_preview_medias_gen.go index 312eaf6fc8..2db81f3089 100644 --- a/tg/tl_bots_get_preview_medias_gen.go +++ b/tg/tl_bots_get_preview_medias_gen.go @@ -32,10 +32,14 @@ var ( ) // BotsGetPreviewMediasRequest represents TL type `bots.getPreviewMedias#a2a5594d`. +// Fetch main mini app previews, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews // // See https://core.telegram.org/method/bots.getPreviewMedias for reference. type BotsGetPreviewMediasRequest struct { - // Bot field of BotsGetPreviewMediasRequest. + // The bot that owns the Main Mini App. Bot InputUserClass } @@ -166,6 +170,14 @@ func (g *BotsGetPreviewMediasRequest) GetBot() (value InputUserClass) { } // BotsGetPreviewMedias invokes method bots.getPreviewMedias#a2a5594d returning error if any. +// Fetch main mini app previews, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. // // See https://core.telegram.org/method/bots.getPreviewMedias for reference. func (c *Client) BotsGetPreviewMedias(ctx context.Context, bot InputUserClass) ([]BotPreviewMedia, error) { diff --git a/tg/tl_bots_invoke_web_view_custom_method_gen.go b/tg/tl_bots_invoke_web_view_custom_method_gen.go index a542b5d5d6..bf8d777a9c 100644 --- a/tg/tl_bots_invoke_web_view_custom_method_gen.go +++ b/tg/tl_bots_invoke_web_view_custom_method_gen.go @@ -247,6 +247,7 @@ func (i *BotsInvokeWebViewCustomMethodRequest) GetParams() (value DataJSON) { // Possible errors: // // 400 BOT_INVALID: This is not a valid bot. +// 400 DATA_JSON_INVALID: The provided JSON data is invalid. // // See https://core.telegram.org/method/bots.invokeWebViewCustomMethod for reference. func (c *Client) BotsInvokeWebViewCustomMethod(ctx context.Context, request *BotsInvokeWebViewCustomMethodRequest) (*DataJSON, error) { diff --git a/tg/tl_bots_popular_app_bots_gen.go b/tg/tl_bots_popular_app_bots_gen.go index be7ebb0972..2b321886b1 100644 --- a/tg/tl_bots_popular_app_bots_gen.go +++ b/tg/tl_bots_popular_app_bots_gen.go @@ -32,16 +32,30 @@ var ( ) // BotsPopularAppBots represents TL type `bots.popularAppBots#1991b13b`. +// Popular Main Mini Apps¹, to be used in the apps tab of global search »². +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-apps +// 2. https://core.telegram.org/api/search#apps-tab // // See https://core.telegram.org/constructor/bots.popularAppBots for reference. type BotsPopularAppBots struct { - // Flags field of BotsPopularAppBots. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // NextOffset field of BotsPopularAppBots. + // Offset for pagination¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets // // Use SetNextOffset and GetNextOffset helpers. NextOffset string - // Users field of BotsPopularAppBots. + // The bots associated to each Main Mini App, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/bots/webapps#main-mini-apps Users []UserClass } diff --git a/tg/tl_bots_preview_info_gen.go b/tg/tl_bots_preview_info_gen.go index 0ca01842c5..8a2e382ff1 100644 --- a/tg/tl_bots_preview_info_gen.go +++ b/tg/tl_bots_preview_info_gen.go @@ -32,12 +32,23 @@ var ( ) // BotsPreviewInfo represents TL type `bots.previewInfo#ca71d64`. +// Contains info about Main Mini App previews, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews // // See https://core.telegram.org/constructor/bots.previewInfo for reference. type BotsPreviewInfo struct { - // Media field of BotsPreviewInfo. + // All preview medias for the language code passed to bots.getPreviewInfo¹. + // + // Links: + // 1) https://core.telegram.org/method/bots.getPreviewInfo Media []BotPreviewMedia - // LangCodes field of BotsPreviewInfo. + // All available language codes for which preview medias were uploaded (regardless of the + // language code passed to bots.getPreviewInfo¹). + // + // Links: + // 1) https://core.telegram.org/method/bots.getPreviewInfo LangCodes []string } diff --git a/tg/tl_bots_reorder_preview_medias_gen.go b/tg/tl_bots_reorder_preview_medias_gen.go index b921e527b1..149f00b157 100644 --- a/tg/tl_bots_reorder_preview_medias_gen.go +++ b/tg/tl_bots_reorder_preview_medias_gen.go @@ -32,14 +32,21 @@ var ( ) // BotsReorderPreviewMediasRequest represents TL type `bots.reorderPreviewMedias#b627f3aa`. +// Reorder a main mini app previews, see here »¹ for more info. +// Only owners of bots with a configured Main Mini App can use this method, see see here +// »¹ for more info on how to check if you can invoke this method. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// 2. https://core.telegram.org/api/bots/webapps#main-mini-app-previews // // See https://core.telegram.org/method/bots.reorderPreviewMedias for reference. type BotsReorderPreviewMediasRequest struct { - // Bot field of BotsReorderPreviewMediasRequest. + // The bot that owns the Main Mini App. Bot InputUserClass - // LangCode field of BotsReorderPreviewMediasRequest. + // ISO 639-1 language code, indicating the localization of the previews to reorder. LangCode string - // Order field of BotsReorderPreviewMediasRequest. + // New order of the previews. Order []InputMediaClass } @@ -243,6 +250,17 @@ func (r *BotsReorderPreviewMediasRequest) MapOrder() (value InputMediaClassArray } // BotsReorderPreviewMedias invokes method bots.reorderPreviewMedias#b627f3aa returning error if any. +// Reorder a main mini app previews, see here »¹ for more info. +// Only owners of bots with a configured Main Mini App can use this method, see see here +// »¹ for more info on how to check if you can invoke this method. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// 2. https://core.telegram.org/api/bots/webapps#main-mini-app-previews +// +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. // // See https://core.telegram.org/method/bots.reorderPreviewMedias for reference. func (c *Client) BotsReorderPreviewMedias(ctx context.Context, request *BotsReorderPreviewMediasRequest) (bool, error) { diff --git a/tg/tl_bots_reorder_usernames_gen.go b/tg/tl_bots_reorder_usernames_gen.go index 073eeae48f..43b76ff005 100644 --- a/tg/tl_bots_reorder_usernames_gen.go +++ b/tg/tl_bots_reorder_usernames_gen.go @@ -212,9 +212,9 @@ func (r *BotsReorderUsernamesRequest) GetOrder() (value []string) { // Possible errors: // // 400 BOT_INVALID: This is not a valid bot. +// 400 USERNAME_NOT_MODIFIED: The username was not modified. // // See https://core.telegram.org/method/bots.reorderUsernames for reference. -// Can be used by bots. func (c *Client) BotsReorderUsernames(ctx context.Context, request *BotsReorderUsernamesRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_bots_reset_bot_commands_gen.go b/tg/tl_bots_reset_bot_commands_gen.go index 2b1db27ddc..07cec2fe59 100644 --- a/tg/tl_bots_reset_bot_commands_gen.go +++ b/tg/tl_bots_reset_bot_commands_gen.go @@ -199,6 +199,7 @@ func (r *BotsResetBotCommandsRequest) GetLangCode() (value string) { // Possible errors: // // 400 LANG_CODE_INVALID: The specified language code is invalid. +// 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.resetBotCommands for reference. // Can be used by bots. diff --git a/tg/tl_bots_send_custom_request_gen.go b/tg/tl_bots_send_custom_request_gen.go index 1eba2e2a8c..55c78d04f1 100644 --- a/tg/tl_bots_send_custom_request_gen.go +++ b/tg/tl_bots_send_custom_request_gen.go @@ -196,6 +196,7 @@ func (s *BotsSendCustomRequestRequest) GetParams() (value DataJSON) { // 400 DATA_JSON_INVALID: The provided JSON data is invalid. // 400 METHOD_INVALID: The specified method is invalid. // 403 USER_BOT_INVALID: User accounts must provide the bot method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts. +// 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.sendCustomRequest for reference. // Can be used by bots. diff --git a/tg/tl_bots_set_bot_broadcast_default_admin_rights_gen.go b/tg/tl_bots_set_bot_broadcast_default_admin_rights_gen.go index 88ca334093..1dcf7a354f 100644 --- a/tg/tl_bots_set_bot_broadcast_default_admin_rights_gen.go +++ b/tg/tl_bots_set_bot_broadcast_default_admin_rights_gen.go @@ -177,6 +177,7 @@ func (s *BotsSetBotBroadcastDefaultAdminRightsRequest) GetAdminRights() (value C // Possible errors: // // 400 RIGHTS_NOT_MODIFIED: The new admin rights are equal to the old rights, no change was made. +// 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.setBotBroadcastDefaultAdminRights for reference. // Can be used by bots. diff --git a/tg/tl_bots_set_bot_menu_button_gen.go b/tg/tl_bots_set_bot_menu_button_gen.go index f376c1b4b1..283e03483f 100644 --- a/tg/tl_bots_set_bot_menu_button_gen.go +++ b/tg/tl_bots_set_bot_menu_button_gen.go @@ -211,6 +211,7 @@ func (s *BotsSetBotMenuButtonRequest) GetButton() (value BotMenuButtonClass) { // // 400 BUTTON_TEXT_INVALID: The specified button text is invalid. // 400 BUTTON_URL_INVALID: Button URL invalid. +// 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.setBotMenuButton for reference. // Can be used by bots. diff --git a/tg/tl_bots_toggle_username_gen.go b/tg/tl_bots_toggle_username_gen.go index d9d62f7fc3..569bae3dd0 100644 --- a/tg/tl_bots_toggle_username_gen.go +++ b/tg/tl_bots_toggle_username_gen.go @@ -232,9 +232,9 @@ func (t *BotsToggleUsernameRequest) GetActive() (value bool) { // Possible errors: // // 400 BOT_INVALID: This is not a valid bot. +// 400 USERNAME_NOT_MODIFIED: The username was not modified. // // See https://core.telegram.org/method/bots.toggleUsername for reference. -// Can be used by bots. func (c *Client) BotsToggleUsername(ctx context.Context, request *BotsToggleUsernameRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_broadcast_revenue_balances_gen.go b/tg/tl_broadcast_revenue_balances_gen.go index 59715cd579..eb1dc11d61 100644 --- a/tg/tl_broadcast_revenue_balances_gen.go +++ b/tg/tl_broadcast_revenue_balances_gen.go @@ -32,6 +32,13 @@ var ( ) // BroadcastRevenueBalances represents TL type `broadcastRevenueBalances#c3ff71e7`. +// Describes channel ad revenue balances »¹. +// Note that all balances are in the smallest unit of the chosen cryptocurrency +// (currently nanotons for TONs, so to obtain a value in USD divide the chosen amount by +// 10^9, and then divide by usd_rate). +// +// Links: +// 1. https://core.telegram.org/api/revenue // // See https://core.telegram.org/constructor/broadcastRevenueBalances for reference. type BroadcastRevenueBalances struct { @@ -39,11 +46,12 @@ type BroadcastRevenueBalances struct { Flags bin.Fields // WithdrawalEnabled field of BroadcastRevenueBalances. WithdrawalEnabled bool - // CurrentBalance field of BroadcastRevenueBalances. + // Amount of not-yet-withdrawn cryptocurrency. CurrentBalance int64 - // AvailableBalance field of BroadcastRevenueBalances. + // Amount of withdrawable cryptocurrency, out of the currently available balance + // (available_balance <= current_balance). AvailableBalance int64 - // OverallRevenue field of BroadcastRevenueBalances. + // Total amount of earned cryptocurrency. OverallRevenue int64 } diff --git a/tg/tl_broadcast_revenue_transaction_gen.go b/tg/tl_broadcast_revenue_transaction_gen.go index 002ebfa0ed..5e5e054ff6 100644 --- a/tg/tl_broadcast_revenue_transaction_gen.go +++ b/tg/tl_broadcast_revenue_transaction_gen.go @@ -32,14 +32,19 @@ var ( ) // BroadcastRevenueTransactionProceeds represents TL type `broadcastRevenueTransactionProceeds#557e2cc4`. +// Describes earnings from sponsored messages in a channel in some time frame, see here +// »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/revenue // // See https://core.telegram.org/constructor/broadcastRevenueTransactionProceeds for reference. type BroadcastRevenueTransactionProceeds struct { - // Amount field of BroadcastRevenueTransactionProceeds. + // Amount in the smallest unit of the cryptocurrency. Amount int64 - // FromDate field of BroadcastRevenueTransactionProceeds. + // Start unixtime for the timeframe. FromDate int - // ToDate field of BroadcastRevenueTransactionProceeds. + // End unixtime for the timeframe. ToDate int } @@ -220,26 +225,36 @@ func (b *BroadcastRevenueTransactionProceeds) GetToDate() (value int) { } // BroadcastRevenueTransactionWithdrawal represents TL type `broadcastRevenueTransactionWithdrawal#5a590978`. +// Describes a withdrawal of ad earnings »¹ +// +// Links: +// 1. https://core.telegram.org/api/revenue#withdrawing-revenue // // See https://core.telegram.org/constructor/broadcastRevenueTransactionWithdrawal for reference. type BroadcastRevenueTransactionWithdrawal struct { - // Flags field of BroadcastRevenueTransactionWithdrawal. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Pending field of BroadcastRevenueTransactionWithdrawal. + // Whether the withdrawal is currently pending Pending bool - // Failed field of BroadcastRevenueTransactionWithdrawal. + // Whether the withdrawal has failed Failed bool - // Amount field of BroadcastRevenueTransactionWithdrawal. + // Amount withdrawn Amount int64 - // Date field of BroadcastRevenueTransactionWithdrawal. + // Withdrawal date Date int - // Provider field of BroadcastRevenueTransactionWithdrawal. + // Payment provider name Provider string - // TransactionDate field of BroadcastRevenueTransactionWithdrawal. + // If neither pending nor failed are set, the transaction was completed successfully, and + // this field will contain the point in time (Unix timestamp) when the withdrawal was + // completed successfully. // // Use SetTransactionDate and GetTransactionDate helpers. TransactionDate int - // TransactionURL field of BroadcastRevenueTransactionWithdrawal. + // If neither pending nor failed are set, the transaction was completed successfully, and + // this field will contain a URL where the withdrawal transaction can be viewed. // // Use SetTransactionURL and GetTransactionURL helpers. TransactionURL string @@ -594,14 +609,18 @@ func (b *BroadcastRevenueTransactionWithdrawal) GetTransactionURL() (value strin } // BroadcastRevenueTransactionRefund represents TL type `broadcastRevenueTransactionRefund#42d30d2e`. +// Describes a refund for failed withdrawal of ad earnings »¹ +// +// Links: +// 1. https://core.telegram.org/api/revenue#withdrawing-revenue // // See https://core.telegram.org/constructor/broadcastRevenueTransactionRefund for reference. type BroadcastRevenueTransactionRefund struct { - // Amount field of BroadcastRevenueTransactionRefund. + // Amount refunded. Amount int64 - // Date field of BroadcastRevenueTransactionRefund. + // Date of refund. Date int - // Provider field of BroadcastRevenueTransactionRefund. + // Payment provider name. Provider string } @@ -818,7 +837,7 @@ type BroadcastRevenueTransactionClass interface { // Zero returns true if current object has a zero value. Zero() bool - // Amount field of BroadcastRevenueTransactionProceeds. + // Amount in the smallest unit of the cryptocurrency. GetAmount() (value int64) } diff --git a/tg/tl_business_away_message_gen.go b/tg/tl_business_away_message_gen.go index 236faffdcf..183b5c77d9 100644 --- a/tg/tl_business_away_message_gen.go +++ b/tg/tl_business_away_message_gen.go @@ -32,18 +32,31 @@ var ( ) // BusinessAwayMessage represents TL type `businessAwayMessage#ef156a5c`. +// Describes a Telegram Business away message¹, automatically sent to users writing to +// us when we're offline, during closing hours, while we're on vacation, or in some other +// custom time period when we cannot immediately answer to the user. +// +// Links: +// 1. https://core.telegram.org/api/business#away-messages // // See https://core.telegram.org/constructor/businessAwayMessage for reference. type BusinessAwayMessage struct { - // Flags field of BusinessAwayMessage. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // OfflineOnly field of BusinessAwayMessage. + // If set, the messages will not be sent if the account was online in the last 10 minutes. OfflineOnly bool - // ShortcutID field of BusinessAwayMessage. + // ID of a quick reply shorcut, containing the away messages to send, see here » for + // more info¹. + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts ShortcutID int - // Schedule field of BusinessAwayMessage. + // Specifies when should the away messages be sent. Schedule BusinessAwayMessageScheduleClass - // Recipients field of BusinessAwayMessage. + // Allowed recipients for the away messages. Recipients BusinessRecipients } diff --git a/tg/tl_business_away_message_schedule_gen.go b/tg/tl_business_away_message_schedule_gen.go index 836a884e5a..ae514171fa 100644 --- a/tg/tl_business_away_message_schedule_gen.go +++ b/tg/tl_business_away_message_schedule_gen.go @@ -32,6 +32,10 @@ var ( ) // BusinessAwayMessageScheduleAlways represents TL type `businessAwayMessageScheduleAlways#c9b9e2b9`. +// Always send Telegram Business away messages¹ to users writing to us in private. +// +// Links: +// 1. https://core.telegram.org/api/business#away-messages // // See https://core.telegram.org/constructor/businessAwayMessageScheduleAlways for reference. type BusinessAwayMessageScheduleAlways struct { @@ -133,6 +137,12 @@ func (b *BusinessAwayMessageScheduleAlways) DecodeBare(buf *bin.Buffer) error { } // BusinessAwayMessageScheduleOutsideWorkHours represents TL type `businessAwayMessageScheduleOutsideWorkHours#c3f2f501`. +// Send Telegram Business away messages¹ to users writing to us in private outside of +// the configured Telegram Business working hours². +// +// Links: +// 1. https://core.telegram.org/api/business#away-messages +// 2. https://core.telegram.org/api/business#opening-hours // // See https://core.telegram.org/constructor/businessAwayMessageScheduleOutsideWorkHours for reference. type BusinessAwayMessageScheduleOutsideWorkHours struct { @@ -236,12 +246,17 @@ func (b *BusinessAwayMessageScheduleOutsideWorkHours) DecodeBare(buf *bin.Buffer } // BusinessAwayMessageScheduleCustom represents TL type `businessAwayMessageScheduleCustom#cc4d9ecc`. +// Send Telegram Business away messages¹ to users writing to us in private in the +// specified time span. +// +// Links: +// 1. https://core.telegram.org/api/business#away-messages // // See https://core.telegram.org/constructor/businessAwayMessageScheduleCustom for reference. type BusinessAwayMessageScheduleCustom struct { - // StartDate field of BusinessAwayMessageScheduleCustom. + // Start date (UNIX timestamp). StartDate int - // EndDate field of BusinessAwayMessageScheduleCustom. + // End date (UNIX timestamp). EndDate int } diff --git a/tg/tl_business_bot_recipients_gen.go b/tg/tl_business_bot_recipients_gen.go index 315ff02ee1..e4fa891752 100644 --- a/tg/tl_business_bot_recipients_gen.go +++ b/tg/tl_business_bot_recipients_gen.go @@ -32,26 +32,37 @@ var ( ) // BusinessBotRecipients represents TL type `businessBotRecipients#b88cf373`. +// Specifies the private chats that a connected business bot »¹ may receive messages +// and interact with. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots // // See https://core.telegram.org/constructor/businessBotRecipients for reference. type BusinessBotRecipients struct { - // Flags field of BusinessBotRecipients. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ExistingChats field of BusinessBotRecipients. + // Selects all existing private chats. ExistingChats bool - // NewChats field of BusinessBotRecipients. + // Selects all new private chats. NewChats bool - // Contacts field of BusinessBotRecipients. + // Selects all private chats with contacts. Contacts bool - // NonContacts field of BusinessBotRecipients. + // Selects all private chats with non-contacts. NonContacts bool - // ExcludeSelected field of BusinessBotRecipients. + // If set, then all private chats except the ones selected by existing_chats, new_chats, + // contacts, non_contacts and users are chosen. Note that if this flag is set, any values + // passed in exclude_users will be merged and moved into users by the server, thus + // exclude_users will always be empty. ExcludeSelected bool - // Users field of BusinessBotRecipients. + // Explicitly selected private chats. // // Use SetUsers and GetUsers helpers. Users []int64 - // ExcludeUsers field of BusinessBotRecipients. + // Identifiers of private chats that are always excluded. // // Use SetExcludeUsers and GetExcludeUsers helpers. ExcludeUsers []int64 diff --git a/tg/tl_business_chat_link_gen.go b/tg/tl_business_chat_link_gen.go index 3ea17e29ca..07b60cb9d8 100644 --- a/tg/tl_business_chat_link_gen.go +++ b/tg/tl_business_chat_link_gen.go @@ -32,24 +32,38 @@ var ( ) // BusinessChatLink represents TL type `businessChatLink#b4ae666f`. +// Contains info about a business chat deep link »¹ created by the current account. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links // // See https://core.telegram.org/constructor/businessChatLink for reference. type BusinessChatLink struct { - // Flags field of BusinessChatLink. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Link field of BusinessChatLink. + // Business chat deep link¹. + // + // Links: + // 1) https://core.telegram.org/api/links#business-chat-links Link string - // Message field of BusinessChatLink. + // Message to pre-fill in the message input field. Message string - // Entities field of BusinessChatLink. + // Message entities for styled text¹ + // + // Links: + // 1) https://core.telegram.org/api/entities // // Use SetEntities and GetEntities helpers. Entities []MessageEntityClass - // Title field of BusinessChatLink. + // Human-readable name of the link, to simplify management in the UI (only visible to the + // creator of the link). // // Use SetTitle and GetTitle helpers. Title string - // Views field of BusinessChatLink. + // Number of times the link was resolved (clicked/scanned/etc...). Views int } diff --git a/tg/tl_business_greeting_message_gen.go b/tg/tl_business_greeting_message_gen.go index a8e29ed3b7..aa161b5ac9 100644 --- a/tg/tl_business_greeting_message_gen.go +++ b/tg/tl_business_greeting_message_gen.go @@ -32,14 +32,24 @@ var ( ) // BusinessGreetingMessage represents TL type `businessGreetingMessage#e519abab`. +// Describes a Telegram Business greeting¹, automatically sent to new users writing to +// us in private for the first time, or after a certain inactivity period. +// +// Links: +// 1. https://core.telegram.org/api/business#greeting-messages // // See https://core.telegram.org/constructor/businessGreetingMessage for reference. type BusinessGreetingMessage struct { - // ShortcutID field of BusinessGreetingMessage. + // ID of a quick reply shorcut, containing the greeting messages to send, see here » for + // more info¹. + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts ShortcutID int - // Recipients field of BusinessGreetingMessage. + // Allowed recipients for the greeting messages. Recipients BusinessRecipients - // NoActivityDays field of BusinessGreetingMessage. + // The number of days after which a private chat will be considered as inactive; + // currently, must be one of 7, 14, 21, or 28. NoActivityDays int } diff --git a/tg/tl_business_intro_gen.go b/tg/tl_business_intro_gen.go index 328bd23374..fbf31da9e4 100644 --- a/tg/tl_business_intro_gen.go +++ b/tg/tl_business_intro_gen.go @@ -32,16 +32,32 @@ var ( ) // BusinessIntro represents TL type `businessIntro#5a0a066d`. +// Telegram Business introduction »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-introduction // // See https://core.telegram.org/constructor/businessIntro for reference. type BusinessIntro struct { - // Flags field of BusinessIntro. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Title field of BusinessIntro. + // Title of the introduction message (max intro_title_length_limit »¹ UTF-8 characters). + // + // Links: + // 1) https://core.telegram.org/api/config#intro-title-length-limit Title string - // Description field of BusinessIntro. + // Profile introduction (max intro_description_length_limit »¹ UTF-8 characters). + // + // Links: + // 1) https://core.telegram.org/api/config#intro-description-length-limit Description string - // Sticker field of BusinessIntro. + // Optional introduction sticker¹. + // + // Links: + // 1) https://core.telegram.org/api/stickers // // Use SetSticker and GetSticker helpers. Sticker DocumentClass diff --git a/tg/tl_business_location_gen.go b/tg/tl_business_location_gen.go index 2ca1f72647..fc039f7a10 100644 --- a/tg/tl_business_location_gen.go +++ b/tg/tl_business_location_gen.go @@ -32,16 +32,23 @@ var ( ) // BusinessLocation represents TL type `businessLocation#ac5c1af7`. +// Represents the location of a Telegram Business »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#location // // See https://core.telegram.org/constructor/businessLocation for reference. type BusinessLocation struct { - // Flags field of BusinessLocation. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // GeoPoint field of BusinessLocation. + // Geographical coordinates (optional). // // Use SetGeoPoint and GetGeoPoint helpers. GeoPoint GeoPointClass - // Address field of BusinessLocation. + // Textual description of the address (mandatory). Address string } diff --git a/tg/tl_business_recipients_gen.go b/tg/tl_business_recipients_gen.go index 5dd11d456c..b213f513b1 100644 --- a/tg/tl_business_recipients_gen.go +++ b/tg/tl_business_recipients_gen.go @@ -32,22 +32,35 @@ var ( ) // BusinessRecipients represents TL type `businessRecipients#21108ff7`. +// Specifies the chats that can receive Telegram Business away »¹ and greeting »² +// messages. +// If exclude_selected is set, specifies all chats that cannot receive Telegram Business +// away »¹ and greeting »² messages. +// +// Links: +// 1. https://core.telegram.org/api/business#away-messages +// 2. https://core.telegram.org/api/business#greeting-messages +// 3. https://core.telegram.org/api/business#away-messages +// 4. https://core.telegram.org/api/business#greeting-messages // // See https://core.telegram.org/constructor/businessRecipients for reference. type BusinessRecipients struct { - // Flags field of BusinessRecipients. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ExistingChats field of BusinessRecipients. + // All existing private chats. ExistingChats bool - // NewChats field of BusinessRecipients. + // All new private chats. NewChats bool - // Contacts field of BusinessRecipients. + // All private chats with contacts. Contacts bool - // NonContacts field of BusinessRecipients. + // All private chats with non-contacts. NonContacts bool - // ExcludeSelected field of BusinessRecipients. + // If set, inverts the selection. ExcludeSelected bool - // Users field of BusinessRecipients. + // Only private chats with the specified users. // // Use SetUsers and GetUsers helpers. Users []int64 diff --git a/tg/tl_business_weekly_open_gen.go b/tg/tl_business_weekly_open_gen.go index adfd24a8a6..a7269043e1 100644 --- a/tg/tl_business_weekly_open_gen.go +++ b/tg/tl_business_weekly_open_gen.go @@ -32,12 +32,24 @@ var ( ) // BusinessWeeklyOpen represents TL type `businessWeeklyOpen#120b1ab9`. +// A time interval, indicating the opening hours of a business. +// Note that opening hours specified by the user must be appropriately validated and +// transformed before uploading them to the server, as specified here »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#opening-hours // // See https://core.telegram.org/constructor/businessWeeklyOpen for reference. type BusinessWeeklyOpen struct { - // StartMinute field of BusinessWeeklyOpen. + // Start minute in minutes of the week, 0 to 7*24*60 inclusively. StartMinute int - // EndMinute field of BusinessWeeklyOpen. + // End minute in minutes of the week, 1 to 8*24*60 inclusively (8 and not 7 because this + // allows to specify intervals that, for example, start on Sunday 21:00 and end on Monday + // 04:00 (6*24*60+21*60 to 7*24*60+4*60) without passing an invalid end_minute < + // start_minute). See here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/business#opening-hours EndMinute int } diff --git a/tg/tl_business_work_hours_gen.go b/tg/tl_business_work_hours_gen.go index 4cb1698f8e..b994094ef0 100644 --- a/tg/tl_business_work_hours_gen.go +++ b/tg/tl_business_work_hours_gen.go @@ -32,16 +32,43 @@ var ( ) // BusinessWorkHours represents TL type `businessWorkHours#8c92b098`. +// Specifies a set of Telegram Business opening hours¹. +// +// Links: +// 1. https://core.telegram.org/api/business#opening-hours // // See https://core.telegram.org/constructor/businessWorkHours for reference. type BusinessWorkHours struct { - // Flags field of BusinessWorkHours. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // OpenNow field of BusinessWorkHours. + // Ignored if set while invoking account.updateBusinessWorkHours¹, only returned by the + // server in userFull².business_work_hours, indicating whether the business is currently + // open according to the current time and the values in weekly_open and timezone. + // + // Links: + // 1) https://core.telegram.org/method/account.updateBusinessWorkHours + // 2) https://core.telegram.org/constructor/userFull OpenNow bool - // TimezoneID field of BusinessWorkHours. + // An ID of one of the timezones returned by help.getTimezonesList¹. The timezone ID + // is contained timezone².id, a human-readable, localized name of the timezone is + // available in timezone³.name and the timezone⁴.utc_offset field contains the UTC + // offset in seconds, which may be displayed in hh:mm format by the client together with + // the human-readable name (i.e. $name UTC -01:00). + // + // Links: + // 1) https://core.telegram.org/method/help.getTimezonesList + // 2) https://core.telegram.org/constructor/timezone + // 3) https://core.telegram.org/constructor/timezone + // 4) https://core.telegram.org/constructor/timezone TimezoneID string - // WeeklyOpen field of BusinessWorkHours. + // A list of time intervals (max 28) represented by businessWeeklyOpen »¹, indicating + // the opening hours of their business. + // + // Links: + // 1) https://core.telegram.org/constructor/businessWeeklyOpen WeeklyOpen []BusinessWeeklyOpen } diff --git a/tg/tl_channel_admin_log_event_action_gen.go b/tg/tl_channel_admin_log_event_action_gen.go index d0b803a095..3ee56e7ad0 100644 --- a/tg/tl_channel_admin_log_event_action_gen.go +++ b/tg/tl_channel_admin_log_event_action_gen.go @@ -7396,12 +7396,16 @@ func (c *ChannelAdminLogEventActionChangeEmojiStatus) GetNewValue() (value Emoji } // ChannelAdminLogEventActionChangeEmojiStickerSet represents TL type `channelAdminLogEventActionChangeEmojiStickerSet#46d840ab`. +// The supergroup's custom emoji stickerset¹ was changed. +// +// Links: +// 1. https://core.telegram.org/api/boost#setting-a-custom-emoji-stickerset-for-supergroups // // See https://core.telegram.org/constructor/channelAdminLogEventActionChangeEmojiStickerSet for reference. type ChannelAdminLogEventActionChangeEmojiStickerSet struct { - // PrevStickerset field of ChannelAdminLogEventActionChangeEmojiStickerSet. + // Old value PrevStickerset InputStickerSetClass - // NewStickerset field of ChannelAdminLogEventActionChangeEmojiStickerSet. + // New value NewStickerset InputStickerSetClass } diff --git a/tg/tl_channels_deactivate_all_usernames_gen.go b/tg/tl_channels_deactivate_all_usernames_gen.go index 738cdd03ec..4553296ed6 100644 --- a/tg/tl_channels_deactivate_all_usernames_gen.go +++ b/tg/tl_channels_deactivate_all_usernames_gen.go @@ -174,8 +174,11 @@ func (d *ChannelsDeactivateAllUsernamesRequest) GetChannelAsNotEmpty() (NotEmpty // ChannelsDeactivateAllUsernames invokes method channels.deactivateAllUsernames#a245dd3 returning error if any. // Disable all purchased usernames of a supergroup or channel // +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. +// // See https://core.telegram.org/method/channels.deactivateAllUsernames for reference. -// Can be used by bots. func (c *Client) ChannelsDeactivateAllUsernames(ctx context.Context, channel InputChannelClass) (bool, error) { var result BoolBox diff --git a/tg/tl_channels_edit_admin_gen.go b/tg/tl_channels_edit_admin_gen.go index 803d76efda..23d957cd3e 100644 --- a/tg/tl_channels_edit_admin_gen.go +++ b/tg/tl_channels_edit_admin_gen.go @@ -289,7 +289,7 @@ func (e *ChannelsEditAdminRequest) GetChannelAsNotEmpty() (NotEmptyInputChannel, // 400 USERS_TOO_MUCH: The maximum number of users has been exceeded (to create a chat, for example). // 400 USER_BLOCKED: User blocked. // 403 USER_CHANNELS_TOO_MUCH: One of the users you tried to add is already in too many channels/supergroups. -// 400 USER_CREATOR: You can't leave this channel, because you're its creator. +// 400 USER_CREATOR: For channels.editAdmin: you've tried to edit the admin rights of the owner, but you're not the owner; for channels.leaveChannel: you can't leave this channel, because you're its creator. // 400 USER_ID_INVALID: The provided user ID is invalid. // 403 USER_NOT_MUTUAL_CONTACT: The provided user is not a mutual contact. // 403 USER_PRIVACY_RESTRICTED: The user's privacy settings do not allow you to do this. diff --git a/tg/tl_channels_edit_creator_gen.go b/tg/tl_channels_edit_creator_gen.go index 4477f39785..ad7c189746 100644 --- a/tg/tl_channels_edit_creator_gen.go +++ b/tg/tl_channels_edit_creator_gen.go @@ -254,7 +254,7 @@ func (e *ChannelsEditCreatorRequest) GetPasswordAsNotEmpty() (*InputCheckPasswor // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 PASSWORD_HASH_INVALID: The provided password hash is invalid. -// 400 PASSWORD_MISSING: You must enable 2FA in order to transfer ownership of a channel. +// 400 PASSWORD_MISSING: You must enable 2FA before executing this operation. // 400 PASSWORD_TOO_FRESH_%d: The password was modified less than 24 hours ago, try again in %d seconds. // 400 SESSION_TOO_FRESH_%d: This session was created less than 24 hours ago, try again in %d seconds. // 400 SRP_ID_INVALID: Invalid SRP ID provided. diff --git a/tg/tl_channels_edit_location_gen.go b/tg/tl_channels_edit_location_gen.go index cff623baa9..948ac63b01 100644 --- a/tg/tl_channels_edit_location_gen.go +++ b/tg/tl_channels_edit_location_gen.go @@ -249,6 +249,7 @@ func (e *ChannelsEditLocationRequest) GetGeoPointAsNotEmpty() (*InputGeoPoint, b // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 400 MEGAGROUP_GEO_REQUIRED: This method can only be invoked on a geogroup. diff --git a/tg/tl_channels_get_admined_public_channels_gen.go b/tg/tl_channels_get_admined_public_channels_gen.go index 9c95b18f5d..e82e732104 100644 --- a/tg/tl_channels_get_admined_public_channels_gen.go +++ b/tg/tl_channels_get_admined_public_channels_gen.go @@ -62,7 +62,12 @@ type ChannelsGetAdminedPublicChannelsRequest struct { // 3) https://core.telegram.org/method/channels.checkUsername // 4) https://core.telegram.org/method/channels.updateUsername CheckLimit bool - // ForPersonal field of ChannelsGetAdminedPublicChannelsRequest. + // Set this flag to only fetch the full list of channels that may be passed to account + // updatePersonalChannel¹ to display them on our profile page². + // + // Links: + // 1) https://core.telegram.org/method/account.updatePersonalChannel + // 2) https://core.telegram.org/api/profile#personal-channel ForPersonal bool } diff --git a/tg/tl_channels_get_channel_recommendations_gen.go b/tg/tl_channels_get_channel_recommendations_gen.go index df7338f3a3..c0986d5b6d 100644 --- a/tg/tl_channels_get_channel_recommendations_gen.go +++ b/tg/tl_channels_get_channel_recommendations_gen.go @@ -37,9 +37,13 @@ var ( // // See https://core.telegram.org/method/channels.getChannelRecommendations for reference. type ChannelsGetChannelRecommendationsRequest struct { - // Flags field of ChannelsGetChannelRecommendationsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // The method will return channels related to the passed channel. + // The method will return channels related to the passed channel. If not set, the method + // will returns channels related to channels the user has joined. // // Use SetChannel and GetChannel helpers. Channel InputChannelClass @@ -222,6 +226,7 @@ func (g *ChannelsGetChannelRecommendationsRequest) GetChannelAsNotEmpty() (NotEm // Possible errors: // // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // // See https://core.telegram.org/method/channels.getChannelRecommendations for reference. func (c *Client) ChannelsGetChannelRecommendations(ctx context.Context, request *ChannelsGetChannelRecommendationsRequest) (MessagesChatsClass, error) { diff --git a/tg/tl_channels_get_forum_topics_by_id_gen.go b/tg/tl_channels_get_forum_topics_by_id_gen.go index f2cafad019..e066da5ad8 100644 --- a/tg/tl_channels_get_forum_topics_by_id_gen.go +++ b/tg/tl_channels_get_forum_topics_by_id_gen.go @@ -221,7 +221,6 @@ func (g *ChannelsGetForumTopicsByIDRequest) GetChannelAsNotEmpty() (NotEmptyInpu // 400 TOPICS_EMPTY: You specified no topic IDs. // // See https://core.telegram.org/method/channels.getForumTopicsByID for reference. -// Can be used by bots. func (c *Client) ChannelsGetForumTopicsByID(ctx context.Context, request *ChannelsGetForumTopicsByIDRequest) (*MessagesForumTopics, error) { var result MessagesForumTopics diff --git a/tg/tl_channels_get_send_as_gen.go b/tg/tl_channels_get_send_as_gen.go index 3798b5f31d..f19eaf97c3 100644 --- a/tg/tl_channels_get_send_as_gen.go +++ b/tg/tl_channels_get_send_as_gen.go @@ -171,6 +171,7 @@ func (g *ChannelsGetSendAsRequest) GetPeer() (value InputPeerClass) { // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. diff --git a/tg/tl_channels_invite_to_channel_gen.go b/tg/tl_channels_invite_to_channel_gen.go index 14bdf7f3f3..17b3702e8a 100644 --- a/tg/tl_channels_invite_to_channel_gen.go +++ b/tg/tl_channels_invite_to_channel_gen.go @@ -33,13 +33,6 @@ var ( // ChannelsInviteToChannelRequest represents TL type `channels.inviteToChannel#c9e33d54`. // Invite users to a channel/supergroup -// May also return 0-N updates of type updateGroupInvitePrivacyForbidden¹: it indicates -// we couldn't add a user to a chat because of their privacy settings; if required, an -// invite link² can be shared with the user, instead. -// -// Links: -// 1. https://core.telegram.org/constructor/updateGroupInvitePrivacyForbidden -// 2. https://core.telegram.org/api/invites // // See https://core.telegram.org/method/channels.inviteToChannel for reference. type ChannelsInviteToChannelRequest struct { @@ -230,13 +223,6 @@ func (i *ChannelsInviteToChannelRequest) MapUsers() (value InputUserClassArray) // ChannelsInviteToChannel invokes method channels.inviteToChannel#c9e33d54 returning error if any. // Invite users to a channel/supergroup -// May also return 0-N updates of type updateGroupInvitePrivacyForbidden¹: it indicates -// we couldn't add a user to a chat because of their privacy settings; if required, an -// invite link² can be shared with the user, instead. -// -// Links: -// 1. https://core.telegram.org/constructor/updateGroupInvitePrivacyForbidden -// 2. https://core.telegram.org/api/invites // // Possible errors: // diff --git a/tg/tl_channels_leave_channel_gen.go b/tg/tl_channels_leave_channel_gen.go index 84097cc859..ccd05df15d 100644 --- a/tg/tl_channels_leave_channel_gen.go +++ b/tg/tl_channels_leave_channel_gen.go @@ -191,7 +191,7 @@ func (l *ChannelsLeaveChannelRequest) GetChannelAsNotEmpty() (NotEmptyInputChann // 400 CHAT_INVALID: Invalid chat. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. -// 400 USER_CREATOR: You can't leave this channel, because you're its creator. +// 400 USER_CREATOR: For channels.editAdmin: you've tried to edit the admin rights of the owner, but you're not the owner; for channels.leaveChannel: you can't leave this channel, because you're its creator. // 400 USER_NOT_PARTICIPANT: You're not a member of this supergroup/channel. // // See https://core.telegram.org/method/channels.leaveChannel for reference. diff --git a/tg/tl_channels_reorder_pinned_forum_topics_gen.go b/tg/tl_channels_reorder_pinned_forum_topics_gen.go index 211cb5da12..830c5ec91c 100644 --- a/tg/tl_channels_reorder_pinned_forum_topics_gen.go +++ b/tg/tl_channels_reorder_pinned_forum_topics_gen.go @@ -278,8 +278,11 @@ func (r *ChannelsReorderPinnedForumTopicsRequest) GetChannelAsNotEmpty() (NotEmp // ChannelsReorderPinnedForumTopics invokes method channels.reorderPinnedForumTopics#2950a18f returning error if any. // Reorder pinned forum topics // +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. +// // See https://core.telegram.org/method/channels.reorderPinnedForumTopics for reference. -// Can be used by bots. func (c *Client) ChannelsReorderPinnedForumTopics(ctx context.Context, request *ChannelsReorderPinnedForumTopicsRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_channels_reorder_usernames_gen.go b/tg/tl_channels_reorder_usernames_gen.go index afd040fdbc..473823dfb4 100644 --- a/tg/tl_channels_reorder_usernames_gen.go +++ b/tg/tl_channels_reorder_usernames_gen.go @@ -217,9 +217,9 @@ func (r *ChannelsReorderUsernamesRequest) GetChannelAsNotEmpty() (NotEmptyInputC // Possible errors: // // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // // See https://core.telegram.org/method/channels.reorderUsernames for reference. -// Can be used by bots. func (c *Client) ChannelsReorderUsernames(ctx context.Context, request *ChannelsReorderUsernamesRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_channels_report_anti_spam_false_positive_gen.go b/tg/tl_channels_report_anti_spam_false_positive_gen.go index 69ad73b24e..e0f593e4eb 100644 --- a/tg/tl_channels_report_anti_spam_false_positive_gen.go +++ b/tg/tl_channels_report_anti_spam_false_positive_gen.go @@ -212,8 +212,11 @@ func (r *ChannelsReportAntiSpamFalsePositiveRequest) GetChannelAsNotEmpty() (Not // Links: // 1. https://core.telegram.org/api/antispam // +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. +// // See https://core.telegram.org/method/channels.reportAntiSpamFalsePositive for reference. -// Can be used by bots. func (c *Client) ChannelsReportAntiSpamFalsePositive(ctx context.Context, request *ChannelsReportAntiSpamFalsePositiveRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_channels_report_sponsored_message_gen.go b/tg/tl_channels_report_sponsored_message_gen.go index 3645d615cb..1c96373861 100644 --- a/tg/tl_channels_report_sponsored_message_gen.go +++ b/tg/tl_channels_report_sponsored_message_gen.go @@ -32,14 +32,23 @@ var ( ) // ChannelsReportSponsoredMessageRequest represents TL type `channels.reportSponsoredMessage#af8ff6b9`. +// Report a sponsored message »¹, see here »² for more info on the full flow. +// +// Links: +// 1. https://core.telegram.org/api/sponsored-messages +// 2. https://core.telegram.org/api/sponsored-messages#reporting-sponsored-messages // // See https://core.telegram.org/method/channels.reportSponsoredMessage for reference. type ChannelsReportSponsoredMessageRequest struct { - // Channel field of ChannelsReportSponsoredMessageRequest. + // The channel where the sponsored message can be seen. Channel InputChannelClass - // RandomID field of ChannelsReportSponsoredMessageRequest. + // ID of the sponsored message. RandomID []byte - // Option field of ChannelsReportSponsoredMessageRequest. + // Chosen report option, initially an empty string, see here »¹ for more info on the + // full flow. + // + // Links: + // 1) https://core.telegram.org/api/sponsored-messages#reporting-sponsored-messages Option []byte } @@ -225,6 +234,17 @@ func (r *ChannelsReportSponsoredMessageRequest) GetChannelAsNotEmpty() (NotEmpty } // ChannelsReportSponsoredMessage invokes method channels.reportSponsoredMessage#af8ff6b9 returning error if any. +// Report a sponsored message »¹, see here »² for more info on the full flow. +// +// Links: +// 1. https://core.telegram.org/api/sponsored-messages +// 2. https://core.telegram.org/api/sponsored-messages#reporting-sponsored-messages +// +// Possible errors: +// +// 400 AD_EXPIRED: The ad has expired (too old or not found). +// 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // // See https://core.telegram.org/method/channels.reportSponsoredMessage for reference. func (c *Client) ChannelsReportSponsoredMessage(ctx context.Context, request *ChannelsReportSponsoredMessageRequest) (ChannelsSponsoredMessageReportResultClass, error) { diff --git a/tg/tl_channels_restrict_sponsored_messages_gen.go b/tg/tl_channels_restrict_sponsored_messages_gen.go index 9a4aa75c36..de9aac5b37 100644 --- a/tg/tl_channels_restrict_sponsored_messages_gen.go +++ b/tg/tl_channels_restrict_sponsored_messages_gen.go @@ -32,12 +32,19 @@ var ( ) // ChannelsRestrictSponsoredMessagesRequest represents TL type `channels.restrictSponsoredMessages#9ae91519`. +// Disable ads on the specified channel, for all users. +// Available only after reaching at least the boost level »¹ specified in the +// channel_restrict_sponsored_level_min »² config parameter. +// +// Links: +// 1. https://core.telegram.org/api/boost +// 2. https://core.telegram.org/api/config#channel-restrict-sponsored-level-min // // See https://core.telegram.org/method/channels.restrictSponsoredMessages for reference. type ChannelsRestrictSponsoredMessagesRequest struct { - // Channel field of ChannelsRestrictSponsoredMessagesRequest. + // The channel. Channel InputChannelClass - // Restricted field of ChannelsRestrictSponsoredMessagesRequest. + // Whether to disable or re-enable ads. Restricted bool } @@ -198,6 +205,17 @@ func (r *ChannelsRestrictSponsoredMessagesRequest) GetChannelAsNotEmpty() (NotEm } // ChannelsRestrictSponsoredMessages invokes method channels.restrictSponsoredMessages#9ae91519 returning error if any. +// Disable ads on the specified channel, for all users. +// Available only after reaching at least the boost level »¹ specified in the +// channel_restrict_sponsored_level_min »² config parameter. +// +// Links: +// 1. https://core.telegram.org/api/boost +// 2. https://core.telegram.org/api/config#channel-restrict-sponsored-level-min +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. // // See https://core.telegram.org/method/channels.restrictSponsoredMessages for reference. func (c *Client) ChannelsRestrictSponsoredMessages(ctx context.Context, request *ChannelsRestrictSponsoredMessagesRequest) (UpdatesClass, error) { diff --git a/tg/tl_channels_search_posts_gen.go b/tg/tl_channels_search_posts_gen.go index 48b77700a9..ad31130c66 100644 --- a/tg/tl_channels_search_posts_gen.go +++ b/tg/tl_channels_search_posts_gen.go @@ -32,18 +32,35 @@ var ( ) // ChannelsSearchPostsRequest represents TL type `channels.searchPosts#d19f987b`. +// Globally search for posts from public channels »¹ (including those we aren't a +// member of) containing a specific hashtag. +// +// Links: +// 1. https://core.telegram.org/api/channel // // See https://core.telegram.org/method/channels.searchPosts for reference. type ChannelsSearchPostsRequest struct { - // Hashtag field of ChannelsSearchPostsRequest. + // The hashtag to search, without the # character. Hashtag string - // OffsetRate field of ChannelsSearchPostsRequest. + // Initially 0, then set to the next_rate parameter of messages.messagesSlice¹ + // + // Links: + // 1) https://core.telegram.org/constructor/messages.messagesSlice OffsetRate int - // OffsetPeer field of ChannelsSearchPostsRequest. + // Offsets for pagination, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets OffsetPeer InputPeerClass - // OffsetID field of ChannelsSearchPostsRequest. + // Offsets for pagination, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets OffsetID int - // Limit field of ChannelsSearchPostsRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -274,6 +291,11 @@ func (s *ChannelsSearchPostsRequest) GetLimit() (value int) { } // ChannelsSearchPosts invokes method channels.searchPosts#d19f987b returning error if any. +// Globally search for posts from public channels »¹ (including those we aren't a +// member of) containing a specific hashtag. +// +// Links: +// 1. https://core.telegram.org/api/channel // // See https://core.telegram.org/method/channels.searchPosts for reference. func (c *Client) ChannelsSearchPosts(ctx context.Context, request *ChannelsSearchPostsRequest) (MessagesMessagesClass, error) { diff --git a/tg/tl_channels_set_boosts_to_unblock_restrictions_gen.go b/tg/tl_channels_set_boosts_to_unblock_restrictions_gen.go index fe7aa1ed01..cfc28b7b5b 100644 --- a/tg/tl_channels_set_boosts_to_unblock_restrictions_gen.go +++ b/tg/tl_channels_set_boosts_to_unblock_restrictions_gen.go @@ -32,12 +32,22 @@ var ( ) // ChannelsSetBoostsToUnblockRestrictionsRequest represents TL type `channels.setBoostsToUnblockRestrictions#ad399cee`. +// Admins with ban_users admin rights »¹ may allow users that apply a certain number of +// booosts »² to the group to bypass slow mode »³ and other »⁴ supergroup +// restrictions, see here »⁵ for more info. +// +// Links: +// 1. https://core.telegram.org/constructor/chatAdminRights +// 2. https://core.telegram.org/api/boost +// 3. https://core.telegram.org/method/channels.toggleSlowMode +// 4. https://core.telegram.org/api/rights#default-rights +// 5. https://core.telegram.org/api/boost#bypass-slowmode-and-chat-restrictions // // See https://core.telegram.org/method/channels.setBoostsToUnblockRestrictions for reference. type ChannelsSetBoostsToUnblockRestrictionsRequest struct { - // Channel field of ChannelsSetBoostsToUnblockRestrictionsRequest. + // The supergroup. Channel InputChannelClass - // Boosts field of ChannelsSetBoostsToUnblockRestrictionsRequest. + // The number of required boosts (1-8, 0 to disable). Boosts int } @@ -198,6 +208,20 @@ func (s *ChannelsSetBoostsToUnblockRestrictionsRequest) GetChannelAsNotEmpty() ( } // ChannelsSetBoostsToUnblockRestrictions invokes method channels.setBoostsToUnblockRestrictions#ad399cee returning error if any. +// Admins with ban_users admin rights »¹ may allow users that apply a certain number of +// booosts »² to the group to bypass slow mode »³ and other »⁴ supergroup +// restrictions, see here »⁵ for more info. +// +// Links: +// 1. https://core.telegram.org/constructor/chatAdminRights +// 2. https://core.telegram.org/api/boost +// 3. https://core.telegram.org/method/channels.toggleSlowMode +// 4. https://core.telegram.org/api/rights#default-rights +// 5. https://core.telegram.org/api/boost#bypass-slowmode-and-chat-restrictions +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. // // See https://core.telegram.org/method/channels.setBoostsToUnblockRestrictions for reference. func (c *Client) ChannelsSetBoostsToUnblockRestrictions(ctx context.Context, request *ChannelsSetBoostsToUnblockRestrictionsRequest) (UpdatesClass, error) { diff --git a/tg/tl_channels_set_emoji_stickers_gen.go b/tg/tl_channels_set_emoji_stickers_gen.go index f2364ef82c..ac6f019b8f 100644 --- a/tg/tl_channels_set_emoji_stickers_gen.go +++ b/tg/tl_channels_set_emoji_stickers_gen.go @@ -32,12 +32,20 @@ var ( ) // ChannelsSetEmojiStickersRequest represents TL type `channels.setEmojiStickers#3cd930b7`. +// Set a custom emoji stickerset¹ for supergroups. Only usable after reaching at least +// the boost level »² specified in the group_emoji_stickers_level_min »³ config +// parameter. +// +// Links: +// 1. https://core.telegram.org/api/custom-emoji +// 2. https://core.telegram.org/api/boost +// 3. https://core.telegram.org/api/config#group-emoji-stickers-level-min // // See https://core.telegram.org/method/channels.setEmojiStickers for reference. type ChannelsSetEmojiStickersRequest struct { - // Channel field of ChannelsSetEmojiStickersRequest. + // The supergroup Channel InputChannelClass - // Stickerset field of ChannelsSetEmojiStickersRequest. + // The custom emoji stickerset to associate to the supergroup Stickerset InputStickerSetClass } @@ -203,6 +211,18 @@ func (s *ChannelsSetEmojiStickersRequest) GetChannelAsNotEmpty() (NotEmptyInputC } // ChannelsSetEmojiStickers invokes method channels.setEmojiStickers#3cd930b7 returning error if any. +// Set a custom emoji stickerset¹ for supergroups. Only usable after reaching at least +// the boost level »² specified in the group_emoji_stickers_level_min »³ config +// parameter. +// +// Links: +// 1. https://core.telegram.org/api/custom-emoji +// 2. https://core.telegram.org/api/boost +// 3. https://core.telegram.org/api/config#group-emoji-stickers-level-min +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. // // See https://core.telegram.org/method/channels.setEmojiStickers for reference. func (c *Client) ChannelsSetEmojiStickers(ctx context.Context, request *ChannelsSetEmojiStickersRequest) (bool, error) { diff --git a/tg/tl_channels_sponsored_message_report_result_gen.go b/tg/tl_channels_sponsored_message_report_result_gen.go index e0f3d56db6..74ffa14249 100644 --- a/tg/tl_channels_sponsored_message_report_result_gen.go +++ b/tg/tl_channels_sponsored_message_report_result_gen.go @@ -32,12 +32,18 @@ var ( ) // ChannelsSponsoredMessageReportResultChooseOption represents TL type `channels.sponsoredMessageReportResultChooseOption#846f9e42`. +// The user must choose a report option from the localized options available in options, +// and after selection, channels.reportSponsoredMessage¹ must be invoked again, passing +// the option's option field to the option param of the method. +// +// Links: +// 1. https://core.telegram.org/method/channels.reportSponsoredMessage // // See https://core.telegram.org/constructor/channels.sponsoredMessageReportResultChooseOption for reference. type ChannelsSponsoredMessageReportResultChooseOption struct { - // Title field of ChannelsSponsoredMessageReportResultChooseOption. + // Title of the option selection popup. Title string - // Options field of ChannelsSponsoredMessageReportResultChooseOption. + // Localized list of options. Options []SponsoredMessageReportOption } @@ -210,6 +216,7 @@ func (s *ChannelsSponsoredMessageReportResultChooseOption) GetOptions() (value [ } // ChannelsSponsoredMessageReportResultAdsHidden represents TL type `channels.sponsoredMessageReportResultAdsHidden#3e3bcf2f`. +// Sponsored messages were hidden for the user in all chats. // // See https://core.telegram.org/constructor/channels.sponsoredMessageReportResultAdsHidden for reference. type ChannelsSponsoredMessageReportResultAdsHidden struct { @@ -313,6 +320,7 @@ func (s *ChannelsSponsoredMessageReportResultAdsHidden) DecodeBare(b *bin.Buffer } // ChannelsSponsoredMessageReportResultReported represents TL type `channels.sponsoredMessageReportResultReported#ad798849`. +// The sponsored message was reported successfully. // // See https://core.telegram.org/constructor/channels.sponsoredMessageReportResultReported for reference. type ChannelsSponsoredMessageReportResultReported struct { diff --git a/tg/tl_channels_toggle_anti_spam_gen.go b/tg/tl_channels_toggle_anti_spam_gen.go index e7cadde8af..c6434d0838 100644 --- a/tg/tl_channels_toggle_anti_spam_gen.go +++ b/tg/tl_channels_toggle_anti_spam_gen.go @@ -214,10 +214,10 @@ func (t *ChannelsToggleAntiSpamRequest) GetChannelAsNotEmpty() (NotEmptyInputCha // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // // See https://core.telegram.org/method/channels.toggleAntiSpam for reference. -// Can be used by bots. func (c *Client) ChannelsToggleAntiSpam(ctx context.Context, request *ChannelsToggleAntiSpamRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_channels_toggle_forum_gen.go b/tg/tl_channels_toggle_forum_gen.go index 496319a5ed..612bc14cb4 100644 --- a/tg/tl_channels_toggle_forum_gen.go +++ b/tg/tl_channels_toggle_forum_gen.go @@ -209,11 +209,11 @@ func (t *ChannelsToggleForumRequest) GetChannelAsNotEmpty() (NotEmptyInputChanne // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHAT_DISCUSSION_UNALLOWED: You can't enable forum topics in a discussion group linked to a channel. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // // See https://core.telegram.org/method/channels.toggleForum for reference. -// Can be used by bots. func (c *Client) ChannelsToggleForum(ctx context.Context, request *ChannelsToggleForumRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_channels_toggle_participants_hidden_gen.go b/tg/tl_channels_toggle_participants_hidden_gen.go index f85d1a986a..9175bf61e2 100644 --- a/tg/tl_channels_toggle_participants_hidden_gen.go +++ b/tg/tl_channels_toggle_participants_hidden_gen.go @@ -215,12 +215,12 @@ func (t *ChannelsToggleParticipantsHiddenRequest) GetChannelAsNotEmpty() (NotEmp // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 400 PARTICIPANTS_TOO_FEW: Not enough participants. // // See https://core.telegram.org/method/channels.toggleParticipantsHidden for reference. -// Can be used by bots. func (c *Client) ChannelsToggleParticipantsHidden(ctx context.Context, request *ChannelsToggleParticipantsHiddenRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_channels_toggle_username_gen.go b/tg/tl_channels_toggle_username_gen.go index 11fe8115f1..b43bb39dc4 100644 --- a/tg/tl_channels_toggle_username_gen.go +++ b/tg/tl_channels_toggle_username_gen.go @@ -243,13 +243,15 @@ func (t *ChannelsToggleUsernameRequest) GetChannelAsNotEmpty() (NotEmptyInputCha // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 400 USERNAMES_ACTIVE_TOO_MUCH: The maximum number of active usernames was reached. // 400 USERNAME_INVALID: The provided username is not valid. +// 400 USERNAME_NOT_MODIFIED: The username was not modified. // // See https://core.telegram.org/method/channels.toggleUsername for reference. -// Can be used by bots. func (c *Client) ChannelsToggleUsername(ctx context.Context, request *ChannelsToggleUsernameRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_channels_update_color_gen.go b/tg/tl_channels_update_color_gen.go index e1c15ebdcd..0941943709 100644 --- a/tg/tl_channels_update_color_gen.go +++ b/tg/tl_channels_update_color_gen.go @@ -45,7 +45,12 @@ type ChannelsUpdateColorRequest struct { // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Whether to change the accent color emoji pattern of the profile page; otherwise, the - // accent color and emoji pattern of messages will be changed. + // accent color and emoji pattern of messages will be changed. Channels can change both + // message and profile palettes; supergroups can only change the profile palette, of + // course after reaching the appropriate boost level¹. + // + // Links: + // 1) https://core.telegram.org/api/colors ForProfile bool // Channel whose accent color should be changed. Channel InputChannelClass diff --git a/tg/tl_channels_update_emoji_status_gen.go b/tg/tl_channels_update_emoji_status_gen.go index 68e6d7cedc..ea08c46da7 100644 --- a/tg/tl_channels_update_emoji_status_gen.go +++ b/tg/tl_channels_update_emoji_status_gen.go @@ -32,17 +32,19 @@ var ( ) // ChannelsUpdateEmojiStatusRequest represents TL type `channels.updateEmojiStatus#f0d3e6a8`. -// Set an emoji status¹ for a channel. +// Set an emoji status¹ for a channel or supergroup. // // Links: // 1. https://core.telegram.org/api/emoji-status // // See https://core.telegram.org/method/channels.updateEmojiStatus for reference. type ChannelsUpdateEmojiStatusRequest struct { - // The channel, must have at least channel_emoji_status_level_min boosts¹. + // The channel/supergroup, must have at least + // channel_emoji_status_level_min¹/group_emoji_status_level_min² boosts. // // Links: // 1) https://core.telegram.org/api/config#channel-emoji-status-level-min + // 2) https://core.telegram.org/api/config#group-emoji-status-level-min Channel InputChannelClass // Emoji status¹ to set // @@ -218,7 +220,7 @@ func (u *ChannelsUpdateEmojiStatusRequest) GetEmojiStatusAsNotEmpty() (NotEmptyE } // ChannelsUpdateEmojiStatus invokes method channels.updateEmojiStatus#f0d3e6a8 returning error if any. -// Set an emoji status¹ for a channel. +// Set an emoji status¹ for a channel or supergroup. // // Links: // 1. https://core.telegram.org/api/emoji-status diff --git a/tg/tl_channels_update_pinned_forum_topic_gen.go b/tg/tl_channels_update_pinned_forum_topic_gen.go index d34294b685..910b058829 100644 --- a/tg/tl_channels_update_pinned_forum_topic_gen.go +++ b/tg/tl_channels_update_pinned_forum_topic_gen.go @@ -239,10 +239,10 @@ func (u *ChannelsUpdatePinnedForumTopicRequest) GetChannelAsNotEmpty() (NotEmpty // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 TOPIC_ID_INVALID: The specified topic ID is invalid. // // See https://core.telegram.org/method/channels.updatePinnedForumTopic for reference. -// Can be used by bots. func (c *Client) ChannelsUpdatePinnedForumTopic(ctx context.Context, request *ChannelsUpdatePinnedForumTopicRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_chat_full_gen.go b/tg/tl_chat_full_gen.go index 3a55c70146..310cd37790 100644 --- a/tg/tl_chat_full_gen.go +++ b/tg/tl_chat_full_gen.go @@ -33,9 +33,13 @@ var ( // ChatFull represents TL type `chatFull#2633421b`. // Full info about a basic group¹. +// When updating the local peer database »¹, all fields from the newly received +// constructor take priority over the old constructor cached locally (including by +// removing fields that aren't set in the new constructor). // // Links: // 1. https://core.telegram.org/api/channel#basic-groups +// 2. https://core.telegram.org/api/peers // // See https://core.telegram.org/constructor/chatFull for reference. type ChatFull struct { @@ -128,7 +132,11 @@ type ChatFull struct { // // Use SetAvailableReactions and GetAvailableReactions helpers. AvailableReactions ChatReactionsClass - // ReactionsLimit field of ChatFull. + // This flag may be used to impose a custom limit of unique reactions (i.e. a + // customizable version of appConfig.reactions_uniq_max¹). + // + // Links: + // 1) https://core.telegram.org/api/config#reactions-uniq-max // // Use SetReactionsLimit and GetReactionsLimit helpers. ReactionsLimit int @@ -1077,11 +1085,15 @@ func (c *ChatFull) GetReactionsLimit() (value int, ok bool) { // ChannelFull represents TL type `channelFull#bbab348d`. // Full info about a channel¹, supergroup² or gigagroup³. +// When updating the local peer database »¹, all fields from the newly received +// constructor take priority over the old constructor cached locally (including by +// removing fields that aren't set in the new constructor). // // Links: // 1. https://core.telegram.org/api/channel#channels // 2. https://core.telegram.org/api/channel#supergroups // 3. https://core.telegram.org/api/channel#gigagroups +// 4. https://core.telegram.org/api/peers // // See https://core.telegram.org/constructor/channelFull for reference. type ChannelFull struct { @@ -1150,13 +1162,26 @@ type ChannelFull struct { // 1) https://core.telegram.org/api/forum // 2) https://core.telegram.org/method/channels.toggleViewForumAsMessages ViewForumAsMessages bool - // RestrictedSponsored field of ChannelFull. + // Whether ads on this channel were disabled as specified here »¹ (this flag is only + // visible to the owner of the channel). + // + // Links: + // 1) https://core.telegram.org/api/boost#disable-ads-on-the-channel RestrictedSponsored bool - // CanViewRevenue field of ChannelFull. + // If set, this user can view ad revenue statistics »¹ for this channel. + // + // Links: + // 1) https://core.telegram.org/api/revenue#revenue-statistics CanViewRevenue bool - // PaidMediaAllowed field of ChannelFull. + // Whether the current user can send or forward paid media »¹ to this channel. + // + // Links: + // 1) https://core.telegram.org/api/paid-media PaidMediaAllowed bool - // CanViewStarsRevenue field of ChannelFull. + // If set, this user can view Telegram Star revenue statistics »¹ for this channel. + // + // Links: + // 1) https://core.telegram.org/api/stars#revenue-statistics CanViewStarsRevenue bool // PaidReactionsAvailable field of ChannelFull. PaidReactionsAvailable bool @@ -1242,7 +1267,8 @@ type ChannelFull struct { // // Use SetFolderID and GetFolderID helpers. FolderID int - // ID of the linked discussion chat¹ for channels + // ID of the linked discussion chat¹ for channels (and vice versa, the ID of the linked + // channel for discussion chats). // // Links: // 1) https://core.telegram.org/api/discussion @@ -1322,7 +1348,11 @@ type ChannelFull struct { // // Use SetAvailableReactions and GetAvailableReactions helpers. AvailableReactions ChatReactionsClass - // ReactionsLimit field of ChannelFull. + // This flag may be used to impose a custom limit of unique reactions (i.e. a + // customizable version of appConfig.reactions_uniq_max¹). + // + // Links: + // 1) https://core.telegram.org/api/config#reactions-uniq-max // // Use SetReactionsLimit and GetReactionsLimit helpers. ReactionsLimit int @@ -1340,15 +1370,30 @@ type ChannelFull struct { // // Use SetWallpaper and GetWallpaper helpers. Wallpaper WallPaperClass - // BoostsApplied field of ChannelFull. + // The number of boosts¹ the current user has applied to the current supergroup. + // + // Links: + // 1) https://core.telegram.org/api/boost // // Use SetBoostsApplied and GetBoostsApplied helpers. BoostsApplied int - // BoostsUnrestrict field of ChannelFull. + // The number of boosts¹ this supergroup requires to bypass slowmode and other + // restrictions, see here »² for more info. + // + // Links: + // 1) https://core.telegram.org/api/boost + // 2) https://core.telegram.org/api/boost#bypass-slowmode-and-chat-restrictions // // Use SetBoostsUnrestrict and GetBoostsUnrestrict helpers. BoostsUnrestrict int - // Emojiset field of ChannelFull. + // Custom emoji stickerset¹ associated to the current supergroup, set using channels + // setEmojiStickers² after reaching the appropriate boost level, see here »³ for more + // info. + // + // Links: + // 1) https://core.telegram.org/api/custom-emoji + // 2) https://core.telegram.org/method/channels.setEmojiStickers + // 3) https://core.telegram.org/api/boost#setting-a-custom-emoji-stickerset-for-supergroups // // Use SetEmojiset and GetEmojiset helpers. Emojiset StickerSet @@ -3923,7 +3968,11 @@ type ChatFullClass interface { // 1) https://core.telegram.org/api/reactions GetAvailableReactions() (value ChatReactionsClass, ok bool) - // ReactionsLimit field of ChatFull. + // This flag may be used to impose a custom limit of unique reactions (i.e. a + // customizable version of appConfig.reactions_uniq_max¹). + // + // Links: + // 1) https://core.telegram.org/api/config#reactions-uniq-max GetReactionsLimit() (value int, ok bool) } diff --git a/tg/tl_chat_gen.go b/tg/tl_chat_gen.go index ca17884b02..ec936d5678 100644 --- a/tg/tl_chat_gen.go +++ b/tg/tl_chat_gen.go @@ -167,7 +167,17 @@ func (c *ChatEmpty) GetID() (value int64) { } // Chat represents TL type `chat#41cbf256`. -// Info about a group +// Info about a group. +// When updating the local peer database¹, all fields from the newly received +// constructor take priority over the old constructor cached locally (including by +// removing fields that aren't set in the new constructor). +// See here »¹ for an implementation of the logic to use when updating the local user +// peer database². +// +// Links: +// 1. https://core.telegram.org/api/peers +// 2. https://github.com/tdlib/td/blob/a24af0992245f838f2b4b418a0a2d5fa9caa27b5/td/telegram/ChatManager.cpp#L5152 +// 3. https://core.telegram.org/api/peers // // See https://core.telegram.org/constructor/chat for reference. type Chat struct { @@ -194,7 +204,10 @@ type Chat struct { // Links: // 1) https://telegram.org/blog/protected-content-delete-by-date-and-more Noforwards bool - // ID of the group + // ID of the group, see here »¹ for more info + // + // Links: + // 1) https://core.telegram.org/api/peers#peer-id ID int64 // Title Title string @@ -1001,6 +1014,18 @@ func (c *ChatForbidden) GetTitle() (value string) { // Channel represents TL type `channel#fe4478bd`. // Channel/supergroup info +// When updating the local peer database¹, all fields from the newly received +// constructor take priority over the old constructor cached locally (including by +// removing fields that aren't set in the new constructor). +// The only exception to the above rule is when the min flag is set, in which case only +// the following fields must be applied over any locally stored version: +// See here »¹ for an implementation of the logic to use when updating the local user +// peer database². +// +// Links: +// 1. https://core.telegram.org/api/peers +// 2. https://github.com/tdlib/td/blob/a24af0992245f838f2b4b418a0a2d5fa9caa27b5/td/telegram/ChatManager.cpp#L8329 +// 3. https://core.telegram.org/api/peers // // See https://core.telegram.org/constructor/channel for reference. type Channel struct { @@ -1017,9 +1042,14 @@ type Channel struct { Broadcast bool // Is this channel verified by telegram? Verified bool - // Is this a supergroup? + // Is this a supergroup? Changes to this flag should invalidate the local channelFull¹ + // cache for this channel/supergroup ID, see here »² for more info. + // + // Links: + // 1) https://core.telegram.org/constructor/channelFull + // 2) https://core.telegram.org/api/peers#full-info-database Megagroup bool - // Whether viewing/writing in this channel for a reason (see restriction_reason + // Whether viewing/writing in this channel for a reason (see restriction_reason) Restricted bool // Whether signatures are enabled (channels) Signatures bool @@ -1028,28 +1058,54 @@ type Channel struct { // Links: // 1) https://core.telegram.org/api/min Min bool - // This channel/supergroup is probably a scam + // This channel/supergroup is probably a scam Changes to this flag should invalidate the + // local channelFull¹ cache for this channel/supergroup ID, see here »² for more info. + // + // Links: + // 1) https://core.telegram.org/constructor/channelFull + // 2) https://core.telegram.org/api/peers#full-info-database Scam bool - // Whether this channel has a private join link + // Whether this channel has a linked discussion group »¹ (or this supergroup is a + // channel's discussion group). The actual ID of the linked channel/supergroup is + // contained in channelFull².linked_chat_id. Changes to this flag should invalidate the + // local channelFull³ cache for this channel/supergroup ID, see here »⁴ for more info. + // + // Links: + // 1) https://core.telegram.org/api/discussion + // 2) https://core.telegram.org/constructor/channelFull + // 3) https://core.telegram.org/constructor/channelFull + // 4) https://core.telegram.org/api/peers#full-info-database HasLink bool // Whether this chanel has a geoposition HasGeo bool - // Whether slow mode is enabled for groups to prevent flood in chat + // Whether slow mode is enabled for groups to prevent flood in chat. Changes to this flag + // should invalidate the local channelFull¹ cache for this channel/supergroup ID, see + // here »² for more info. + // + // Links: + // 1) https://core.telegram.org/constructor/channelFull + // 2) https://core.telegram.org/api/peers#full-info-database SlowmodeEnabled bool // Whether a group call or livestream is currently active CallActive bool // Whether there's anyone in the group call or livestream CallNotEmpty bool // If set, this supergroup/channel¹ was reported by many users as a fake or scam: be - // careful when interacting with it. + // careful when interacting with it. Changes to this flag should invalidate the local + // channelFull² cache for this channel/supergroup ID, see here »³ for more info. // // Links: // 1) https://core.telegram.org/api/channel + // 2) https://core.telegram.org/constructor/channelFull + // 3) https://core.telegram.org/api/peers#full-info-database Fake bool - // Whether this supergroup¹ is a gigagroup + // Whether this supergroup¹ is a gigagroupChanges to this flag should invalidate the + // local channelFull² cache for this channel/supergroup ID, see here »³ for more info. // // Links: // 1) https://core.telegram.org/api/channel + // 2) https://core.telegram.org/constructor/channelFull + // 3) https://core.telegram.org/api/peers#full-info-database Gigagroup bool // Whether this channel or group is protected¹, thus does not allow forwarding messages // from it @@ -1058,23 +1114,33 @@ type Channel struct { // 1) https://telegram.org/blog/protected-content-delete-by-date-and-more Noforwards bool // Whether a user needs to join the supergroup before they can send messages: can be - // false only for discussion groups »¹, toggle using channels.toggleJoinToSend² + // false only for discussion groups »¹, toggle using channels.toggleJoinToSend²Changes + // to this flag should invalidate the local channelFull³ cache for this + // channel/supergroup ID, see here »⁴ for more info. // // Links: // 1) https://core.telegram.org/api/discussion // 2) https://core.telegram.org/method/channels.toggleJoinToSend + // 3) https://core.telegram.org/constructor/channelFull + // 4) https://core.telegram.org/api/peers#full-info-database JoinToSend bool // Whether a user's join request will have to be approved by administrators¹, toggle - // using channels.toggleJoinToSend² + // using channels.toggleJoinToSend²Changes to this flag should invalidate the local + // channelFull³ cache for this channel/supergroup ID, see here »⁴ for more info. // // Links: // 1) https://core.telegram.org/api/invites#join-requests // 2) https://core.telegram.org/method/channels.toggleJoinRequest + // 3) https://core.telegram.org/constructor/channelFull + // 4) https://core.telegram.org/api/peers#full-info-database JoinRequest bool - // Whether this supergroup is a forum¹ + // Whether this supergroup is a forum¹. Changes to this flag should invalidate the local + // channelFull² cache for this channel/supergroup ID, see here »³ for more info. // // Links: // 1) https://core.telegram.org/api/forum + // 2) https://core.telegram.org/constructor/channelFull + // 3) https://core.telegram.org/api/peers#full-info-database Forum bool // Flags, see TL conditional fields¹ // @@ -1097,15 +1163,21 @@ type Channel struct { StoriesUnavailable bool // SignatureProfiles field of Channel. SignatureProfiles bool - // ID of the channel + // ID of the channel, see here »¹ for more info + // + // Links: + // 1) https://core.telegram.org/api/peers#peer-id ID int64 - // Access hash + // Access hash, see here »¹ for more info + // + // Links: + // 1) https://core.telegram.org/api/peers#access-hash // // Use SetAccessHash and GetAccessHash helpers. AccessHash int64 // Title Title string - // Username + // Main active username. // // Use SetUsername and GetUsername helpers. Username string @@ -1114,7 +1186,13 @@ type Channel struct { // Date when the user joined the supergroup/channel, or if the user isn't a member, its // creation date Date int - // Contains the reason why access to this channel must be restricted. + // Contains the reason why access to this channel must be restricted. Changes to this + // flag should invalidate the local channelFull¹ cache for this channel/supergroup ID, + // see here »² for more info. + // + // Links: + // 1) https://core.telegram.org/constructor/channelFull + // 2) https://core.telegram.org/api/peers#full-info-database // // Use SetRestrictionReason and GetRestrictionReason helpers. RestrictionReason []RestrictionReason @@ -1175,10 +1253,13 @@ type Channel struct { // // Use SetEmojiStatus and GetEmojiStatus helpers. EmojiStatus EmojiStatusClass - // Boost level¹ + // Boost level¹. Changes to this flag should invalidate the local channelFull² cache + // for this channel/supergroup ID, see here »³ for more info. // // Links: // 1) https://core.telegram.org/api/boost + // 2) https://core.telegram.org/constructor/channelFull + // 3) https://core.telegram.org/api/peers#full-info-database // // Use SetLevel and GetLevel helpers. Level int @@ -3292,7 +3373,10 @@ type NotEmptyChat interface { // Zero returns true if current object has a zero value. Zero() bool - // ID of the group + // ID of the group, see here »¹ for more info + // + // Links: + // 1) https://core.telegram.org/api/peers#peer-id GetID() (value int64) // Title @@ -3419,7 +3503,10 @@ type FullChat interface { // 1) https://telegram.org/blog/protected-content-delete-by-date-and-more GetNoforwards() (value bool) - // ID of the group + // ID of the group, see here »¹ for more info + // + // Links: + // 1) https://core.telegram.org/api/peers#peer-id GetID() (value int64) // Title diff --git a/tg/tl_chatlists_check_chatlist_invite_gen.go b/tg/tl_chatlists_check_chatlist_invite_gen.go index c614784f60..889876b9f8 100644 --- a/tg/tl_chatlists_check_chatlist_invite_gen.go +++ b/tg/tl_chatlists_check_chatlist_invite_gen.go @@ -179,7 +179,6 @@ func (c *ChatlistsCheckChatlistInviteRequest) GetSlug() (value string) { // 400 INVITE_SLUG_EXPIRED: The specified chat folder link has expired. // // See https://core.telegram.org/method/chatlists.checkChatlistInvite for reference. -// Can be used by bots. func (c *Client) ChatlistsCheckChatlistInvite(ctx context.Context, slug string) (ChatlistsChatlistInviteClass, error) { var result ChatlistsChatlistInviteBox diff --git a/tg/tl_chatlists_delete_exported_invite_gen.go b/tg/tl_chatlists_delete_exported_invite_gen.go index 3b135a46f9..a68238b9c4 100644 --- a/tg/tl_chatlists_delete_exported_invite_gen.go +++ b/tg/tl_chatlists_delete_exported_invite_gen.go @@ -206,7 +206,6 @@ func (d *ChatlistsDeleteExportedInviteRequest) GetSlug() (value string) { // 400 FILTER_NOT_SUPPORTED: The specified filter cannot be used in this context. // // See https://core.telegram.org/method/chatlists.deleteExportedInvite for reference. -// Can be used by bots. func (c *Client) ChatlistsDeleteExportedInvite(ctx context.Context, request *ChatlistsDeleteExportedInviteRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_chatlists_edit_exported_invite_gen.go b/tg/tl_chatlists_edit_exported_invite_gen.go index cb8b9fe24c..27e47068c2 100644 --- a/tg/tl_chatlists_edit_exported_invite_gen.go +++ b/tg/tl_chatlists_edit_exported_invite_gen.go @@ -345,11 +345,14 @@ func (e *ChatlistsEditExportedInviteRequest) MapPeers() (value InputPeerClassArr // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 FILTER_ID_INVALID: The specified filter ID is invalid. // 400 FILTER_NOT_SUPPORTED: The specified filter cannot be used in this context. +// 400 INVITE_SLUG_EMPTY: The specified invite slug is empty. +// 400 INVITE_SLUG_EXPIRED: The specified chat folder link has expired. +// 400 PEERS_LIST_EMPTY: The specified list of peers is empty. // // See https://core.telegram.org/method/chatlists.editExportedInvite for reference. -// Can be used by bots. func (c *Client) ChatlistsEditExportedInvite(ctx context.Context, request *ChatlistsEditExportedInviteRequest) (*ExportedChatlistInvite, error) { var result ExportedChatlistInvite diff --git a/tg/tl_chatlists_export_chatlist_invite_gen.go b/tg/tl_chatlists_export_chatlist_invite_gen.go index 021d277a3a..050e3aa194 100644 --- a/tg/tl_chatlists_export_chatlist_invite_gen.go +++ b/tg/tl_chatlists_export_chatlist_invite_gen.go @@ -257,7 +257,7 @@ func (e *ChatlistsExportChatlistInviteRequest) MapPeers() (value InputPeerClassA // // 400 FILTER_ID_INVALID: The specified filter ID is invalid. // 400 FILTER_NOT_SUPPORTED: The specified filter cannot be used in this context. -// 400 INVITES_TOO_MUCH: The maximum number of per-folder invites specified by the chatlist_invites_limit_default/chatlist_invites_limit_premium client configuration parameters » was reached. +// 400 INVITES_TOO_MUCH: The maximum number of per-folder invites specified by the chatlist_invites_limit_default/chatlist_invites_limit_premium client configuration parameters » was reached. // 400 PEERS_LIST_EMPTY: The specified list of peers is empty. // // See https://core.telegram.org/method/chatlists.exportChatlistInvite for reference. diff --git a/tg/tl_chatlists_get_chatlist_updates_gen.go b/tg/tl_chatlists_get_chatlist_updates_gen.go index f07491a252..beb89c4bbc 100644 --- a/tg/tl_chatlists_get_chatlist_updates_gen.go +++ b/tg/tl_chatlists_get_chatlist_updates_gen.go @@ -183,7 +183,6 @@ func (g *ChatlistsGetChatlistUpdatesRequest) GetChatlist() (value InputChatlistD // 400 INPUT_CHATLIST_INVALID: The specified folder is invalid. // // See https://core.telegram.org/method/chatlists.getChatlistUpdates for reference. -// Can be used by bots. func (c *Client) ChatlistsGetChatlistUpdates(ctx context.Context, chatlist InputChatlistDialogFilter) (*ChatlistsChatlistUpdates, error) { var result ChatlistsChatlistUpdates diff --git a/tg/tl_chatlists_get_exported_invites_gen.go b/tg/tl_chatlists_get_exported_invites_gen.go index 919185f155..e72a60e157 100644 --- a/tg/tl_chatlists_get_exported_invites_gen.go +++ b/tg/tl_chatlists_get_exported_invites_gen.go @@ -170,8 +170,11 @@ func (g *ChatlistsGetExportedInvitesRequest) GetChatlist() (value InputChatlistD // Links: // 1. https://core.telegram.org/api/links#chat-folder-links // +// Possible errors: +// +// 400 FILTER_ID_INVALID: The specified filter ID is invalid. +// // See https://core.telegram.org/method/chatlists.getExportedInvites for reference. -// Can be used by bots. func (c *Client) ChatlistsGetExportedInvites(ctx context.Context, chatlist InputChatlistDialogFilter) (*ChatlistsExportedInvites, error) { var result ChatlistsExportedInvites diff --git a/tg/tl_chatlists_get_leave_chatlist_suggestions_gen.go b/tg/tl_chatlists_get_leave_chatlist_suggestions_gen.go index 3fe0159324..55524bccba 100644 --- a/tg/tl_chatlists_get_leave_chatlist_suggestions_gen.go +++ b/tg/tl_chatlists_get_leave_chatlist_suggestions_gen.go @@ -180,7 +180,6 @@ func (g *ChatlistsGetLeaveChatlistSuggestionsRequest) GetChatlist() (value Input // 400 FILTER_NOT_SUPPORTED: The specified filter cannot be used in this context. // // See https://core.telegram.org/method/chatlists.getLeaveChatlistSuggestions for reference. -// Can be used by bots. func (c *Client) ChatlistsGetLeaveChatlistSuggestions(ctx context.Context, chatlist InputChatlistDialogFilter) ([]PeerClass, error) { var result PeerClassVector diff --git a/tg/tl_chatlists_hide_chatlist_updates_gen.go b/tg/tl_chatlists_hide_chatlist_updates_gen.go index 96caa47dc8..cdef5a911b 100644 --- a/tg/tl_chatlists_hide_chatlist_updates_gen.go +++ b/tg/tl_chatlists_hide_chatlist_updates_gen.go @@ -176,7 +176,6 @@ func (h *ChatlistsHideChatlistUpdatesRequest) GetChatlist() (value InputChatlist // 400 FILTER_NOT_SUPPORTED: The specified filter cannot be used in this context. // // See https://core.telegram.org/method/chatlists.hideChatlistUpdates for reference. -// Can be used by bots. func (c *Client) ChatlistsHideChatlistUpdates(ctx context.Context, chatlist InputChatlistDialogFilter) (bool, error) { var result BoolBox diff --git a/tg/tl_chatlists_join_chatlist_invite_gen.go b/tg/tl_chatlists_join_chatlist_invite_gen.go index 2e44aa2d7d..53bd39116b 100644 --- a/tg/tl_chatlists_join_chatlist_invite_gen.go +++ b/tg/tl_chatlists_join_chatlist_invite_gen.go @@ -235,7 +235,6 @@ func (j *ChatlistsJoinChatlistInviteRequest) MapPeers() (value InputPeerClassArr // 400 INVITE_SLUG_EXPIRED: The specified chat folder link has expired. // // See https://core.telegram.org/method/chatlists.joinChatlistInvite for reference. -// Can be used by bots. func (c *Client) ChatlistsJoinChatlistInvite(ctx context.Context, request *ChatlistsJoinChatlistInviteRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_chatlists_join_chatlist_updates_gen.go b/tg/tl_chatlists_join_chatlist_updates_gen.go index 2d94dcc540..9725968c13 100644 --- a/tg/tl_chatlists_join_chatlist_updates_gen.go +++ b/tg/tl_chatlists_join_chatlist_updates_gen.go @@ -231,7 +231,6 @@ func (j *ChatlistsJoinChatlistUpdatesRequest) MapPeers() (value InputPeerClassAr // 400 FILTER_INCLUDE_EMPTY: The include_peers vector of the filter is empty. // // See https://core.telegram.org/method/chatlists.joinChatlistUpdates for reference. -// Can be used by bots. func (c *Client) ChatlistsJoinChatlistUpdates(ctx context.Context, request *ChatlistsJoinChatlistUpdatesRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_chatlists_leave_chatlist_gen.go b/tg/tl_chatlists_leave_chatlist_gen.go index 0c214b6051..4ffa2e41e8 100644 --- a/tg/tl_chatlists_leave_chatlist_gen.go +++ b/tg/tl_chatlists_leave_chatlist_gen.go @@ -220,8 +220,11 @@ func (l *ChatlistsLeaveChatlistRequest) MapPeers() (value InputPeerClassArray) { // Links: // 1. https://core.telegram.org/api/links#chat-folder-links // +// Possible errors: +// +// 400 FILTER_ID_INVALID: The specified filter ID is invalid. +// // See https://core.telegram.org/method/chatlists.leaveChatlist for reference. -// Can be used by bots. func (c *Client) ChatlistsLeaveChatlist(ctx context.Context, request *ChatlistsLeaveChatlistRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_code_settings_gen.go b/tg/tl_code_settings_gen.go index eccf4eb78c..e3f9c52be0 100644 --- a/tg/tl_code_settings_gen.go +++ b/tg/tl_code_settings_gen.go @@ -68,7 +68,8 @@ type CodeSettings struct { AllowMissedCall bool // Whether Firebase auth is supported AllowFirebase bool - // UnknownNumber field of CodeSettings. + // Set this flag if there is a SIM card in the current device, but it is not possible to + // check whether the specified phone number matches the SIM's phone number. UnknownNumber bool // Previously stored future auth tokens, see the documentation for more info »¹ // diff --git a/tg/tl_connected_bot_gen.go b/tg/tl_connected_bot_gen.go index 9513256133..b502d2fc4a 100644 --- a/tg/tl_connected_bot_gen.go +++ b/tg/tl_connected_bot_gen.go @@ -32,16 +32,27 @@ var ( ) // ConnectedBot represents TL type `connectedBot#bd068601`. +// Contains info about a connected business bot »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots // // See https://core.telegram.org/constructor/connectedBot for reference. type ConnectedBot struct { - // Flags field of ConnectedBot. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // CanReply field of ConnectedBot. + // Whether the the bot can reply to messages it receives through the connection CanReply bool - // BotID field of ConnectedBot. + // ID of the connected bot BotID int64 - // Recipients field of ConnectedBot. + // Specifies the private chats that a connected business bot »¹ may receive messages + // and interact with. + // + // Links: + // 1) https://core.telegram.org/api/business#connected-bots Recipients BusinessBotRecipients } diff --git a/tg/tl_contact_birthday_gen.go b/tg/tl_contact_birthday_gen.go index a9c40807b2..bce3961a28 100644 --- a/tg/tl_contact_birthday_gen.go +++ b/tg/tl_contact_birthday_gen.go @@ -32,12 +32,13 @@ var ( ) // ContactBirthday represents TL type `contactBirthday#1d998733`. +// Birthday information of a contact. // // See https://core.telegram.org/constructor/contactBirthday for reference. type ContactBirthday struct { - // ContactID field of ContactBirthday. + // User ID. ContactID int64 - // Birthday field of ContactBirthday. + // Birthday information. Birthday Birthday } diff --git a/tg/tl_contacts_contact_birthdays_gen.go b/tg/tl_contacts_contact_birthdays_gen.go index 90f5b8522c..88ea8a4d6a 100644 --- a/tg/tl_contacts_contact_birthdays_gen.go +++ b/tg/tl_contacts_contact_birthdays_gen.go @@ -32,12 +32,13 @@ var ( ) // ContactsContactBirthdays represents TL type `contacts.contactBirthdays#114ff30d`. +// Birthday information of our contacts. // // See https://core.telegram.org/constructor/contacts.contactBirthdays for reference. type ContactsContactBirthdays struct { - // Contacts field of ContactsContactBirthdays. + // Birthday info Contacts []ContactBirthday - // Users field of ContactsContactBirthdays. + // User information Users []UserClass } diff --git a/tg/tl_contacts_export_contact_token_gen.go b/tg/tl_contacts_export_contact_token_gen.go index 65729afc25..60b51a2752 100644 --- a/tg/tl_contacts_export_contact_token_gen.go +++ b/tg/tl_contacts_export_contact_token_gen.go @@ -138,7 +138,6 @@ func (e *ContactsExportContactTokenRequest) DecodeBare(b *bin.Buffer) error { // 1. https://core.telegram.org/api/links#temporary-profile-links // // See https://core.telegram.org/method/contacts.exportContactToken for reference. -// Can be used by bots. func (c *Client) ContactsExportContactToken(ctx context.Context) (*ExportedContactToken, error) { var result ExportedContactToken diff --git a/tg/tl_contacts_get_birthdays_gen.go b/tg/tl_contacts_get_birthdays_gen.go index 9eb7b36967..e97c35ca90 100644 --- a/tg/tl_contacts_get_birthdays_gen.go +++ b/tg/tl_contacts_get_birthdays_gen.go @@ -32,6 +32,15 @@ var ( ) // ContactsGetBirthdaysRequest represents TL type `contacts.getBirthdays#daeda864`. +// Fetch all users with birthdays that fall within +1/-1 days, relative to the current +// day: this method should be invoked by clients every 6-8 hours, and if the result is +// non-empty, it should be used to appropriately update locally cached birthday +// information in user¹.birthday. +// See here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/constructor/user +// 2. https://core.telegram.org/api/profile#birthday // // See https://core.telegram.org/method/contacts.getBirthdays for reference. type ContactsGetBirthdaysRequest struct { @@ -128,6 +137,15 @@ func (g *ContactsGetBirthdaysRequest) DecodeBare(b *bin.Buffer) error { } // ContactsGetBirthdays invokes method contacts.getBirthdays#daeda864 returning error if any. +// Fetch all users with birthdays that fall within +1/-1 days, relative to the current +// day: this method should be invoked by clients every 6-8 hours, and if the result is +// non-empty, it should be used to appropriately update locally cached birthday +// information in user¹.birthday. +// See here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/constructor/user +// 2. https://core.telegram.org/api/profile#birthday // // See https://core.telegram.org/method/contacts.getBirthdays for reference. func (c *Client) ContactsGetBirthdays(ctx context.Context) (*ContactsContactBirthdays, error) { diff --git a/tg/tl_contacts_get_contact_ids_gen.go b/tg/tl_contacts_get_contact_ids_gen.go index 30b12dfb7c..d595991be2 100644 --- a/tg/tl_contacts_get_contact_ids_gen.go +++ b/tg/tl_contacts_get_contact_ids_gen.go @@ -38,7 +38,7 @@ var ( // // See https://core.telegram.org/method/contacts.getContactIDs for reference. type ContactsGetContactIDsRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_contacts_get_contacts_gen.go b/tg/tl_contacts_get_contacts_gen.go index bfd3c98d83..358d2910f3 100644 --- a/tg/tl_contacts_get_contacts_gen.go +++ b/tg/tl_contacts_get_contacts_gen.go @@ -36,13 +36,17 @@ var ( // // See https://core.telegram.org/method/contacts.getContacts for reference. type ContactsGetContactsRequest struct { - // If there already is a full contact list on the client, a hash¹ of a the list of - // contact IDs in ascending order may be passed in this parameter. If the contact set was - // not changed, (contacts.contactsNotModified)² will be returned. + // Hash used for caching, for more info click here¹.Note that the hash is computed using + // the usual algorithm², passing to the algorithm first the previously returned contacts + // contacts³.saved_count field, then max 100000 sorted user IDs from the contact list, + // including the ID of the currently logged in user if it is saved as a contact. Example: + // tdlib implementation⁴. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - // 2) https://core.telegram.org/constructor/contacts.contactsNotModified + // 2) https://core.telegram.org/api/offsets#hash-generation + // 3) https://core.telegram.org/constructor/contacts.contacts + // 4) https://github.com/tdlib/td/blob/63c7d0301825b78c30dc7307f1f1466be049eb79/td/telegram/UserManager.cpp#L5754 Hash int64 } diff --git a/tg/tl_contacts_get_located_gen.go b/tg/tl_contacts_get_located_gen.go index a0ae30145b..bc6d5ab183 100644 --- a/tg/tl_contacts_get_located_gen.go +++ b/tg/tl_contacts_get_located_gen.go @@ -291,6 +291,7 @@ func (g *ContactsGetLocatedRequest) GetGeoPointAsNotEmpty() (*InputGeoPoint, boo // // Possible errors: // +// 406 BUSINESS_ADDRESS_ACTIVE: The user is currently advertising a Business Location, the location may only be changed (or removed) using account.updateBusinessLocation ». . // 400 GEO_POINT_INVALID: Invalid geoposition provided. // 406 USERPIC_PRIVACY_REQUIRED: You need to disable privacy settings for your profile picture in order to make your geolocation public. // 406 USERPIC_UPLOAD_REQUIRED: You must have a profile picture to publish your geolocation. diff --git a/tg/tl_contacts_get_saved_gen.go b/tg/tl_contacts_get_saved_gen.go index a419a51644..cbe5cb3a99 100644 --- a/tg/tl_contacts_get_saved_gen.go +++ b/tg/tl_contacts_get_saved_gen.go @@ -139,6 +139,7 @@ func (g *ContactsGetSavedRequest) DecodeBare(b *bin.Buffer) error { // // Possible errors: // +// 400 TAKEOUT_INVALID: The specified takeout ID is invalid. // 403 TAKEOUT_REQUIRED: A takeout¹ session needs to be initialized first, see here » for more info². // // See https://core.telegram.org/method/contacts.getSaved for reference. diff --git a/tg/tl_contacts_get_top_peers_gen.go b/tg/tl_contacts_get_top_peers_gen.go index 4ce5bbaef4..608107644c 100644 --- a/tg/tl_contacts_get_top_peers_gen.go +++ b/tg/tl_contacts_get_top_peers_gen.go @@ -57,7 +57,10 @@ type ContactsGetTopPeersRequest struct { Groups bool // Most frequently visited channels Channels bool - // BotsApp field of ContactsGetTopPeersRequest. + // Most frequently used Main Mini Bot Apps¹. + // + // Links: + // 1) https://core.telegram.org/api/bots/webapps#main-mini-apps BotsApp bool // Offset for pagination¹ // @@ -69,7 +72,7 @@ type ContactsGetTopPeersRequest struct { // Links: // 1) https://core.telegram.org/api/offsets Limit int - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_contacts_import_contact_token_gen.go b/tg/tl_contacts_import_contact_token_gen.go index 8652cf7d1e..6f1e4593fb 100644 --- a/tg/tl_contacts_import_contact_token_gen.go +++ b/tg/tl_contacts_import_contact_token_gen.go @@ -178,7 +178,6 @@ func (i *ContactsImportContactTokenRequest) GetToken() (value string) { // 400 IMPORT_TOKEN_INVALID: The specified token is invalid. // // See https://core.telegram.org/method/contacts.importContactToken for reference. -// Can be used by bots. func (c *Client) ContactsImportContactToken(ctx context.Context, token string) (UserClass, error) { var result UserBox diff --git a/tg/tl_dialog_filter_gen.go b/tg/tl_dialog_filter_gen.go index 9e8703c0e6..d2dee88e5d 100644 --- a/tg/tl_dialog_filter_gen.go +++ b/tg/tl_dialog_filter_gen.go @@ -89,7 +89,7 @@ type DialogFilter struct { // Links: // 1) https://core.telegram.org/api/folders ID int - // Folder¹ name + // Folder¹ name (max 12 UTF-8 chars) // // Links: // 1) https://core.telegram.org/api/folders @@ -98,7 +98,10 @@ type DialogFilter struct { // // Use SetEmoticon and GetEmoticon helpers. Emoticon string - // Color field of DialogFilter. + // A color ID for the folder tag associated to this folder, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/folders#folder-tags // // Use SetColor and GetColor helpers. Color int @@ -905,13 +908,16 @@ type DialogFilterChatlist struct { HasMyInvites bool // ID of the folder ID int - // Name of the folder + // Name of the folder (max 12 UTF-8 chars) Title string // Emoji to use as icon for the folder. // // Use SetEmoticon and GetEmoticon helpers. Emoticon string - // Color field of DialogFilterChatlist. + // A color ID for the folder tag associated to this folder, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/folders#folder-tags // // Use SetColor and GetColor helpers. Color int diff --git a/tg/tl_document_attribute_gen.go b/tg/tl_document_attribute_gen.go index 0c8040eac4..d6183ac264 100644 --- a/tg/tl_document_attribute_gen.go +++ b/tg/tl_document_attribute_gen.go @@ -596,7 +596,8 @@ type DocumentAttributeVideo struct { // // Use SetPreloadPrefixSize and GetPreloadPrefixSize helpers. PreloadPrefixSize int - // VideoStartTs field of DocumentAttributeVideo. + // Floating point UNIX timestamp in seconds, indicating the frame of the video that + // should be used as static preview and thumbnail. // // Use SetVideoStartTs and GetVideoStartTs helpers. VideoStartTs float64 diff --git a/tg/tl_draft_message_gen.go b/tg/tl_draft_message_gen.go index 6c5c810813..a652469376 100644 --- a/tg/tl_draft_message_gen.go +++ b/tg/tl_draft_message_gen.go @@ -246,7 +246,10 @@ type DraftMessage struct { Media InputMediaClass // Date of last update of the draft. Date int - // Effect field of DraftMessage. + // A message effect that should be played as specified here »¹. + // + // Links: + // 1) https://core.telegram.org/api/effects // // Use SetEffect and GetEffect helpers. Effect int64 diff --git a/tg/tl_emoji_group_gen.go b/tg/tl_emoji_group_gen.go index a47ac8b27a..94c43e2e5f 100644 --- a/tg/tl_emoji_group_gen.go +++ b/tg/tl_emoji_group_gen.go @@ -35,7 +35,7 @@ var ( // Represents an emoji category¹. // // Links: -// 1. https://core.telegram.org/api/custom-emoji#emoji-categories +// 1. https://core.telegram.org/api/emoji-categories // // See https://core.telegram.org/constructor/emojiGroup for reference. type EmojiGroup struct { @@ -237,14 +237,20 @@ func (e *EmojiGroup) GetEmoticons() (value []string) { } // EmojiGroupGreeting represents TL type `emojiGroupGreeting#80d26cc7`. +// Represents an emoji category¹, that should be moved to the top of the list when +// choosing a sticker for a business introduction² +// +// Links: +// 1. https://core.telegram.org/api/emoji-categories +// 2. https://core.telegram.org/api/business#business-introduction // // See https://core.telegram.org/constructor/emojiGroupGreeting for reference. type EmojiGroupGreeting struct { - // Title field of EmojiGroupGreeting. + // Category name, i.e. "Animals", "Flags", "Faces" and so on... Title string - // IconEmojiID field of EmojiGroupGreeting. + // A single custom emoji used as preview for the category. IconEmojiID int64 - // Emoticons field of EmojiGroupGreeting. + // A list of UTF-8 emojis, matching the category. Emoticons []string } @@ -438,12 +444,23 @@ func (e *EmojiGroupGreeting) GetEmoticons() (value []string) { } // EmojiGroupPremium represents TL type `emojiGroupPremium#93bcf34`. +// An emoji category¹, used to select all Premium²-only stickers (i.e. those with a +// Premium effect »³)/Premium⁴-only custom emojis⁵ (i.e. those where the +// documentAttributeCustomEmoji⁶.free flag is not set) +// +// Links: +// 1. https://core.telegram.org/api/emoji-categories +// 2. https://core.telegram.org/api/premium +// 3. https://core.telegram.org/api/stickers#premium-animated-sticker-effects +// 4. https://core.telegram.org/api/premium +// 5. https://core.telegram.org/api/custom-emoji +// 6. https://core.telegram.org/constructor/documentAttributeCustomEmoji // // See https://core.telegram.org/constructor/emojiGroupPremium for reference. type EmojiGroupPremium struct { - // Title field of EmojiGroupPremium. + // Category name, i.e. "Animals", "Flags", "Faces" and so on... Title string - // IconEmojiID field of EmojiGroupPremium. + // A single custom emoji used as preview for the category. IconEmojiID int64 } diff --git a/tg/tl_emoji_list_gen.go b/tg/tl_emoji_list_gen.go index 933616d1d6..58310b08f0 100644 --- a/tg/tl_emoji_list_gen.go +++ b/tg/tl_emoji_list_gen.go @@ -144,7 +144,7 @@ func (e *EmojiListNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/emojiList for reference. type EmojiList struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_errors_gen.go b/tg/tl_errors_gen.go index e9bb2cae9a..a3b97233b7 100644 --- a/tg/tl_errors_gen.go +++ b/tg/tl_errors_gen.go @@ -43,6 +43,7 @@ const ( ErrAdminRankEmojiNotAllowed = "ADMIN_RANK_EMOJI_NOT_ALLOWED" ErrAdminRankInvalid = "ADMIN_RANK_INVALID" ErrAdminRightsEmpty = "ADMIN_RIGHTS_EMPTY" + ErrAdExpired = "AD_EXPIRED" ErrAlbumPhotosTooMany = "ALBUM_PHOTOS_TOO_MANY" ErrAnonymousReactionsDisabled = "ANONYMOUS_REACTIONS_DISABLED" ErrAPIIDInvalid = "API_ID_INVALID" @@ -58,22 +59,28 @@ const ( ErrAuthTokenInvalid = "AUTH_TOKEN_INVALID" ErrAuthTokenInvalidx = "AUTH_TOKEN_INVALIDX" ErrAutoarchiveNotAvailable = "AUTOARCHIVE_NOT_AVAILABLE" + ErrBalanceTooLow = "BALANCE_TOO_LOW" ErrBankCardNumberInvalid = "BANK_CARD_NUMBER_INVALID" ErrBannedRightsInvalid = "BANNED_RIGHTS_INVALID" + ErrBirthdayInvalid = "BIRTHDAY_INVALID" ErrBoostsEmpty = "BOOSTS_EMPTY" ErrBoostsRequired = "BOOSTS_REQUIRED" ErrBoostPeerInvalid = "BOOST_PEER_INVALID" ErrBotsTooMuch = "BOTS_TOO_MUCH" + ErrBotAlreadyDisabled = "BOT_ALREADY_DISABLED" + ErrBotAppBotInvalid = "BOT_APP_BOT_INVALID" ErrBotAppInvalid = "BOT_APP_INVALID" ErrBotAppShortnameInvalid = "BOT_APP_SHORTNAME_INVALID" + ErrBotBusinessMissing = "BOT_BUSINESS_MISSING" ErrBotChannelsNa = "BOT_CHANNELS_NA" ErrBotCommandDescriptionInvalid = "BOT_COMMAND_DESCRIPTION_INVALID" ErrBotCommandInvalid = "BOT_COMMAND_INVALID" ErrBotDomainInvalid = "BOT_DOMAIN_INVALID" + ErrBotGamesDisabled = "BOT_GAMES_DISABLED" ErrBotGroupsBlocked = "BOT_GROUPS_BLOCKED" ErrBotInlineDisabled = "BOT_INLINE_DISABLED" ErrBotInvalid = "BOT_INVALID" - ErrBotMissing = "BOT_MISSING" + ErrBotNotConnectedYet = "BOT_NOT_CONNECTED_YET" ErrBotOnesideNotAvail = "BOT_ONESIDE_NOT_AVAIL" ErrBotPaymentsDisabled = "BOT_PAYMENTS_DISABLED" ErrBotResponseTimeout = "BOT_RESPONSE_TIMEOUT" @@ -83,7 +90,13 @@ const ( ErrBroadcastIDInvalid = "BROADCAST_ID_INVALID" ErrBroadcastPublicVotersForbidden = "BROADCAST_PUBLIC_VOTERS_FORBIDDEN" ErrBroadcastRequired = "BROADCAST_REQUIRED" + ErrBusinessAddressActive = "BUSINESS_ADDRESS_ACTIVE" + ErrBusinessPeerInvalid = "BUSINESS_PEER_INVALID" + ErrBusinessRecipientsEmpty = "BUSINESS_RECIPIENTS_EMPTY" + ErrBusinessWorkHoursEmpty = "BUSINESS_WORK_HOURS_EMPTY" + ErrBusinessWorkHoursPeriodInvalid = "BUSINESS_WORK_HOURS_PERIOD_INVALID" ErrButtonDataInvalid = "BUTTON_DATA_INVALID" + ErrButtonPosInvalid = "BUTTON_POS_INVALID" ErrButtonTextInvalid = "BUTTON_TEXT_INVALID" ErrButtonTypeInvalid = "BUTTON_TYPE_INVALID" ErrButtonURLInvalid = "BUTTON_URL_INVALID" @@ -108,9 +121,14 @@ const ( ErrChannelPublicGroupNa = "CHANNEL_PUBLIC_GROUP_NA" ErrChannelTooBig = "CHANNEL_TOO_BIG" ErrChannelTooLarge = "CHANNEL_TOO_LARGE" + ErrChargeAlreadyRefunded = "CHARGE_ALREADY_REFUNDED" + ErrChatlinksTooMuch = "CHATLINKS_TOO_MUCH" + ErrChatlinkSlugEmpty = "CHATLINK_SLUG_EMPTY" + ErrChatlinkSlugExpired = "CHATLINK_SLUG_EXPIRED" ErrChatlistExcludeInvalid = "CHATLIST_EXCLUDE_INVALID" ErrChatAboutNotModified = "CHAT_ABOUT_NOT_MODIFIED" ErrChatAboutTooLong = "CHAT_ABOUT_TOO_LONG" + ErrChatActionForbidden = "CHAT_ACTION_FORBIDDEN" ErrChatAdminInviteRequired = "CHAT_ADMIN_INVITE_REQUIRED" ErrChatAdminRequired = "CHAT_ADMIN_REQUIRED" ErrChatDiscussionUnallowed = "CHAT_DISCUSSION_UNALLOWED" @@ -135,6 +153,7 @@ const ( ErrChatSendPhotosForbidden = "CHAT_SEND_PHOTOS_FORBIDDEN" ErrChatSendPlainForbidden = "CHAT_SEND_PLAIN_FORBIDDEN" ErrChatSendPollForbidden = "CHAT_SEND_POLL_FORBIDDEN" + ErrChatSendRoundvideosForbidden = "CHAT_SEND_ROUNDVIDEOS_FORBIDDEN" ErrChatSendStickersForbidden = "CHAT_SEND_STICKERS_FORBIDDEN" ErrChatSendVideosForbidden = "CHAT_SEND_VIDEOS_FORBIDDEN" ErrChatSendVoicesForbidden = "CHAT_SEND_VOICES_FORBIDDEN" @@ -144,9 +163,12 @@ const ( ErrCodeEmpty = "CODE_EMPTY" ErrCodeHashInvalid = "CODE_HASH_INVALID" ErrCodeInvalid = "CODE_INVALID" + ErrCollectibleInvalid = "COLLECTIBLE_INVALID" + ErrCollectibleNotFound = "COLLECTIBLE_NOT_FOUND" ErrColorInvalid = "COLOR_INVALID" ErrConnectionAPIIDInvalid = "CONNECTION_API_ID_INVALID" ErrConnectionAppVersionEmpty = "CONNECTION_APP_VERSION_EMPTY" + ErrConnectionIDInvalid = "CONNECTION_ID_INVALID" ErrConnectionLayerInvalid = "CONNECTION_LAYER_INVALID" ErrContactAddMissing = "CONTACT_ADD_MISSING" ErrContactIDInvalid = "CONTACT_ID_INVALID" @@ -166,6 +188,7 @@ const ( ErrEditBotInviteForbidden = "EDIT_BOT_INVITE_FORBIDDEN" ErrEmailHashExpired = "EMAIL_HASH_EXPIRED" ErrEmailInvalid = "EMAIL_INVALID" + ErrEmailNotAllowed = "EMAIL_NOT_ALLOWED" ErrEmailNotSetup = "EMAIL_NOT_SETUP" ErrEmailUnconfirmed = "EMAIL_UNCONFIRMED" ErrEmailVerifyExpired = "EMAIL_VERIFY_EXPIRED" @@ -197,7 +220,6 @@ const ( ErrFilePartSizeChanged = "FILE_PART_SIZE_CHANGED" ErrFilePartSizeInvalid = "FILE_PART_SIZE_INVALID" ErrFilePartTooBig = "FILE_PART_TOO_BIG" - ErrFileReference = "FILE_REFERENCE" ErrFileReferenceEmpty = "FILE_REFERENCE_EMPTY" ErrFileReferenceExpired = "FILE_REFERENCE_EXPIRED" ErrFileReferenceInvalid = "FILE_REFERENCE_INVALID" @@ -208,7 +230,9 @@ const ( ErrFilterNotSupported = "FILTER_NOT_SUPPORTED" ErrFilterTitleEmpty = "FILTER_TITLE_EMPTY" ErrFirstnameInvalid = "FIRSTNAME_INVALID" + ErrFloodPremiumWait = "FLOOD_PREMIUM_WAIT" ErrFolderIDInvalid = "FOLDER_ID_INVALID" + ErrFormExpired = "FORM_EXPIRED" ErrForumEnabled = "FORUM_ENABLED" ErrFreshChangeAdminsForbidden = "FRESH_CHANGE_ADMINS_FORBIDDEN" ErrFreshChangePhoneForbidden = "FRESH_CHANGE_PHONE_FORBIDDEN" @@ -233,16 +257,19 @@ const ( ErrGroupcallNotModified = "GROUPCALL_NOT_MODIFIED" ErrGroupcallSsrcDuplicateMuch = "GROUPCALL_SSRC_DUPLICATE_MUCH" ErrGroupedMediaInvalid = "GROUPED_MEDIA_INVALID" + ErrHashtagInvalid = "HASHTAG_INVALID" ErrHashInvalid = "HASH_INVALID" ErrHideRequesterMissing = "HIDE_REQUESTER_MISSING" ErrImageProcessFailed = "IMAGE_PROCESS_FAILED" ErrImportFileInvalid = "IMPORT_FILE_INVALID" + ErrImportFormatDateInvalid = "IMPORT_FORMAT_DATE_INVALID" ErrImportFormatUnrecognized = "IMPORT_FORMAT_UNRECOGNIZED" ErrImportIDInvalid = "IMPORT_ID_INVALID" ErrImportTokenInvalid = "IMPORT_TOKEN_INVALID" ErrInlineBotRequired = "INLINE_BOT_REQUIRED" ErrInlineResultExpired = "INLINE_RESULT_EXPIRED" ErrInputChatlistInvalid = "INPUT_CHATLIST_INVALID" + ErrInputFileInvalid = "INPUT_FILE_INVALID" ErrInputFilterInvalid = "INPUT_FILTER_INVALID" ErrInputTextEmpty = "INPUT_TEXT_EMPTY" ErrInputTextTooLong = "INPUT_TEXT_TOO_LONG" @@ -258,6 +285,7 @@ const ( ErrInviteSlugExpired = "INVITE_SLUG_EXPIRED" ErrInvoicePayloadInvalid = "INVOICE_PAYLOAD_INVALID" ErrJoinAsPeerInvalid = "JOIN_AS_PEER_INVALID" + ErrLanguageInvalid = "LANGUAGE_INVALID" ErrLangCodeInvalid = "LANG_CODE_INVALID" ErrLangCodeNotSupported = "LANG_CODE_NOT_SUPPORTED" ErrLangPackInvalid = "LANG_PACK_INVALID" @@ -290,8 +318,10 @@ const ( ErrMessageIDsEmpty = "MESSAGE_IDS_EMPTY" ErrMessageIDInvalid = "MESSAGE_ID_INVALID" ErrMessageNotModified = "MESSAGE_NOT_MODIFIED" + ErrMessageNotReadYet = "MESSAGE_NOT_READ_YET" ErrMessagePollClosed = "MESSAGE_POLL_CLOSED" ErrMessageTooLong = "MESSAGE_TOO_LONG" + ErrMessageTooOld = "MESSAGE_TOO_OLD" ErrMethodInvalid = "METHOD_INVALID" ErrMinDateInvalid = "MIN_DATE_INVALID" ErrMsgIDInvalid = "MSG_ID_INVALID" @@ -302,6 +332,8 @@ const ( ErrNewSettingsEmpty = "NEW_SETTINGS_EMPTY" ErrNewSettingsInvalid = "NEW_SETTINGS_INVALID" ErrNextOffsetInvalid = "NEXT_OFFSET_INVALID" + ErrNotEligible = "NOT_ELIGIBLE" + ErrNotJoined = "NOT_JOINED" ErrOffsetInvalid = "OFFSET_INVALID" ErrOffsetPeerIDInvalid = "OFFSET_PEER_ID_INVALID" ErrOptionsTooMuch = "OPTIONS_TOO_MUCH" @@ -364,6 +396,7 @@ const ( ErrPollQuestionInvalid = "POLL_QUESTION_INVALID" ErrPollVoteRequired = "POLL_VOTE_REQUIRED" ErrPremiumAccountRequired = "PREMIUM_ACCOUNT_REQUIRED" + ErrPremiumCurrentlyUnavailable = "PREMIUM_CURRENTLY_UNAVAILABLE" ErrPremiumSubActiveUntil = "PREMIUM_SUB_ACTIVE_UNTIL" ErrPreviousChatImportActiveWaitMin = "PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_MIN" ErrPrivacyKeyInvalid = "PRIVACY_KEY_INVALID" @@ -375,11 +408,14 @@ const ( ErrQueryIDEmpty = "QUERY_ID_EMPTY" ErrQueryIDInvalid = "QUERY_ID_INVALID" ErrQueryTooShort = "QUERY_TOO_SHORT" + ErrQuickRepliesTooMuch = "QUICK_REPLIES_TOO_MUCH" ErrQuizAnswerMissing = "QUIZ_ANSWER_MISSING" ErrQuizCorrectAnswersEmpty = "QUIZ_CORRECT_ANSWERS_EMPTY" ErrQuizCorrectAnswersTooMuch = "QUIZ_CORRECT_ANSWERS_TOO_MUCH" ErrQuizCorrectAnswerInvalid = "QUIZ_CORRECT_ANSWER_INVALID" ErrQuizMultipleInvalid = "QUIZ_MULTIPLE_INVALID" + ErrQuoteTextInvalid = "QUOTE_TEXT_INVALID" + ErrRaiseHandForbidden = "RAISE_HAND_FORBIDDEN" ErrRandomIDDuplicate = "RANDOM_ID_DUPLICATE" ErrRandomIDEmpty = "RANDOM_ID_EMPTY" ErrRandomIDInvalid = "RANDOM_ID_INVALID" @@ -388,12 +424,16 @@ const ( ErrReactionsTooMany = "REACTIONS_TOO_MANY" ErrReactionEmpty = "REACTION_EMPTY" ErrReactionInvalid = "REACTION_INVALID" + ErrReceiptEmpty = "RECEIPT_EMPTY" ErrReplyMarkupBuyEmpty = "REPLY_MARKUP_BUY_EMPTY" + ErrReplyMarkupGameEmpty = "REPLY_MARKUP_GAME_EMPTY" ErrReplyMarkupInvalid = "REPLY_MARKUP_INVALID" ErrReplyMarkupTooLong = "REPLY_MARKUP_TOO_LONG" + ErrReplyMessagesTooMuch = "REPLY_MESSAGES_TOO_MUCH" ErrReplyMessageIDInvalid = "REPLY_MESSAGE_ID_INVALID" ErrReplyToInvalid = "REPLY_TO_INVALID" ErrReplyToUserInvalid = "REPLY_TO_USER_INVALID" + ErrRequestTokenInvalid = "REQUEST_TOKEN_INVALID" ErrResetRequestMissing = "RESET_REQUEST_MISSING" ErrResultsTooMuch = "RESULTS_TOO_MUCH" ErrResultIDDuplicate = "RESULT_ID_DUPLICATE" @@ -403,6 +443,8 @@ const ( ErrRevoteNotAllowed = "REVOTE_NOT_ALLOWED" ErrRightsNotModified = "RIGHTS_NOT_MODIFIED" ErrRightForbidden = "RIGHT_FORBIDDEN" + ErrRingtoneInvalid = "RINGTONE_INVALID" + ErrRingtoneMimeInvalid = "RINGTONE_MIME_INVALID" ErrRsaDecryptFailed = "RSA_DECRYPT_FAILED" ErrScheduleBotNotAllowed = "SCHEDULE_BOT_NOT_ALLOWED" ErrScheduleDateInvalid = "SCHEDULE_DATE_INVALID" @@ -413,6 +455,7 @@ const ( ErrSearchQueryEmpty = "SEARCH_QUERY_EMPTY" ErrSearchWithLinkNotSupported = "SEARCH_WITH_LINK_NOT_SUPPORTED" ErrSecondsInvalid = "SECONDS_INVALID" + ErrSecureSecretRequired = "SECURE_SECRET_REQUIRED" ErrSendAsPeerInvalid = "SEND_AS_PEER_INVALID" ErrSendCodeUnavailable = "SEND_CODE_UNAVAILABLE" ErrSendMediaInvalid = "SEND_MEDIA_INVALID" @@ -422,6 +465,7 @@ const ( ErrSessionTooFresh = "SESSION_TOO_FRESH" ErrSettingsInvalid = "SETTINGS_INVALID" ErrSHA256HashInvalid = "SHA256_HASH_INVALID" + ErrShortcutInvalid = "SHORTCUT_INVALID" ErrShortNameInvalid = "SHORT_NAME_INVALID" ErrShortNameOccupied = "SHORT_NAME_OCCUPIED" ErrSignInFailed = "SIGN_IN_FAILED" @@ -429,6 +473,7 @@ const ( ErrSlowmodeMultiMsgsDisabled = "SLOWMODE_MULTI_MSGS_DISABLED" ErrSlowmodeWait = "SLOWMODE_WAIT" ErrSlugInvalid = "SLUG_INVALID" + ErrSmsjobIDInvalid = "SMSJOB_ID_INVALID" ErrSMSCodeCreateFailed = "SMS_CODE_CREATE_FAILED" ErrSRPIDInvalid = "SRP_ID_INVALID" ErrSRPPasswordChanged = "SRP_PASSWORD_CHANGED" @@ -465,6 +510,7 @@ const ( ErrStorySendFloodMonthly = "STORY_SEND_FLOOD_MONTHLY" ErrStorySendFloodWeekly = "STORY_SEND_FLOOD_WEEKLY" ErrSwitchPmTextEmpty = "SWITCH_PM_TEXT_EMPTY" + ErrSwitchWebviewURLInvalid = "SWITCH_WEBVIEW_URL_INVALID" ErrTakeoutInitDelay = "TAKEOUT_INIT_DELAY" ErrTakeoutInvalid = "TAKEOUT_INVALID" ErrTakeoutRequired = "TAKEOUT_REQUIRED" @@ -476,6 +522,7 @@ const ( ErrThemeInvalid = "THEME_INVALID" ErrThemeMimeInvalid = "THEME_MIME_INVALID" ErrThemeTitleInvalid = "THEME_TITLE_INVALID" + ErrTimezoneInvalid = "TIMEZONE_INVALID" ErrTitleInvalid = "TITLE_INVALID" ErrTmpPasswordDisabled = "TMP_PASSWORD_DISABLED" ErrTokenEmpty = "TOKEN_EMPTY" @@ -491,12 +538,14 @@ const ( ErrTopicTitleEmpty = "TOPIC_TITLE_EMPTY" ErrToLangInvalid = "TO_LANG_INVALID" ErrTranscriptionFailed = "TRANSCRIPTION_FAILED" + ErrTranslateReqQuotaExceeded = "TRANSLATE_REQ_QUOTA_EXCEEDED" ErrTTLDaysInvalid = "TTL_DAYS_INVALID" ErrTTLMediaInvalid = "TTL_MEDIA_INVALID" ErrTTLPeriodInvalid = "TTL_PERIOD_INVALID" ErrTypesEmpty = "TYPES_EMPTY" ErrTimeout = "Timeout" ErrUntilDateInvalid = "UNTIL_DATE_INVALID" + ErrUpdateAppToLogin = "UPDATE_APP_TO_LOGIN" ErrURLInvalid = "URL_INVALID" ErrUsageLimitInvalid = "USAGE_LIMIT_INVALID" ErrUsernamesActiveTooMuch = "USERNAMES_ACTIVE_TOO_MUCH" @@ -534,6 +583,8 @@ const ( ErrVenueIDInvalid = "VENUE_ID_INVALID" ErrVideoContentTypeInvalid = "VIDEO_CONTENT_TYPE_INVALID" ErrVideoFileInvalid = "VIDEO_FILE_INVALID" + ErrVideoPauseForbidden = "VIDEO_PAUSE_FORBIDDEN" + ErrVideoStopForbidden = "VIDEO_STOP_FORBIDDEN" ErrVideoTitleEmpty = "VIDEO_TITLE_EMPTY" ErrVoiceMessagesForbidden = "VOICE_MESSAGES_FORBIDDEN" ErrWallpaperFileInvalid = "WALLPAPER_FILE_INVALID" @@ -552,6 +603,7 @@ const ( ErrWebpushAuthInvalid = "WEBPUSH_AUTH_INVALID" ErrWebpushKeyInvalid = "WEBPUSH_KEY_INVALID" ErrWebpushTokenInvalid = "WEBPUSH_TOKEN_INVALID" + ErrYourPrivacyRestricted = "YOUR_PRIVACY_RESTRICTED" ErrYouBlockedUser = "YOU_BLOCKED_USER" ) @@ -605,6 +657,11 @@ func IsAdminRightsEmpty(err error) bool { return tgerr.Is(err, ErrAdminRightsEmpty) } +// IsAdExpired reports whether err is AD_EXPIRED. +func IsAdExpired(err error) bool { + return tgerr.Is(err, ErrAdExpired) +} + // IsAlbumPhotosTooMany reports whether err is ALBUM_PHOTOS_TOO_MANY. func IsAlbumPhotosTooMany(err error) bool { return tgerr.Is(err, ErrAlbumPhotosTooMany) @@ -680,6 +737,11 @@ func IsAutoarchiveNotAvailable(err error) bool { return tgerr.Is(err, ErrAutoarchiveNotAvailable) } +// IsBalanceTooLow reports whether err is BALANCE_TOO_LOW. +func IsBalanceTooLow(err error) bool { + return tgerr.Is(err, ErrBalanceTooLow) +} + // IsBankCardNumberInvalid reports whether err is BANK_CARD_NUMBER_INVALID. func IsBankCardNumberInvalid(err error) bool { return tgerr.Is(err, ErrBankCardNumberInvalid) @@ -690,6 +752,11 @@ func IsBannedRightsInvalid(err error) bool { return tgerr.Is(err, ErrBannedRightsInvalid) } +// IsBirthdayInvalid reports whether err is BIRTHDAY_INVALID. +func IsBirthdayInvalid(err error) bool { + return tgerr.Is(err, ErrBirthdayInvalid) +} + // IsBoostsEmpty reports whether err is BOOSTS_EMPTY. func IsBoostsEmpty(err error) bool { return tgerr.Is(err, ErrBoostsEmpty) @@ -710,6 +777,16 @@ func IsBotsTooMuch(err error) bool { return tgerr.Is(err, ErrBotsTooMuch) } +// IsBotAlreadyDisabled reports whether err is BOT_ALREADY_DISABLED. +func IsBotAlreadyDisabled(err error) bool { + return tgerr.Is(err, ErrBotAlreadyDisabled) +} + +// IsBotAppBotInvalid reports whether err is BOT_APP_BOT_INVALID. +func IsBotAppBotInvalid(err error) bool { + return tgerr.Is(err, ErrBotAppBotInvalid) +} + // IsBotAppInvalid reports whether err is BOT_APP_INVALID. func IsBotAppInvalid(err error) bool { return tgerr.Is(err, ErrBotAppInvalid) @@ -720,6 +797,11 @@ func IsBotAppShortnameInvalid(err error) bool { return tgerr.Is(err, ErrBotAppShortnameInvalid) } +// IsBotBusinessMissing reports whether err is BOT_BUSINESS_MISSING. +func IsBotBusinessMissing(err error) bool { + return tgerr.Is(err, ErrBotBusinessMissing) +} + // IsBotChannelsNa reports whether err is BOT_CHANNELS_NA. func IsBotChannelsNa(err error) bool { return tgerr.Is(err, ErrBotChannelsNa) @@ -740,6 +822,11 @@ func IsBotDomainInvalid(err error) bool { return tgerr.Is(err, ErrBotDomainInvalid) } +// IsBotGamesDisabled reports whether err is BOT_GAMES_DISABLED. +func IsBotGamesDisabled(err error) bool { + return tgerr.Is(err, ErrBotGamesDisabled) +} + // IsBotGroupsBlocked reports whether err is BOT_GROUPS_BLOCKED. func IsBotGroupsBlocked(err error) bool { return tgerr.Is(err, ErrBotGroupsBlocked) @@ -755,9 +842,9 @@ func IsBotInvalid(err error) bool { return tgerr.Is(err, ErrBotInvalid) } -// IsBotMissing reports whether err is BOT_MISSING. -func IsBotMissing(err error) bool { - return tgerr.Is(err, ErrBotMissing) +// IsBotNotConnectedYet reports whether err is BOT_NOT_CONNECTED_YET. +func IsBotNotConnectedYet(err error) bool { + return tgerr.Is(err, ErrBotNotConnectedYet) } // IsBotOnesideNotAvail reports whether err is BOT_ONESIDE_NOT_AVAIL. @@ -805,11 +892,41 @@ func IsBroadcastRequired(err error) bool { return tgerr.Is(err, ErrBroadcastRequired) } +// IsBusinessAddressActive reports whether err is BUSINESS_ADDRESS_ACTIVE. +func IsBusinessAddressActive(err error) bool { + return tgerr.Is(err, ErrBusinessAddressActive) +} + +// IsBusinessPeerInvalid reports whether err is BUSINESS_PEER_INVALID. +func IsBusinessPeerInvalid(err error) bool { + return tgerr.Is(err, ErrBusinessPeerInvalid) +} + +// IsBusinessRecipientsEmpty reports whether err is BUSINESS_RECIPIENTS_EMPTY. +func IsBusinessRecipientsEmpty(err error) bool { + return tgerr.Is(err, ErrBusinessRecipientsEmpty) +} + +// IsBusinessWorkHoursEmpty reports whether err is BUSINESS_WORK_HOURS_EMPTY. +func IsBusinessWorkHoursEmpty(err error) bool { + return tgerr.Is(err, ErrBusinessWorkHoursEmpty) +} + +// IsBusinessWorkHoursPeriodInvalid reports whether err is BUSINESS_WORK_HOURS_PERIOD_INVALID. +func IsBusinessWorkHoursPeriodInvalid(err error) bool { + return tgerr.Is(err, ErrBusinessWorkHoursPeriodInvalid) +} + // IsButtonDataInvalid reports whether err is BUTTON_DATA_INVALID. func IsButtonDataInvalid(err error) bool { return tgerr.Is(err, ErrButtonDataInvalid) } +// IsButtonPosInvalid reports whether err is BUTTON_POS_INVALID. +func IsButtonPosInvalid(err error) bool { + return tgerr.Is(err, ErrButtonPosInvalid) +} + // IsButtonTextInvalid reports whether err is BUTTON_TEXT_INVALID. func IsButtonTextInvalid(err error) bool { return tgerr.Is(err, ErrButtonTextInvalid) @@ -930,6 +1047,26 @@ func IsChannelTooLarge(err error) bool { return tgerr.Is(err, ErrChannelTooLarge) } +// IsChargeAlreadyRefunded reports whether err is CHARGE_ALREADY_REFUNDED. +func IsChargeAlreadyRefunded(err error) bool { + return tgerr.Is(err, ErrChargeAlreadyRefunded) +} + +// IsChatlinksTooMuch reports whether err is CHATLINKS_TOO_MUCH. +func IsChatlinksTooMuch(err error) bool { + return tgerr.Is(err, ErrChatlinksTooMuch) +} + +// IsChatlinkSlugEmpty reports whether err is CHATLINK_SLUG_EMPTY. +func IsChatlinkSlugEmpty(err error) bool { + return tgerr.Is(err, ErrChatlinkSlugEmpty) +} + +// IsChatlinkSlugExpired reports whether err is CHATLINK_SLUG_EXPIRED. +func IsChatlinkSlugExpired(err error) bool { + return tgerr.Is(err, ErrChatlinkSlugExpired) +} + // IsChatlistExcludeInvalid reports whether err is CHATLIST_EXCLUDE_INVALID. func IsChatlistExcludeInvalid(err error) bool { return tgerr.Is(err, ErrChatlistExcludeInvalid) @@ -945,6 +1082,11 @@ func IsChatAboutTooLong(err error) bool { return tgerr.Is(err, ErrChatAboutTooLong) } +// IsChatActionForbidden reports whether err is CHAT_ACTION_FORBIDDEN. +func IsChatActionForbidden(err error) bool { + return tgerr.Is(err, ErrChatActionForbidden) +} + // IsChatAdminInviteRequired reports whether err is CHAT_ADMIN_INVITE_REQUIRED. func IsChatAdminInviteRequired(err error) bool { return tgerr.Is(err, ErrChatAdminInviteRequired) @@ -1065,6 +1207,11 @@ func IsChatSendPollForbidden(err error) bool { return tgerr.Is(err, ErrChatSendPollForbidden) } +// IsChatSendRoundvideosForbidden reports whether err is CHAT_SEND_ROUNDVIDEOS_FORBIDDEN. +func IsChatSendRoundvideosForbidden(err error) bool { + return tgerr.Is(err, ErrChatSendRoundvideosForbidden) +} + // IsChatSendStickersForbidden reports whether err is CHAT_SEND_STICKERS_FORBIDDEN. func IsChatSendStickersForbidden(err error) bool { return tgerr.Is(err, ErrChatSendStickersForbidden) @@ -1110,6 +1257,16 @@ func IsCodeInvalid(err error) bool { return tgerr.Is(err, ErrCodeInvalid) } +// IsCollectibleInvalid reports whether err is COLLECTIBLE_INVALID. +func IsCollectibleInvalid(err error) bool { + return tgerr.Is(err, ErrCollectibleInvalid) +} + +// IsCollectibleNotFound reports whether err is COLLECTIBLE_NOT_FOUND. +func IsCollectibleNotFound(err error) bool { + return tgerr.Is(err, ErrCollectibleNotFound) +} + // IsColorInvalid reports whether err is COLOR_INVALID. func IsColorInvalid(err error) bool { return tgerr.Is(err, ErrColorInvalid) @@ -1125,6 +1282,11 @@ func IsConnectionAppVersionEmpty(err error) bool { return tgerr.Is(err, ErrConnectionAppVersionEmpty) } +// IsConnectionIDInvalid reports whether err is CONNECTION_ID_INVALID. +func IsConnectionIDInvalid(err error) bool { + return tgerr.Is(err, ErrConnectionIDInvalid) +} + // IsConnectionLayerInvalid reports whether err is CONNECTION_LAYER_INVALID. func IsConnectionLayerInvalid(err error) bool { return tgerr.Is(err, ErrConnectionLayerInvalid) @@ -1220,6 +1382,11 @@ func IsEmailInvalid(err error) bool { return tgerr.Is(err, ErrEmailInvalid) } +// IsEmailNotAllowed reports whether err is EMAIL_NOT_ALLOWED. +func IsEmailNotAllowed(err error) bool { + return tgerr.Is(err, ErrEmailNotAllowed) +} + // IsEmailNotSetup reports whether err is EMAIL_NOT_SETUP. func IsEmailNotSetup(err error) bool { return tgerr.Is(err, ErrEmailNotSetup) @@ -1375,11 +1542,6 @@ func IsFilePartTooBig(err error) bool { return tgerr.Is(err, ErrFilePartTooBig) } -// IsFileReference reports whether err is FILE_REFERENCE. -func IsFileReference(err error) bool { - return tgerr.Is(err, ErrFileReference) -} - // IsFileReferenceEmpty reports whether err is FILE_REFERENCE_EMPTY. func IsFileReferenceEmpty(err error) bool { return tgerr.Is(err, ErrFileReferenceEmpty) @@ -1430,11 +1592,21 @@ func IsFirstnameInvalid(err error) bool { return tgerr.Is(err, ErrFirstnameInvalid) } +// IsFloodPremiumWait reports whether err is FLOOD_PREMIUM_WAIT. +func IsFloodPremiumWait(err error) bool { + return tgerr.Is(err, ErrFloodPremiumWait) +} + // IsFolderIDInvalid reports whether err is FOLDER_ID_INVALID. func IsFolderIDInvalid(err error) bool { return tgerr.Is(err, ErrFolderIDInvalid) } +// IsFormExpired reports whether err is FORM_EXPIRED. +func IsFormExpired(err error) bool { + return tgerr.Is(err, ErrFormExpired) +} + // IsForumEnabled reports whether err is FORUM_ENABLED. func IsForumEnabled(err error) bool { return tgerr.Is(err, ErrForumEnabled) @@ -1555,6 +1727,11 @@ func IsGroupedMediaInvalid(err error) bool { return tgerr.Is(err, ErrGroupedMediaInvalid) } +// IsHashtagInvalid reports whether err is HASHTAG_INVALID. +func IsHashtagInvalid(err error) bool { + return tgerr.Is(err, ErrHashtagInvalid) +} + // IsHashInvalid reports whether err is HASH_INVALID. func IsHashInvalid(err error) bool { return tgerr.Is(err, ErrHashInvalid) @@ -1575,6 +1752,11 @@ func IsImportFileInvalid(err error) bool { return tgerr.Is(err, ErrImportFileInvalid) } +// IsImportFormatDateInvalid reports whether err is IMPORT_FORMAT_DATE_INVALID. +func IsImportFormatDateInvalid(err error) bool { + return tgerr.Is(err, ErrImportFormatDateInvalid) +} + // IsImportFormatUnrecognized reports whether err is IMPORT_FORMAT_UNRECOGNIZED. func IsImportFormatUnrecognized(err error) bool { return tgerr.Is(err, ErrImportFormatUnrecognized) @@ -1605,6 +1787,11 @@ func IsInputChatlistInvalid(err error) bool { return tgerr.Is(err, ErrInputChatlistInvalid) } +// IsInputFileInvalid reports whether err is INPUT_FILE_INVALID. +func IsInputFileInvalid(err error) bool { + return tgerr.Is(err, ErrInputFileInvalid) +} + // IsInputFilterInvalid reports whether err is INPUT_FILTER_INVALID. func IsInputFilterInvalid(err error) bool { return tgerr.Is(err, ErrInputFilterInvalid) @@ -1680,6 +1867,11 @@ func IsJoinAsPeerInvalid(err error) bool { return tgerr.Is(err, ErrJoinAsPeerInvalid) } +// IsLanguageInvalid reports whether err is LANGUAGE_INVALID. +func IsLanguageInvalid(err error) bool { + return tgerr.Is(err, ErrLanguageInvalid) +} + // IsLangCodeInvalid reports whether err is LANG_CODE_INVALID. func IsLangCodeInvalid(err error) bool { return tgerr.Is(err, ErrLangCodeInvalid) @@ -1840,6 +2032,11 @@ func IsMessageNotModified(err error) bool { return tgerr.Is(err, ErrMessageNotModified) } +// IsMessageNotReadYet reports whether err is MESSAGE_NOT_READ_YET. +func IsMessageNotReadYet(err error) bool { + return tgerr.Is(err, ErrMessageNotReadYet) +} + // IsMessagePollClosed reports whether err is MESSAGE_POLL_CLOSED. func IsMessagePollClosed(err error) bool { return tgerr.Is(err, ErrMessagePollClosed) @@ -1850,6 +2047,11 @@ func IsMessageTooLong(err error) bool { return tgerr.Is(err, ErrMessageTooLong) } +// IsMessageTooOld reports whether err is MESSAGE_TOO_OLD. +func IsMessageTooOld(err error) bool { + return tgerr.Is(err, ErrMessageTooOld) +} + // IsMethodInvalid reports whether err is METHOD_INVALID. func IsMethodInvalid(err error) bool { return tgerr.Is(err, ErrMethodInvalid) @@ -1900,6 +2102,16 @@ func IsNextOffsetInvalid(err error) bool { return tgerr.Is(err, ErrNextOffsetInvalid) } +// IsNotEligible reports whether err is NOT_ELIGIBLE. +func IsNotEligible(err error) bool { + return tgerr.Is(err, ErrNotEligible) +} + +// IsNotJoined reports whether err is NOT_JOINED. +func IsNotJoined(err error) bool { + return tgerr.Is(err, ErrNotJoined) +} + // IsOffsetInvalid reports whether err is OFFSET_INVALID. func IsOffsetInvalid(err error) bool { return tgerr.Is(err, ErrOffsetInvalid) @@ -2210,6 +2422,11 @@ func IsPremiumAccountRequired(err error) bool { return tgerr.Is(err, ErrPremiumAccountRequired) } +// IsPremiumCurrentlyUnavailable reports whether err is PREMIUM_CURRENTLY_UNAVAILABLE. +func IsPremiumCurrentlyUnavailable(err error) bool { + return tgerr.Is(err, ErrPremiumCurrentlyUnavailable) +} + // IsPremiumSubActiveUntil reports whether err is PREMIUM_SUB_ACTIVE_UNTIL. func IsPremiumSubActiveUntil(err error) bool { return tgerr.Is(err, ErrPremiumSubActiveUntil) @@ -2265,6 +2482,11 @@ func IsQueryTooShort(err error) bool { return tgerr.Is(err, ErrQueryTooShort) } +// IsQuickRepliesTooMuch reports whether err is QUICK_REPLIES_TOO_MUCH. +func IsQuickRepliesTooMuch(err error) bool { + return tgerr.Is(err, ErrQuickRepliesTooMuch) +} + // IsQuizAnswerMissing reports whether err is QUIZ_ANSWER_MISSING. func IsQuizAnswerMissing(err error) bool { return tgerr.Is(err, ErrQuizAnswerMissing) @@ -2290,6 +2512,16 @@ func IsQuizMultipleInvalid(err error) bool { return tgerr.Is(err, ErrQuizMultipleInvalid) } +// IsQuoteTextInvalid reports whether err is QUOTE_TEXT_INVALID. +func IsQuoteTextInvalid(err error) bool { + return tgerr.Is(err, ErrQuoteTextInvalid) +} + +// IsRaiseHandForbidden reports whether err is RAISE_HAND_FORBIDDEN. +func IsRaiseHandForbidden(err error) bool { + return tgerr.Is(err, ErrRaiseHandForbidden) +} + // IsRandomIDDuplicate reports whether err is RANDOM_ID_DUPLICATE. func IsRandomIDDuplicate(err error) bool { return tgerr.Is(err, ErrRandomIDDuplicate) @@ -2330,11 +2562,21 @@ func IsReactionInvalid(err error) bool { return tgerr.Is(err, ErrReactionInvalid) } +// IsReceiptEmpty reports whether err is RECEIPT_EMPTY. +func IsReceiptEmpty(err error) bool { + return tgerr.Is(err, ErrReceiptEmpty) +} + // IsReplyMarkupBuyEmpty reports whether err is REPLY_MARKUP_BUY_EMPTY. func IsReplyMarkupBuyEmpty(err error) bool { return tgerr.Is(err, ErrReplyMarkupBuyEmpty) } +// IsReplyMarkupGameEmpty reports whether err is REPLY_MARKUP_GAME_EMPTY. +func IsReplyMarkupGameEmpty(err error) bool { + return tgerr.Is(err, ErrReplyMarkupGameEmpty) +} + // IsReplyMarkupInvalid reports whether err is REPLY_MARKUP_INVALID. func IsReplyMarkupInvalid(err error) bool { return tgerr.Is(err, ErrReplyMarkupInvalid) @@ -2345,6 +2587,11 @@ func IsReplyMarkupTooLong(err error) bool { return tgerr.Is(err, ErrReplyMarkupTooLong) } +// IsReplyMessagesTooMuch reports whether err is REPLY_MESSAGES_TOO_MUCH. +func IsReplyMessagesTooMuch(err error) bool { + return tgerr.Is(err, ErrReplyMessagesTooMuch) +} + // IsReplyMessageIDInvalid reports whether err is REPLY_MESSAGE_ID_INVALID. func IsReplyMessageIDInvalid(err error) bool { return tgerr.Is(err, ErrReplyMessageIDInvalid) @@ -2360,6 +2607,11 @@ func IsReplyToUserInvalid(err error) bool { return tgerr.Is(err, ErrReplyToUserInvalid) } +// IsRequestTokenInvalid reports whether err is REQUEST_TOKEN_INVALID. +func IsRequestTokenInvalid(err error) bool { + return tgerr.Is(err, ErrRequestTokenInvalid) +} + // IsResetRequestMissing reports whether err is RESET_REQUEST_MISSING. func IsResetRequestMissing(err error) bool { return tgerr.Is(err, ErrResetRequestMissing) @@ -2405,6 +2657,16 @@ func IsRightForbidden(err error) bool { return tgerr.Is(err, ErrRightForbidden) } +// IsRingtoneInvalid reports whether err is RINGTONE_INVALID. +func IsRingtoneInvalid(err error) bool { + return tgerr.Is(err, ErrRingtoneInvalid) +} + +// IsRingtoneMimeInvalid reports whether err is RINGTONE_MIME_INVALID. +func IsRingtoneMimeInvalid(err error) bool { + return tgerr.Is(err, ErrRingtoneMimeInvalid) +} + // IsRsaDecryptFailed reports whether err is RSA_DECRYPT_FAILED. func IsRsaDecryptFailed(err error) bool { return tgerr.Is(err, ErrRsaDecryptFailed) @@ -2455,6 +2717,11 @@ func IsSecondsInvalid(err error) bool { return tgerr.Is(err, ErrSecondsInvalid) } +// IsSecureSecretRequired reports whether err is SECURE_SECRET_REQUIRED. +func IsSecureSecretRequired(err error) bool { + return tgerr.Is(err, ErrSecureSecretRequired) +} + // IsSendAsPeerInvalid reports whether err is SEND_AS_PEER_INVALID. func IsSendAsPeerInvalid(err error) bool { return tgerr.Is(err, ErrSendAsPeerInvalid) @@ -2500,6 +2767,11 @@ func IsSHA256HashInvalid(err error) bool { return tgerr.Is(err, ErrSHA256HashInvalid) } +// IsShortcutInvalid reports whether err is SHORTCUT_INVALID. +func IsShortcutInvalid(err error) bool { + return tgerr.Is(err, ErrShortcutInvalid) +} + // IsShortNameInvalid reports whether err is SHORT_NAME_INVALID. func IsShortNameInvalid(err error) bool { return tgerr.Is(err, ErrShortNameInvalid) @@ -2535,6 +2807,11 @@ func IsSlugInvalid(err error) bool { return tgerr.Is(err, ErrSlugInvalid) } +// IsSmsjobIDInvalid reports whether err is SMSJOB_ID_INVALID. +func IsSmsjobIDInvalid(err error) bool { + return tgerr.Is(err, ErrSmsjobIDInvalid) +} + // IsSMSCodeCreateFailed reports whether err is SMS_CODE_CREATE_FAILED. func IsSMSCodeCreateFailed(err error) bool { return tgerr.Is(err, ErrSMSCodeCreateFailed) @@ -2715,6 +2992,11 @@ func IsSwitchPmTextEmpty(err error) bool { return tgerr.Is(err, ErrSwitchPmTextEmpty) } +// IsSwitchWebviewURLInvalid reports whether err is SWITCH_WEBVIEW_URL_INVALID. +func IsSwitchWebviewURLInvalid(err error) bool { + return tgerr.Is(err, ErrSwitchWebviewURLInvalid) +} + // IsTakeoutInitDelay reports whether err is TAKEOUT_INIT_DELAY. func IsTakeoutInitDelay(err error) bool { return tgerr.Is(err, ErrTakeoutInitDelay) @@ -2770,6 +3052,11 @@ func IsThemeTitleInvalid(err error) bool { return tgerr.Is(err, ErrThemeTitleInvalid) } +// IsTimezoneInvalid reports whether err is TIMEZONE_INVALID. +func IsTimezoneInvalid(err error) bool { + return tgerr.Is(err, ErrTimezoneInvalid) +} + // IsTitleInvalid reports whether err is TITLE_INVALID. func IsTitleInvalid(err error) bool { return tgerr.Is(err, ErrTitleInvalid) @@ -2845,6 +3132,11 @@ func IsTranscriptionFailed(err error) bool { return tgerr.Is(err, ErrTranscriptionFailed) } +// IsTranslateReqQuotaExceeded reports whether err is TRANSLATE_REQ_QUOTA_EXCEEDED. +func IsTranslateReqQuotaExceeded(err error) bool { + return tgerr.Is(err, ErrTranslateReqQuotaExceeded) +} + // IsTTLDaysInvalid reports whether err is TTL_DAYS_INVALID. func IsTTLDaysInvalid(err error) bool { return tgerr.Is(err, ErrTTLDaysInvalid) @@ -2875,6 +3167,11 @@ func IsUntilDateInvalid(err error) bool { return tgerr.Is(err, ErrUntilDateInvalid) } +// IsUpdateAppToLogin reports whether err is UPDATE_APP_TO_LOGIN. +func IsUpdateAppToLogin(err error) bool { + return tgerr.Is(err, ErrUpdateAppToLogin) +} + // IsURLInvalid reports whether err is URL_INVALID. func IsURLInvalid(err error) bool { return tgerr.Is(err, ErrURLInvalid) @@ -3060,6 +3357,16 @@ func IsVideoFileInvalid(err error) bool { return tgerr.Is(err, ErrVideoFileInvalid) } +// IsVideoPauseForbidden reports whether err is VIDEO_PAUSE_FORBIDDEN. +func IsVideoPauseForbidden(err error) bool { + return tgerr.Is(err, ErrVideoPauseForbidden) +} + +// IsVideoStopForbidden reports whether err is VIDEO_STOP_FORBIDDEN. +func IsVideoStopForbidden(err error) bool { + return tgerr.Is(err, ErrVideoStopForbidden) +} + // IsVideoTitleEmpty reports whether err is VIDEO_TITLE_EMPTY. func IsVideoTitleEmpty(err error) bool { return tgerr.Is(err, ErrVideoTitleEmpty) @@ -3150,6 +3457,11 @@ func IsWebpushTokenInvalid(err error) bool { return tgerr.Is(err, ErrWebpushTokenInvalid) } +// IsYourPrivacyRestricted reports whether err is YOUR_PRIVACY_RESTRICTED. +func IsYourPrivacyRestricted(err error) bool { + return tgerr.Is(err, ErrYourPrivacyRestricted) +} + // IsYouBlockedUser reports whether err is YOU_BLOCKED_USER. func IsYouBlockedUser(err error) bool { return tgerr.Is(err, ErrYouBlockedUser) diff --git a/tg/tl_fact_check_gen.go b/tg/tl_fact_check_gen.go index 1e257d5793..697143e7d3 100644 --- a/tg/tl_fact_check_gen.go +++ b/tg/tl_fact_check_gen.go @@ -32,22 +32,39 @@ var ( ) // FactCheck represents TL type `factCheck#b89bfccf`. +// Represents a fact-check »¹ created by an independent fact-checker. +// +// Links: +// 1. https://core.telegram.org/api/factcheck // // See https://core.telegram.org/constructor/factCheck for reference. type FactCheck struct { - // Flags field of FactCheck. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // NeedCheck field of FactCheck. + // If set, the country/text fields will not be set, and the fact check must be fetched + // manually by the client (if it isn't already cached with the key specified in hash) + // using bundled messages.getFactCheck¹ requests, when the message with the factcheck + // scrolls into view. + // + // Links: + // 1) https://core.telegram.org/method/messages.getFactCheck NeedCheck bool - // Country field of FactCheck. + // A two-letter ISO 3166-1 alpha-2 country code of the country for which the fact-check + // should be shown. // // Use SetCountry and GetCountry helpers. Country string - // Text field of FactCheck. + // The fact-check. // // Use SetText and GetText helpers. Text TextWithEntities - // Hash field of FactCheck. + // Hash used for caching, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 } diff --git a/tg/tl_found_story_gen.go b/tg/tl_found_story_gen.go index 55b5dd601a..351e9b9b77 100644 --- a/tg/tl_found_story_gen.go +++ b/tg/tl_found_story_gen.go @@ -32,12 +32,16 @@ var ( ) // FoundStory represents TL type `foundStory#e87acbc0`. +// A story found using global story search »¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#searching-stories // // See https://core.telegram.org/constructor/foundStory for reference. type FoundStory struct { - // Peer field of FoundStory. + // The peer that posted the story. Peer PeerClass - // Story field of FoundStory. + // The story. Story StoryItemClass } diff --git a/tg/tl_fragment_collectible_info_gen.go b/tg/tl_fragment_collectible_info_gen.go index f522b41d8a..d6096889bd 100644 --- a/tg/tl_fragment_collectible_info_gen.go +++ b/tg/tl_fragment_collectible_info_gen.go @@ -32,20 +32,36 @@ var ( ) // FragmentCollectibleInfo represents TL type `fragment.collectibleInfo#6ebdff91`. +// Info about a fragment collectible¹. +// +// Links: +// 1. https://core.telegram.org/api/fragment // // See https://core.telegram.org/constructor/fragment.collectibleInfo for reference. type FragmentCollectibleInfo struct { - // PurchaseDate field of FragmentCollectibleInfo. + // Purchase date (unixtime) PurchaseDate int - // Currency field of FragmentCollectibleInfo. + // Three-letter ISO 4217 currency¹ code for amount + // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string - // Amount field of FragmentCollectibleInfo. + // Total price in the smallest units of the currency (integer, not float/double). For + // example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in + // currencies.json¹, it shows the number of digits past the decimal point for each + // currency (2 for the majority of currencies). + // + // Links: + // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 - // CryptoCurrency field of FragmentCollectibleInfo. + // Cryptocurrency name. CryptoCurrency string - // CryptoAmount field of FragmentCollectibleInfo. + // Price, in the smallest units of the cryptocurrency. CryptoAmount int64 - // URL field of FragmentCollectibleInfo. + // Fragment¹ URL with more info about the collectible + // + // Links: + // 1) https://fragment.com URL string } diff --git a/tg/tl_fragment_get_collectible_info_gen.go b/tg/tl_fragment_get_collectible_info_gen.go index c63bfc4d23..09501ee54e 100644 --- a/tg/tl_fragment_get_collectible_info_gen.go +++ b/tg/tl_fragment_get_collectible_info_gen.go @@ -32,10 +32,15 @@ var ( ) // FragmentGetCollectibleInfoRequest represents TL type `fragment.getCollectibleInfo#be1e85ba`. +// Fetch information about a fragment collectible, see here »¹ for more info on the +// full flow. +// +// Links: +// 1. https://core.telegram.org/api/fragment#fetching-info-about-fragment-collectibles // // See https://core.telegram.org/method/fragment.getCollectibleInfo for reference. type FragmentGetCollectibleInfoRequest struct { - // Collectible field of FragmentGetCollectibleInfoRequest. + // Collectible to fetch info about. Collectible InputCollectibleClass } @@ -166,6 +171,16 @@ func (g *FragmentGetCollectibleInfoRequest) GetCollectible() (value InputCollect } // FragmentGetCollectibleInfo invokes method fragment.getCollectibleInfo#be1e85ba returning error if any. +// Fetch information about a fragment collectible, see here »¹ for more info on the +// full flow. +// +// Links: +// 1. https://core.telegram.org/api/fragment#fetching-info-about-fragment-collectibles +// +// Possible errors: +// +// 400 COLLECTIBLE_INVALID: The specified collectible is invalid. +// 400 COLLECTIBLE_NOT_FOUND: The specified collectible could not be found. // // See https://core.telegram.org/method/fragment.getCollectibleInfo for reference. func (c *Client) FragmentGetCollectibleInfo(ctx context.Context, collectible InputCollectibleClass) (*FragmentCollectibleInfo, error) { diff --git a/tg/tl_geo_point_address_gen.go b/tg/tl_geo_point_address_gen.go index 0791798eda..0864b03069 100644 --- a/tg/tl_geo_point_address_gen.go +++ b/tg/tl_geo_point_address_gen.go @@ -32,22 +32,29 @@ var ( ) // GeoPointAddress represents TL type `geoPointAddress#de4c5d93`. +// Address optionally associated to a geoPoint¹. +// +// Links: +// 1. https://core.telegram.org/constructor/geoPoint // // See https://core.telegram.org/constructor/geoPointAddress for reference. type GeoPointAddress struct { - // Flags field of GeoPointAddress. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // CountryISO2 field of GeoPointAddress. + // Two-letter ISO 3166-1 alpha-2 country code CountryISO2 string - // State field of GeoPointAddress. + // State // // Use SetState and GetState helpers. State string - // City field of GeoPointAddress. + // City // // Use SetCity and GetCity helpers. City string - // Street field of GeoPointAddress. + // Street // // Use SetStreet and GetStreet helpers. Street string diff --git a/tg/tl_global_privacy_settings_gen.go b/tg/tl_global_privacy_settings_gen.go index 1dade26cf1..02af6be30f 100644 --- a/tg/tl_global_privacy_settings_gen.go +++ b/tg/tl_global_privacy_settings_gen.go @@ -53,9 +53,38 @@ type GlobalPrivacySettings struct { // Links: // 1) https://core.telegram.org/api/folders KeepArchivedFolders bool - // HideReadMarks field of GlobalPrivacySettings. + // If this flag is set, the inputPrivacyKeyStatusTimestamp¹ key will also apply to the + // ability to use messages.getOutboxReadDate² on messages sent to us. Meaning, users + // that cannot see our exact last online date due to the current value of the + // inputPrivacyKeyStatusTimestamp³ key will receive a 403 USER_PRIVACY_RESTRICTED error + // when invoking messages.getOutboxReadDate⁴ to fetch the exact read date of a message + // they sent to us. The userFull⁵.read_dates_private flag will be set for users that + // have this flag enabled. + // + // Links: + // 1) https://core.telegram.org/constructor/inputPrivacyKeyStatusTimestamp + // 2) https://core.telegram.org/method/messages.getOutboxReadDate + // 3) https://core.telegram.org/constructor/inputPrivacyKeyStatusTimestamp + // 4) https://core.telegram.org/method/messages.getOutboxReadDate + // 5) https://core.telegram.org/constructor/userFull HideReadMarks bool - // NewNoncontactPeersRequirePremium field of GlobalPrivacySettings. + // If set, only users that have a premium account, are in our contact list, or already + // have a private chat with us can write to us; a 403 PRIVACY_PREMIUM_REQUIRED error will + // be emitted otherwise. The userFull¹.contact_require_premium flag will be set for + // users that have this flag enabled. To check whether we can write to a user with this + // flag enabled, if we haven't yet cached all the required information (for example we + // don't have the userFull² or history of all users while displaying the chat list in + // the sharing UI) the users.getIsPremiumRequiredToContact³ method may be invoked, + // passing the list of users currently visible in the UI, returning a list of booleans + // that directly specify whether we can or cannot write to each user. Premium⁴ users + // only, non-Premium users will receive a PREMIUM_ACCOUNT_REQUIRED error when trying to + // enable this flag. + // + // Links: + // 1) https://core.telegram.org/constructor/userFull + // 2) https://core.telegram.org/constructor/userFull + // 3) https://core.telegram.org/method/users.getIsPremiumRequiredToContact + // 4) https://core.telegram.org/api/premium NewNoncontactPeersRequirePremium bool } diff --git a/tg/tl_help_app_config_gen.go b/tg/tl_help_app_config_gen.go index 3e5c188a82..9aa61020e7 100644 --- a/tg/tl_help_app_config_gen.go +++ b/tg/tl_help_app_config_gen.go @@ -141,7 +141,7 @@ func (a *HelpAppConfigNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/help.appConfig for reference. type HelpAppConfig struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_help_countries_list_gen.go b/tg/tl_help_countries_list_gen.go index ec5fe9120d..77d3d827b9 100644 --- a/tg/tl_help_countries_list_gen.go +++ b/tg/tl_help_countries_list_gen.go @@ -140,7 +140,7 @@ func (c *HelpCountriesListNotModified) DecodeBare(b *bin.Buffer) error { type HelpCountriesList struct { // Name, ISO code, localized name and phone codes/patterns of all available countries Countries []HelpCountry - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_help_edit_user_info_gen.go b/tg/tl_help_edit_user_info_gen.go index 008c9d03ea..78b36b033a 100644 --- a/tg/tl_help_edit_user_info_gen.go +++ b/tg/tl_help_edit_user_info_gen.go @@ -251,7 +251,7 @@ func (e *HelpEditUserInfoRequest) MapEntities() (value MessageEntityClassArray) // // Possible errors: // -// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. +// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. // 403 USER_INVALID: Invalid user provided. // // See https://core.telegram.org/method/help.editUserInfo for reference. diff --git a/tg/tl_help_get_app_config_gen.go b/tg/tl_help_get_app_config_gen.go index d1b7abfb6d..4ae7ab457c 100644 --- a/tg/tl_help_get_app_config_gen.go +++ b/tg/tl_help_get_app_config_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/help.getAppConfig for reference. type HelpGetAppConfigRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_help_get_countries_list_gen.go b/tg/tl_help_get_countries_list_gen.go index d04f2fb2c2..129922f9c8 100644 --- a/tg/tl_help_get_countries_list_gen.go +++ b/tg/tl_help_get_countries_list_gen.go @@ -38,7 +38,7 @@ var ( type HelpGetCountriesListRequest struct { // Language code of the current user LangCode string - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_help_get_passport_config_gen.go b/tg/tl_help_get_passport_config_gen.go index bfaada5491..10f0e0cb29 100644 --- a/tg/tl_help_get_passport_config_gen.go +++ b/tg/tl_help_get_passport_config_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/help.getPassportConfig for reference. type HelpGetPassportConfigRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_help_get_peer_colors_gen.go b/tg/tl_help_get_peer_colors_gen.go index d7138309ae..1350d50c10 100644 --- a/tg/tl_help_get_peer_colors_gen.go +++ b/tg/tl_help_get_peer_colors_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/help.getPeerColors for reference. type HelpGetPeerColorsRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_help_get_peer_profile_colors_gen.go b/tg/tl_help_get_peer_profile_colors_gen.go index 13ea44dc03..a8f27b3baa 100644 --- a/tg/tl_help_get_peer_profile_colors_gen.go +++ b/tg/tl_help_get_peer_profile_colors_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/help.getPeerProfileColors for reference. type HelpGetPeerProfileColorsRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_help_get_timezones_list_gen.go b/tg/tl_help_get_timezones_list_gen.go index e132ecdcd0..180cb107f2 100644 --- a/tg/tl_help_get_timezones_list_gen.go +++ b/tg/tl_help_get_timezones_list_gen.go @@ -32,10 +32,18 @@ var ( ) // HelpGetTimezonesListRequest represents TL type `help.getTimezonesList#49b30240`. +// Returns timezone information that may be used elsewhere in the API, such as to set +// Telegram Business opening hours »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#opening-hours // // See https://core.telegram.org/method/help.getTimezonesList for reference. type HelpGetTimezonesListRequest struct { - // Hash field of HelpGetTimezonesListRequest. + // Hash used for caching, for more info click here¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int } @@ -161,6 +169,11 @@ func (g *HelpGetTimezonesListRequest) GetHash() (value int) { } // HelpGetTimezonesList invokes method help.getTimezonesList#49b30240 returning error if any. +// Returns timezone information that may be used elsewhere in the API, such as to set +// Telegram Business opening hours »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#opening-hours // // See https://core.telegram.org/method/help.getTimezonesList for reference. func (c *Client) HelpGetTimezonesList(ctx context.Context, hash int) (HelpTimezonesListClass, error) { diff --git a/tg/tl_help_passport_config_gen.go b/tg/tl_help_passport_config_gen.go index a521106fd9..c6a8f4da10 100644 --- a/tg/tl_help_passport_config_gen.go +++ b/tg/tl_help_passport_config_gen.go @@ -141,7 +141,7 @@ func (p *HelpPassportConfigNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/help.passportConfig for reference. type HelpPassportConfig struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_help_peer_color_option_gen.go b/tg/tl_help_peer_color_option_gen.go index bb588925fb..6e940c17c2 100644 --- a/tg/tl_help_peer_color_option_gen.go +++ b/tg/tl_help_peer_color_option_gen.go @@ -51,7 +51,11 @@ type HelpPeerColorOption struct { ColorID int // Light mode palette. Will be empty for IDs 0 to 6 inclusive, in which case a palette // containing a single color from the following colors should be used: red, orange, - // violet, green, cyan, blue, pink for indexes 0 to 6. + // violet, green, cyan, blue, pink for indexes 0 to 6 (i.e. the same colors used for + // randomized fallback message accent colors¹). + // + // Links: + // 1) https://core.telegram.org/api/colors // // Use SetColors and GetColors helpers. Colors HelpPeerColorSetClass @@ -68,7 +72,11 @@ type HelpPeerColorOption struct { // // Use SetChannelMinLevel and GetChannelMinLevel helpers. ChannelMinLevel int - // GroupMinLevel field of HelpPeerColorOption. + // Supergroups can use this palette only after reaching at least the boost level¹ + // specified in this field. + // + // Links: + // 1) https://core.telegram.org/api/boost // // Use SetGroupMinLevel and GetGroupMinLevel helpers. GroupMinLevel int diff --git a/tg/tl_help_peer_colors_gen.go b/tg/tl_help_peer_colors_gen.go index 9946c7a19a..b841208306 100644 --- a/tg/tl_help_peer_colors_gen.go +++ b/tg/tl_help_peer_colors_gen.go @@ -141,7 +141,7 @@ func (p *HelpPeerColorsNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/help.peerColors for reference. type HelpPeerColors struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_help_set_bot_updates_status_gen.go b/tg/tl_help_set_bot_updates_status_gen.go index 003282a050..815ea3c277 100644 --- a/tg/tl_help_set_bot_updates_status_gen.go +++ b/tg/tl_help_set_bot_updates_status_gen.go @@ -193,6 +193,10 @@ func (s *HelpSetBotUpdatesStatusRequest) GetMessage() (value string) { // Informs the server about the number of pending bot updates if they haven't been // processed for a long time; for bots only // +// Possible errors: +// +// 400 USER_BOT_REQUIRED: This method can only be called by a bot. +// // See https://core.telegram.org/method/help.setBotUpdatesStatus for reference. // Can be used by bots. func (c *Client) HelpSetBotUpdatesStatus(ctx context.Context, request *HelpSetBotUpdatesStatusRequest) (bool, error) { diff --git a/tg/tl_help_timezones_list_gen.go b/tg/tl_help_timezones_list_gen.go index 0ccc7deb63..39bf7e426d 100644 --- a/tg/tl_help_timezones_list_gen.go +++ b/tg/tl_help_timezones_list_gen.go @@ -32,6 +32,7 @@ var ( ) // HelpTimezonesListNotModified represents TL type `help.timezonesListNotModified#970708cc`. +// The timezone list has not changed. // // See https://core.telegram.org/constructor/help.timezonesListNotModified for reference. type HelpTimezonesListNotModified struct { @@ -133,12 +134,20 @@ func (t *HelpTimezonesListNotModified) DecodeBare(b *bin.Buffer) error { } // HelpTimezonesList represents TL type `help.timezonesList#7b74ed71`. +// Timezone information that may be used elsewhere in the API, such as to set Telegram +// Business opening hours »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#opening-hours // // See https://core.telegram.org/constructor/help.timezonesList for reference. type HelpTimezonesList struct { - // Timezones field of HelpTimezonesList. + // Timezones Timezones []Timezone - // Hash field of HelpTimezonesList. + // Hash used for caching, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int } diff --git a/tg/tl_init_connection_gen.go b/tg/tl_init_connection_gen.go index e0030496b9..ccd6d3c607 100644 --- a/tg/tl_init_connection_gen.go +++ b/tg/tl_init_connection_gen.go @@ -54,16 +54,20 @@ type InitConnectionRequest struct { AppVersion string // Code for the language used on the device's OS, ISO 639-1 standard SystemLangCode string - // Language pack to use + // Platform identifier (i.e. android, tdesktop, etc). LangPack string - // Code for the language used on the client, ISO 639-1 standard + // Either an ISO 639-1 language code or a language pack name obtained from a language + // pack link¹. + // + // Links: + // 1) https://core.telegram.org/api/links#language-pack-links LangCode string // Info about an MTProto proxy // // Use SetProxy and GetProxy helpers. Proxy InputClientProxy // Additional initConnection parameters. For now, only the tz_offset field is supported, - // for specifying timezone offset in seconds. + // for specifying the timezone offset in seconds. // // Use SetParams and GetParams helpers. Params JSONValueClass diff --git a/tg/tl_input_business_away_message_gen.go b/tg/tl_input_business_away_message_gen.go index 19a406449e..2fd7c97ba3 100644 --- a/tg/tl_input_business_away_message_gen.go +++ b/tg/tl_input_business_away_message_gen.go @@ -32,18 +32,31 @@ var ( ) // InputBusinessAwayMessage represents TL type `inputBusinessAwayMessage#832175e0`. +// Describes a Telegram Business away message¹, automatically sent to users writing to +// us when we're offline, during closing hours, while we're on vacation, or in some other +// custom time period when we cannot immediately answer to the user. +// +// Links: +// 1. https://core.telegram.org/api/business#away-messages // // See https://core.telegram.org/constructor/inputBusinessAwayMessage for reference. type InputBusinessAwayMessage struct { - // Flags field of InputBusinessAwayMessage. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // OfflineOnly field of InputBusinessAwayMessage. + // If set, the messages will not be sent if the account was online in the last 10 minutes. OfflineOnly bool - // ShortcutID field of InputBusinessAwayMessage. + // ID of a quick reply shorcut, containing the away messages to send, see here » for + // more info¹. + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts ShortcutID int - // Schedule field of InputBusinessAwayMessage. + // Specifies when should the away messages be sent. Schedule BusinessAwayMessageScheduleClass - // Recipients field of InputBusinessAwayMessage. + // Allowed recipients for the away messages. Recipients InputBusinessRecipients } diff --git a/tg/tl_input_business_bot_recipients_gen.go b/tg/tl_input_business_bot_recipients_gen.go index 99e11763ef..1c13f6967f 100644 --- a/tg/tl_input_business_bot_recipients_gen.go +++ b/tg/tl_input_business_bot_recipients_gen.go @@ -32,26 +32,35 @@ var ( ) // InputBusinessBotRecipients represents TL type `inputBusinessBotRecipients#c4e5921e`. +// Specifies the private chats that a connected business bot »¹ may interact with. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots // // See https://core.telegram.org/constructor/inputBusinessBotRecipients for reference. type InputBusinessBotRecipients struct { - // Flags field of InputBusinessBotRecipients. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ExistingChats field of InputBusinessBotRecipients. + // Selects all existing private chats. ExistingChats bool - // NewChats field of InputBusinessBotRecipients. + // Selects all new private chats. NewChats bool - // Contacts field of InputBusinessBotRecipients. + // Selects all private chats with contacts. Contacts bool - // NonContacts field of InputBusinessBotRecipients. + // Selects all private chats with non-contacts. NonContacts bool - // ExcludeSelected field of InputBusinessBotRecipients. + // If set, then all private chats except the ones selected by existing_chats, new_chats, + // contacts, non_contacts and users are chosen. Note that if this flag is set, any values + // passed in exclude_users will be merged and moved into users by the server. ExcludeSelected bool - // Users field of InputBusinessBotRecipients. + // Explicitly selected private chats. // // Use SetUsers and GetUsers helpers. Users []InputUserClass - // ExcludeUsers field of InputBusinessBotRecipients. + // Identifiers of private chats that are always excluded. // // Use SetExcludeUsers and GetExcludeUsers helpers. ExcludeUsers []InputUserClass diff --git a/tg/tl_input_business_chat_link_gen.go b/tg/tl_input_business_chat_link_gen.go index 7b504f6d77..c36c7fc9f5 100644 --- a/tg/tl_input_business_chat_link_gen.go +++ b/tg/tl_input_business_chat_link_gen.go @@ -32,18 +32,30 @@ var ( ) // InputBusinessChatLink represents TL type `inputBusinessChatLink#11679fa7`. +// Contains info about a business chat deep link »¹ to be created by the current +// account. +// +// Links: +// 1. https://core.telegram.org/api/business#business-chat-links // // See https://core.telegram.org/constructor/inputBusinessChatLink for reference. type InputBusinessChatLink struct { - // Flags field of InputBusinessChatLink. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Message field of InputBusinessChatLink. + // Message to pre-fill in the message input field. Message string - // Entities field of InputBusinessChatLink. + // Message entities for styled text¹ + // + // Links: + // 1) https://core.telegram.org/api/entities // // Use SetEntities and GetEntities helpers. Entities []MessageEntityClass - // Title field of InputBusinessChatLink. + // Human-readable name of the link, to simplify management in the UI (only visible to the + // creator of the link). // // Use SetTitle and GetTitle helpers. Title string diff --git a/tg/tl_input_business_greeting_message_gen.go b/tg/tl_input_business_greeting_message_gen.go index 3ffbfd411c..7c383c5fff 100644 --- a/tg/tl_input_business_greeting_message_gen.go +++ b/tg/tl_input_business_greeting_message_gen.go @@ -32,14 +32,24 @@ var ( ) // InputBusinessGreetingMessage represents TL type `inputBusinessGreetingMessage#194cb3b`. +// Describes a Telegram Business greeting¹, automatically sent to new users writing to +// us in private for the first time, or after a certain inactivity period. +// +// Links: +// 1. https://core.telegram.org/api/business#greeting-messages // // See https://core.telegram.org/constructor/inputBusinessGreetingMessage for reference. type InputBusinessGreetingMessage struct { - // ShortcutID field of InputBusinessGreetingMessage. + // ID of a quick reply shorcut, containing the greeting messages to send, see here » for + // more info¹. + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts ShortcutID int - // Recipients field of InputBusinessGreetingMessage. + // Allowed recipients for the greeting messages. Recipients InputBusinessRecipients - // NoActivityDays field of InputBusinessGreetingMessage. + // The number of days after which a private chat will be considered as inactive; + // currently, must be one of 7, 14, 21, or 28. NoActivityDays int } diff --git a/tg/tl_input_business_intro_gen.go b/tg/tl_input_business_intro_gen.go index 2da7045b14..1846b9448c 100644 --- a/tg/tl_input_business_intro_gen.go +++ b/tg/tl_input_business_intro_gen.go @@ -32,16 +32,26 @@ var ( ) // InputBusinessIntro represents TL type `inputBusinessIntro#9c469cd`. +// Telegram Business introduction »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#business-introduction // // See https://core.telegram.org/constructor/inputBusinessIntro for reference. type InputBusinessIntro struct { - // Flags field of InputBusinessIntro. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Title field of InputBusinessIntro. + // Title of the introduction message Title string - // Description field of InputBusinessIntro. + // Profile introduction Description string - // Sticker field of InputBusinessIntro. + // Optional introduction sticker¹. + // + // Links: + // 1) https://core.telegram.org/api/stickers // // Use SetSticker and GetSticker helpers. Sticker InputDocumentClass diff --git a/tg/tl_input_business_recipients_gen.go b/tg/tl_input_business_recipients_gen.go index d45849c63b..94fff2d2cd 100644 --- a/tg/tl_input_business_recipients_gen.go +++ b/tg/tl_input_business_recipients_gen.go @@ -32,22 +32,35 @@ var ( ) // InputBusinessRecipients represents TL type `inputBusinessRecipients#6f8b32aa`. +// Specifies the chats that can receive Telegram Business away »¹ and greeting »² +// messages. +// If exclude_selected is set, specifies all chats that cannot receive Telegram Business +// away »¹ and greeting »² messages. +// +// Links: +// 1. https://core.telegram.org/api/business#away-messages +// 2. https://core.telegram.org/api/business#greeting-messages +// 3. https://core.telegram.org/api/business#away-messages +// 4. https://core.telegram.org/api/business#greeting-messages // // See https://core.telegram.org/constructor/inputBusinessRecipients for reference. type InputBusinessRecipients struct { - // Flags field of InputBusinessRecipients. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ExistingChats field of InputBusinessRecipients. + // All existing private chats. ExistingChats bool - // NewChats field of InputBusinessRecipients. + // All new private chats. NewChats bool - // Contacts field of InputBusinessRecipients. + // All private chats with contacts. Contacts bool - // NonContacts field of InputBusinessRecipients. + // All private chats with non-contacts. NonContacts bool - // ExcludeSelected field of InputBusinessRecipients. + // If set, inverts the selection. ExcludeSelected bool - // Users field of InputBusinessRecipients. + // Only private chats with the specified users. // // Use SetUsers and GetUsers helpers. Users []InputUserClass diff --git a/tg/tl_input_collectible_gen.go b/tg/tl_input_collectible_gen.go index 938c369f55..6849ee2017 100644 --- a/tg/tl_input_collectible_gen.go +++ b/tg/tl_input_collectible_gen.go @@ -32,10 +32,14 @@ var ( ) // InputCollectibleUsername represents TL type `inputCollectibleUsername#e39460a9`. +// Represents a username fragment collectible¹ +// +// Links: +// 1. https://core.telegram.org/api/fragment // // See https://core.telegram.org/constructor/inputCollectibleUsername for reference. type InputCollectibleUsername struct { - // Username field of InputCollectibleUsername. + // Username Username string } @@ -166,10 +170,14 @@ func (i *InputCollectibleUsername) GetUsername() (value string) { } // InputCollectiblePhone represents TL type `inputCollectiblePhone#a2e214a4`. +// Represents a phone number fragment collectible¹ +// +// Links: +// 1. https://core.telegram.org/api/fragment // // See https://core.telegram.org/constructor/inputCollectiblePhone for reference. type InputCollectiblePhone struct { - // Phone field of InputCollectiblePhone. + // Phone number Phone string } diff --git a/tg/tl_input_file_gen.go b/tg/tl_input_file_gen.go index 225dad7d10..e11e81e578 100644 --- a/tg/tl_input_file_gen.go +++ b/tg/tl_input_file_gen.go @@ -448,10 +448,15 @@ func (i *InputFileBig) GetName() (value string) { } // InputFileStoryDocument represents TL type `inputFileStoryDocument#62dc8b48`. +// Used to edit the thumbnail/static preview of a story, see here »¹ for more info on +// the full flow. +// +// Links: +// 1. https://core.telegram.org/api/stories#editing-stories // // See https://core.telegram.org/constructor/inputFileStoryDocument for reference. type InputFileStoryDocument struct { - // ID field of InputFileStoryDocument. + // The old story video. ID InputDocumentClass } diff --git a/tg/tl_input_invoice_gen.go b/tg/tl_input_invoice_gen.go index 3cc4bf570d..db48d094fb 100644 --- a/tg/tl_input_invoice_gen.go +++ b/tg/tl_input_invoice_gen.go @@ -32,14 +32,15 @@ var ( ) // InputInvoiceMessage represents TL type `inputInvoiceMessage#c5b56859`. -// An invoice contained in a messageMediaInvoice¹ message. +// An invoice contained in a messageMediaInvoice¹ message or paid media »². // // Links: // 1. https://core.telegram.org/constructor/messageMediaInvoice +// 2. https://core.telegram.org/api/paid-media // // See https://core.telegram.org/constructor/inputInvoiceMessage for reference. type InputInvoiceMessage struct { - // Chat where the invoice was sent + // Chat where the invoice/paid media was sent Peer InputPeerClass // Message ID MsgID int @@ -342,8 +343,8 @@ func (i *InputInvoiceSlug) GetSlug() (value string) { } // InputInvoicePremiumGiftCode represents TL type `inputInvoicePremiumGiftCode#98986c0d`. -// Used if the user wishes to start a channel giveaway¹ or send some giftcodes² to -// members of a channel, in exchange for boosts³. +// Used if the user wishes to start a channel/supergroup giveaway¹ or send some +// giftcodes² to members of a channel/supergroup, in exchange for boosts³. // // Links: // 1. https://core.telegram.org/api/giveaways @@ -527,10 +528,19 @@ func (i *InputInvoicePremiumGiftCode) GetOption() (value PremiumGiftCodeOption) } // InputInvoiceStars represents TL type `inputInvoiceStars#65f00ce3`. +// Used to top up the Telegram Stars¹ balance of the current account or someone else's +// account. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/inputInvoiceStars for reference. type InputInvoiceStars struct { - // Purpose field of InputInvoiceStars. + // Either an inputStorePaymentStarsTopup¹ or an inputStorePaymentStarsGift². + // + // Links: + // 1) https://core.telegram.org/constructor/inputStorePaymentStarsTopup + // 2) https://core.telegram.org/constructor/inputStorePaymentStarsGift Purpose InputStorePaymentPurposeClass } diff --git a/tg/tl_input_media_gen.go b/tg/tl_input_media_gen.go index 107c4c9f49..2ace6f9643 100644 --- a/tg/tl_input_media_gen.go +++ b/tg/tl_input_media_gen.go @@ -2812,7 +2812,7 @@ type InputMediaInvoice struct { // // Use SetStartParam and GetStartParam helpers. StartParam string - // Extended media + // Deprecated // // Use SetExtendedMedia and GetExtendedMedia helpers. ExtendedMedia InputMediaClass @@ -4504,14 +4504,21 @@ func (i *InputMediaWebPage) GetURL() (value string) { } // InputMediaPaidMedia represents TL type `inputMediaPaidMedia#c4103386`. +// Paid media, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/paid-media // // See https://core.telegram.org/constructor/inputMediaPaidMedia for reference. type InputMediaPaidMedia struct { // Flags field of InputMediaPaidMedia. Flags bin.Fields - // StarsAmount field of InputMediaPaidMedia. + // The price of the media in Telegram Stars¹. + // + // Links: + // 1) https://core.telegram.org/api/stars StarsAmount int64 - // ExtendedMedia field of InputMediaPaidMedia. + // Photos or videos. ExtendedMedia []InputMediaClass // Payload field of InputMediaPaidMedia. // diff --git a/tg/tl_input_privacy_key_gen.go b/tg/tl_input_privacy_key_gen.go index d82f66b616..9c88ee8d24 100644 --- a/tg/tl_input_privacy_key_gen.go +++ b/tg/tl_input_privacy_key_gen.go @@ -32,7 +32,20 @@ var ( ) // InputPrivacyKeyStatusTimestamp represents TL type `inputPrivacyKeyStatusTimestamp#4f96cb18`. -// Whether people will be able to see your exact last online timestamp +// Whether people will be able to see our exact last online timestamp. +// Note that if we decide to hide our exact last online timestamp to someone (i.e., users +// A, B, C, or all users) and we do not have a Premium¹ subscription, we won't be able +// to see the exact last online timestamp of those users (A, B, C, or all users), even if +// those users do share it with us. +// If those users do share their exact online status with us, but we can't see it due to +// the reason mentioned above, the by_me flag of userStatusRecently¹, +// userStatusLastWeek², userStatusLastMonth³ will be set. +// +// Links: +// 1. https://core.telegram.org/api/premium +// 2. https://core.telegram.org/constructor/userStatusRecently +// 3. https://core.telegram.org/constructor/userStatusLastWeek +// 4. https://core.telegram.org/constructor/userStatusLastMonth // // See https://core.telegram.org/constructor/inputPrivacyKeyStatusTimestamp for reference. type InputPrivacyKeyStatusTimestamp struct { @@ -851,7 +864,10 @@ func (i *InputPrivacyKeyAddedByPhone) DecodeBare(b *bin.Buffer) error { } // InputPrivacyKeyVoiceMessages represents TL type `inputPrivacyKeyVoiceMessages#aee69d68`. -// Whether people can send you voice messages +// Whether people can send you voice messages or round videos (Premium¹ users only). +// +// Links: +// 1. https://core.telegram.org/api/premium // // See https://core.telegram.org/constructor/inputPrivacyKeyVoiceMessages for reference. type InputPrivacyKeyVoiceMessages struct { @@ -1055,6 +1071,7 @@ func (i *InputPrivacyKeyAbout) DecodeBare(b *bin.Buffer) error { } // InputPrivacyKeyBirthday represents TL type `inputPrivacyKeyBirthday#d65a11cc`. +// Whether the user can see our birthday. // // See https://core.telegram.org/constructor/inputPrivacyKeyBirthday for reference. type InputPrivacyKeyBirthday struct { diff --git a/tg/tl_input_privacy_rule_gen.go b/tg/tl_input_privacy_rule_gen.go index 05b78baa1b..a63d7fb2e3 100644 --- a/tg/tl_input_privacy_rule_gen.go +++ b/tg/tl_input_privacy_rule_gen.go @@ -1157,6 +1157,12 @@ func (i *InputPrivacyValueAllowCloseFriends) DecodeBare(b *bin.Buffer) error { } // InputPrivacyValueAllowPremium represents TL type `inputPrivacyValueAllowPremium#77cdc9f1`. +// Allow only users with a Premium subscription »¹, currently only usable for +// inputPrivacyKeyChatInvite². +// +// Links: +// 1. https://core.telegram.org/api/premium +// 2. https://core.telegram.org/constructor/inputPrivacyKeyChatInvite // // See https://core.telegram.org/constructor/inputPrivacyValueAllowPremium for reference. type InputPrivacyValueAllowPremium struct { diff --git a/tg/tl_input_quick_reply_shortcut_gen.go b/tg/tl_input_quick_reply_shortcut_gen.go index 9b5ca13df3..cc0eccd056 100644 --- a/tg/tl_input_quick_reply_shortcut_gen.go +++ b/tg/tl_input_quick_reply_shortcut_gen.go @@ -32,10 +32,14 @@ var ( ) // InputQuickReplyShortcut represents TL type `inputQuickReplyShortcut#24596d41`. +// Selects a quick reply shortcut¹ by name. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/constructor/inputQuickReplyShortcut for reference. type InputQuickReplyShortcut struct { - // Shortcut field of InputQuickReplyShortcut. + // Shortcut name. Shortcut string } @@ -166,10 +170,14 @@ func (i *InputQuickReplyShortcut) GetShortcut() (value string) { } // InputQuickReplyShortcutID represents TL type `inputQuickReplyShortcutId#1190cf1`. +// Selects a quick reply shortcut¹ by its numeric ID. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/constructor/inputQuickReplyShortcutId for reference. type InputQuickReplyShortcutID struct { - // ShortcutID field of InputQuickReplyShortcutID. + // Shortcut ID. ShortcutID int } diff --git a/tg/tl_input_reply_to_gen.go b/tg/tl_input_reply_to_gen.go index 7b93ba4eaa..31c15a4282 100644 --- a/tg/tl_input_reply_to_gen.go +++ b/tg/tl_input_reply_to_gen.go @@ -478,7 +478,7 @@ func (i *InputReplyToMessage) MapQuoteEntities() (value MessageEntityClassArray, // // See https://core.telegram.org/constructor/inputReplyToStory for reference. type InputReplyToStory struct { - // Peer field of InputReplyToStory. + // Sender of the story Peer InputPeerClass // ID of the story to reply to. StoryID int diff --git a/tg/tl_input_stars_transaction_gen.go b/tg/tl_input_stars_transaction_gen.go index 3a90790710..bfc2c941b8 100644 --- a/tg/tl_input_stars_transaction_gen.go +++ b/tg/tl_input_stars_transaction_gen.go @@ -32,14 +32,21 @@ var ( ) // InputStarsTransaction represents TL type `inputStarsTransaction#206ae6d1`. +// Used to fetch info about a Telegram Star transaction »¹. +// +// Links: +// 1. https://core.telegram.org/api/stars#balance-and-transaction-history // // See https://core.telegram.org/constructor/inputStarsTransaction for reference. type InputStarsTransaction struct { - // Flags field of InputStarsTransaction. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Refund field of InputStarsTransaction. + // If set, fetches info about the refund transaction for this transaction. Refund bool - // ID field of InputStarsTransaction. + // Transaction ID. ID string } diff --git a/tg/tl_input_store_payment_purpose_gen.go b/tg/tl_input_store_payment_purpose_gen.go index f255b5177e..3237790472 100644 --- a/tg/tl_input_store_payment_purpose_gen.go +++ b/tg/tl_input_store_payment_purpose_gen.go @@ -436,7 +436,8 @@ func (i *InputStorePaymentGiftPremium) GetAmount() (value int64) { // InputStorePaymentPremiumGiftCode represents TL type `inputStorePaymentPremiumGiftCode#a3805f3f`. // Used to gift Telegram Premium¹ subscriptions only to some specific subscribers of a -// channel or to some of our contacts, see here »² for more info on giveaways and gifts. +// channel/supergroup or to some of our contacts, see here »² for more info on +// giveaways and gifts. // // Links: // 1. https://core.telegram.org/api/premium @@ -454,10 +455,10 @@ type InputStorePaymentPremiumGiftCode struct { // Links: // 1) https://core.telegram.org/api/premium Users []InputUserClass - // If set, the gifts will be sent on behalf of a channel we are an admin of, which will - // also assign some boosts¹ to it. Otherwise, the gift will be sent directly from the - // currently logged in users, and we will gain some extra boost slots². See here »³ - // for more info on giveaways and gifts. + // If set, the gifts will be sent on behalf of a channel/supergroup we are an admin of, + // which will also assign some boosts¹ to it. Otherwise, the gift will be sent directly + // from the currently logged in user, and we will gain some extra boost slots². See here + // »³ for more info on giveaways and gifts. // // Links: // 1) https://core.telegram.org/api/boost @@ -768,8 +769,8 @@ type InputStorePaymentPremiumGiveaway struct { // Links: // 1) https://core.telegram.org/constructor/messageMediaGiveawayResults WinnersAreVisible bool - // The channel starting the giveaway, that the user must join to participate, that will - // receive the giveaway boosts¹; see here »² for more info on giveaways. + // The channel/supergroup starting the giveaway, that the user must join to participate, + // that will receive the giveaway boosts¹; see here »² for more info on giveaways. // // Links: // 1) https://core.telegram.org/api/boost @@ -1302,14 +1303,27 @@ func (i *InputStorePaymentPremiumGiveaway) MapAdditionalPeers() (value InputPeer } // InputStorePaymentStarsTopup represents TL type `inputStorePaymentStarsTopup#dddd0f56`. +// Used to top up the Telegram Stars balance¹ of the current account. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/inputStorePaymentStarsTopup for reference. type InputStorePaymentStarsTopup struct { - // Stars field of InputStorePaymentStarsTopup. + // Amount of stars to topup Stars int64 - // Currency field of InputStorePaymentStarsTopup. + // Three-letter ISO 4217 currency¹ code + // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string - // Amount field of InputStorePaymentStarsTopup. + // Total price in the smallest units of the currency (integer, not float/double). For + // example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in + // currencies.json¹, it shows the number of digits past the decimal point for each + // currency (2 for the majority of currencies). + // + // Links: + // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 } @@ -1490,16 +1504,29 @@ func (i *InputStorePaymentStarsTopup) GetAmount() (value int64) { } // InputStorePaymentStarsGift represents TL type `inputStorePaymentStarsGift#1d741ef7`. +// Used to gift Telegram Stars¹ to a friend. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/inputStorePaymentStarsGift for reference. type InputStorePaymentStarsGift struct { - // UserID field of InputStorePaymentStarsGift. + // The user to which the stars should be gifted. UserID InputUserClass - // Stars field of InputStorePaymentStarsGift. + // Amount of stars to gift Stars int64 - // Currency field of InputStorePaymentStarsGift. + // Three-letter ISO 4217 currency¹ code + // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string - // Amount field of InputStorePaymentStarsGift. + // Total price in the smallest units of the currency (integer, not float/double). For + // example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in + // currencies.json¹, it shows the number of digits past the decimal point for each + // currency (2 for the majority of currencies). + // + // Links: + // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 } diff --git a/tg/tl_invoice_gen.go b/tg/tl_invoice_gen.go index dde26487fa..99967e9cbc 100644 --- a/tg/tl_invoice_gen.go +++ b/tg/tl_invoice_gen.go @@ -59,10 +59,11 @@ type Invoice struct { EmailToProvider bool // Whether this is a recurring payment Recurring bool - // Three-letter ISO 4217 currency¹ code + // Three-letter ISO 4217 currency¹ code, or XTR for Telegram Stars². // // Links: // 1) https://core.telegram.org/bots/payments#supported-currencies + // 2) https://core.telegram.org/api/stars Currency string // Price breakdown, a list of components (e.g. product price, tax, discount, delivery // cost, delivery tax, bonus, etc.) diff --git a/tg/tl_invoke_with_apns_secret_gen.go b/tg/tl_invoke_with_apns_secret_gen.go index 81df10170c..c84a93bd19 100644 --- a/tg/tl_invoke_with_apns_secret_gen.go +++ b/tg/tl_invoke_with_apns_secret_gen.go @@ -32,14 +32,15 @@ var ( ) // InvokeWithApnsSecretRequest represents TL type `invokeWithApnsSecret#dae54f8`. +// Official clients only, invoke with Apple push verification. // // See https://core.telegram.org/constructor/invokeWithApnsSecret for reference. type InvokeWithApnsSecretRequest struct { - // Nonce field of InvokeWithApnsSecretRequest. + // Nonce. Nonce string - // Secret field of InvokeWithApnsSecretRequest. + // Secret. Secret string - // Query field of InvokeWithApnsSecretRequest. + // Query. Query bin.Object } diff --git a/tg/tl_invoke_with_business_connection_gen.go b/tg/tl_invoke_with_business_connection_gen.go index 6741f45603..c85475d7a9 100644 --- a/tg/tl_invoke_with_business_connection_gen.go +++ b/tg/tl_invoke_with_business_connection_gen.go @@ -32,12 +32,21 @@ var ( ) // InvokeWithBusinessConnectionRequest represents TL type `invokeWithBusinessConnection#dd289f8e`. +// Invoke a method using a Telegram Business Bot connection, see here » for more info, +// including a list of the methods that can be wrapped in this constructor¹. +// Make sure to always send queries wrapped in a invokeWithBusinessConnection to the +// datacenter ID, specified in the dc_id field of the botBusinessConnection¹ that is +// being used. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots +// 2. https://core.telegram.org/constructor/botBusinessConnection // // See https://core.telegram.org/constructor/invokeWithBusinessConnection for reference. type InvokeWithBusinessConnectionRequest struct { - // ConnectionID field of InvokeWithBusinessConnectionRequest. + // Business connection ID. ConnectionID string - // Query field of InvokeWithBusinessConnectionRequest. + // The actual query. Query bin.Object } diff --git a/tg/tl_invoke_with_google_play_integrity_gen.go b/tg/tl_invoke_with_google_play_integrity_gen.go index b2a28b27ef..2fe76d87e4 100644 --- a/tg/tl_invoke_with_google_play_integrity_gen.go +++ b/tg/tl_invoke_with_google_play_integrity_gen.go @@ -32,14 +32,15 @@ var ( ) // InvokeWithGooglePlayIntegrityRequest represents TL type `invokeWithGooglePlayIntegrity#1df92984`. +// Official clients only, invoke with Google Play Integrity token. // // See https://core.telegram.org/constructor/invokeWithGooglePlayIntegrity for reference. type InvokeWithGooglePlayIntegrityRequest struct { - // Nonce field of InvokeWithGooglePlayIntegrityRequest. + // Nonce. Nonce string - // Token field of InvokeWithGooglePlayIntegrityRequest. + // Token. Token string - // Query field of InvokeWithGooglePlayIntegrityRequest. + // Query. Query bin.Object } diff --git a/tg/tl_keyboard_button_gen.go b/tg/tl_keyboard_button_gen.go index 2634aef4c8..1e57a4c1c8 100644 --- a/tg/tl_keyboard_button_gen.go +++ b/tg/tl_keyboard_button_gen.go @@ -2898,7 +2898,7 @@ type KeyboardButtonRequestPeer struct { // option for the user to create and immediately use one or more (up to max_quantity) // peers of the specified type, if needed. PeerType RequestPeerTypeClass - // Maximum number of peers that can be chosne. + // Maximum number of peers that can be chosen. MaxQuantity int } @@ -3109,24 +3109,38 @@ func (k *KeyboardButtonRequestPeer) GetMaxQuantity() (value int) { } // InputKeyboardButtonRequestPeer represents TL type `inputKeyboardButtonRequestPeer#c9662d05`. +// Prompts the user to select and share one or more peers with the bot using messages +// sendBotRequestedPeer¹. +// +// Links: +// 1. https://core.telegram.org/method/messages.sendBotRequestedPeer // // See https://core.telegram.org/constructor/inputKeyboardButtonRequestPeer for reference. type InputKeyboardButtonRequestPeer struct { - // Flags field of InputKeyboardButtonRequestPeer. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // NameRequested field of InputKeyboardButtonRequestPeer. + // Set this flag to request the peer's name. NameRequested bool - // UsernameRequested field of InputKeyboardButtonRequestPeer. + // Set this flag to request the peer's @username (if any). UsernameRequested bool - // PhotoRequested field of InputKeyboardButtonRequestPeer. + // Set this flag to request the peer's photo (if any). PhotoRequested bool - // Text field of InputKeyboardButtonRequestPeer. + // Button text Text string - // ButtonID field of InputKeyboardButtonRequestPeer. + // Button ID, to be passed to messages.sendBotRequestedPeer¹. + // + // Links: + // 1) https://core.telegram.org/method/messages.sendBotRequestedPeer ButtonID int - // PeerType field of InputKeyboardButtonRequestPeer. + // Filtering criteria to use for the peer selection list shown to the user. The list + // should display all existing peers of the specified type, and should also offer an + // option for the user to create and immediately use one or more (up to max_quantity) + // peers of the specified type, if needed. PeerType RequestPeerTypeClass - // MaxQuantity field of InputKeyboardButtonRequestPeer. + // Maximum number of peers that can be chosen. MaxQuantity int } diff --git a/tg/tl_langpack_get_difference_gen.go b/tg/tl_langpack_get_difference_gen.go index 2c30bb2cec..150820fb13 100644 --- a/tg/tl_langpack_get_difference_gen.go +++ b/tg/tl_langpack_get_difference_gen.go @@ -36,9 +36,13 @@ var ( // // See https://core.telegram.org/method/langpack.getDifference for reference. type LangpackGetDifferenceRequest struct { - // Language pack + // Platform identifier (i.e. android, tdesktop, etc). LangPack string - // Language code + // Either an ISO 639-1 language code or a language pack name obtained from a language + // pack link¹. + // + // Links: + // 1) https://core.telegram.org/api/links#language-pack-links LangCode string // Previous localization pack version FromVersion int diff --git a/tg/tl_langpack_get_lang_pack_gen.go b/tg/tl_langpack_get_lang_pack_gen.go index fcdd249fe8..cf19a99692 100644 --- a/tg/tl_langpack_get_lang_pack_gen.go +++ b/tg/tl_langpack_get_lang_pack_gen.go @@ -36,12 +36,13 @@ var ( // // See https://core.telegram.org/method/langpack.getLangPack for reference. type LangpackGetLangPackRequest struct { - // Language pack name, usually obtained from a language pack link¹ + // Platform identifier (i.e. android, tdesktop, etc). + LangPack string + // Either an ISO 639-1 language code or a language pack name obtained from a language + // pack link¹. // // Links: // 1) https://core.telegram.org/api/links#language-pack-links - LangPack string - // Language code LangCode string } @@ -196,6 +197,7 @@ func (g *LangpackGetLangPackRequest) GetLangCode() (value string) { // // Possible errors: // +// 400 LANGUAGE_INVALID: The specified lang_code is invalid. // 400 LANG_CODE_NOT_SUPPORTED: The specified language code is not supported. // 400 LANG_PACK_INVALID: The provided language pack is invalid. // diff --git a/tg/tl_langpack_get_language_gen.go b/tg/tl_langpack_get_language_gen.go index 688389cd85..e6ba2dd247 100644 --- a/tg/tl_langpack_get_language_gen.go +++ b/tg/tl_langpack_get_language_gen.go @@ -36,12 +36,13 @@ var ( // // See https://core.telegram.org/method/langpack.getLanguage for reference. type LangpackGetLanguageRequest struct { - // Language pack name, usually obtained from a language pack link¹ + // Platform identifier (i.e. android, tdesktop, etc). + LangPack string + // Either an ISO 639-1 language code or a language pack name obtained from a language + // pack link¹. // // Links: // 1) https://core.telegram.org/api/links#language-pack-links - LangPack string - // Language code LangCode string } diff --git a/tg/tl_langpack_get_languages_gen.go b/tg/tl_langpack_get_languages_gen.go index 6bee6bcaa0..3bd01f18b6 100644 --- a/tg/tl_langpack_get_languages_gen.go +++ b/tg/tl_langpack_get_languages_gen.go @@ -36,7 +36,7 @@ var ( // // See https://core.telegram.org/method/langpack.getLanguages for reference. type LangpackGetLanguagesRequest struct { - // Language pack + // Platform identifier (i.e. android, tdesktop, etc). LangPack string } diff --git a/tg/tl_langpack_get_strings_gen.go b/tg/tl_langpack_get_strings_gen.go index 99096b7b38..a0bea3b8bf 100644 --- a/tg/tl_langpack_get_strings_gen.go +++ b/tg/tl_langpack_get_strings_gen.go @@ -36,12 +36,13 @@ var ( // // See https://core.telegram.org/method/langpack.getStrings for reference. type LangpackGetStringsRequest struct { - // Language pack name, usually obtained from a language pack link¹ + // Platform identifier (i.e. android, tdesktop, etc). + LangPack string + // Either an ISO 639-1 language code or a language pack name obtained from a language + // pack link¹. // // Links: // 1) https://core.telegram.org/api/links#language-pack-links - LangPack string - // Language code LangCode string // Strings to get Keys []string diff --git a/tg/tl_media_area_coordinates_gen.go b/tg/tl_media_area_coordinates_gen.go index 48b9f2439b..a3ba8b642c 100644 --- a/tg/tl_media_area_coordinates_gen.go +++ b/tg/tl_media_area_coordinates_gen.go @@ -36,7 +36,10 @@ var ( // // See https://core.telegram.org/constructor/mediaAreaCoordinates for reference. type MediaAreaCoordinates struct { - // Flags field of MediaAreaCoordinates. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // The abscissa of the rectangle's center, as a percentage of the media width (0-100). X float64 @@ -48,7 +51,7 @@ type MediaAreaCoordinates struct { H float64 // Clockwise rotation angle of the rectangle, in degrees (0-360). Rotation float64 - // Radius field of MediaAreaCoordinates. + // The radius of the rectangle corner rounding, as a percentage of the media width. // // Use SetRadius and GetRadius helpers. Radius float64 diff --git a/tg/tl_media_area_gen.go b/tg/tl_media_area_gen.go index 82b0685c50..d77d399e12 100644 --- a/tg/tl_media_area_gen.go +++ b/tg/tl_media_area_gen.go @@ -546,14 +546,17 @@ func (i *InputMediaAreaVenue) GetResultID() (value string) { // // See https://core.telegram.org/constructor/mediaAreaGeoPoint for reference. type MediaAreaGeoPoint struct { - // Flags field of MediaAreaGeoPoint. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // The size and position of the media area corresponding to the location sticker on top // of the story media. Coordinates MediaAreaCoordinates // Coordinates of the geolocation tag. Geo GeoPointClass - // Address field of MediaAreaGeoPoint. + // Optional textual representation of the address. // // Use SetAddress and GetAddress helpers. Address GeoPointAddress @@ -1422,12 +1425,17 @@ func (i *InputMediaAreaChannelPost) GetMsgID() (value int) { } // MediaAreaURL represents TL type `mediaAreaUrl#37381085`. +// Represents a URL media area¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#urls // // See https://core.telegram.org/constructor/mediaAreaUrl for reference. type MediaAreaURL struct { - // Coordinates field of MediaAreaURL. + // The size and location of the media area corresponding to the URL button on top of the + // story media. Coordinates MediaAreaCoordinates - // URL field of MediaAreaURL. + // URL to open when clicked. URL string } @@ -1583,16 +1591,24 @@ func (m *MediaAreaURL) GetURL() (value string) { } // MediaAreaWeather represents TL type `mediaAreaWeather#49a6549c`. +// Represents a weather widget »¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#weather // // See https://core.telegram.org/constructor/mediaAreaWeather for reference. type MediaAreaWeather struct { - // Coordinates field of MediaAreaWeather. + // The size and location of the media area corresponding to the widget on top of the + // story media. Coordinates MediaAreaCoordinates - // Emoji field of MediaAreaWeather. + // Weather emoji, should be rendered as an animated emoji¹. + // + // Links: + // 1) https://core.telegram.org/api/animated-emojis Emoji string - // TemperatureC field of MediaAreaWeather. + // Temperature in degrees Celsius. TemperatureC float64 - // Color field of MediaAreaWeather. + // ARGB background color. Color int } diff --git a/tg/tl_message_action_gen.go b/tg/tl_message_action_gen.go index c2cd40247d..e19caf4539 100644 --- a/tg/tl_message_action_gen.go +++ b/tg/tl_message_action_gen.go @@ -1921,10 +1921,11 @@ type MessageActionPaymentSentMe struct { RecurringInit bool // Whether this payment is part of a recurring payment RecurringUsed bool - // Three-letter ISO 4217 currency¹ code + // Three-letter ISO 4217 currency¹ code, or XTR for Telegram Stars². // // Links: // 1) https://core.telegram.org/bots/payments#supported-currencies + // 2) https://core.telegram.org/api/stars Currency string // Price of the product in the smallest units of the currency (integer, not float/double) // For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in @@ -2333,10 +2334,11 @@ type MessageActionPaymentSent struct { RecurringInit bool // Whether this payment is part of a recurring payment RecurringUsed bool - // Three-letter ISO 4217 currency¹ code + // Three-letter ISO 4217 currency¹ code, or XTR for Telegram Stars². // // Links: // 1) https://core.telegram.org/bots/payments#supported-currencies + // 2) https://core.telegram.org/api/stars Currency string // Price of the product in the smallest units of the currency (integer, not float/double) // For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in @@ -6453,8 +6455,8 @@ func (m *MessageActionSuggestProfilePhoto) GetPhoto() (value PhotoClass) { } // MessageActionRequestedPeer represents TL type `messageActionRequestedPeer#31518e9b`. -// Contains info about one or more peers that the user shared with the bot after clicking -// on a keyboardButtonRequestPeer¹ button. +// Contains info about one or more peers that the we (the user) shared with the bot after +// clicking on a keyboardButtonRequestPeer¹ button (service message sent by the user). // // Links: // 1. https://core.telegram.org/constructor/keyboardButtonRequestPeer @@ -6906,8 +6908,8 @@ type MessageActionGiftCode struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // If set, this gift code was received from a giveaway »¹ started by a channel we're - // subscribed to. + // If set, this gift code was received from a giveaway »¹ started by a + // channel/supergroup we're subscribed to. // // Links: // 1) https://core.telegram.org/api/giveaways @@ -6917,9 +6919,9 @@ type MessageActionGiftCode struct { // Links: // 1) https://core.telegram.org/api/links#premium-giftcode-links Unclaimed bool - // Identifier of the channel that created the gift code either directly or through a - // giveaway¹: if we import this giftcode link, we will also automatically boost² this - // channel. + // Identifier of the channel/supergroup that created the gift code either directly or + // through a giveaway¹: if we import this giftcode link, we will also automatically + // boost² this channel/supergroup. // // Links: // 1) https://core.telegram.org/api/giveaways @@ -7819,10 +7821,17 @@ func (m *MessageActionGiveawayResults) GetUnclaimedCount() (value int) { } // MessageActionBoostApply represents TL type `messageActionBoostApply#cc02aa6d`. +// Some boosts »¹ were applied to the channel or supergroup. +// +// Links: +// 1. https://core.telegram.org/api/boost // // See https://core.telegram.org/constructor/messageActionBoostApply for reference. type MessageActionBoostApply struct { - // Boosts field of MessageActionBoostApply. + // Number of applied boosts¹. + // + // Links: + // 1) https://core.telegram.org/api/boost Boosts int } @@ -7953,12 +7962,21 @@ func (m *MessageActionBoostApply) GetBoosts() (value int) { } // MessageActionRequestedPeerSentMe represents TL type `messageActionRequestedPeerSentMe#93b31848`. +// Contains info about one or more peers that the a user shared with the me (the bot) +// after clicking on a keyboardButtonRequestPeer¹ button (service message received by +// the bot). +// +// Links: +// 1. https://core.telegram.org/constructor/keyboardButtonRequestPeer // // See https://core.telegram.org/constructor/messageActionRequestedPeerSentMe for reference. type MessageActionRequestedPeerSentMe struct { - // ButtonID field of MessageActionRequestedPeerSentMe. + // button_id contained in the keyboardButtonRequestPeer¹ + // + // Links: + // 1) https://core.telegram.org/constructor/keyboardButtonRequestPeer ButtonID int - // Peers field of MessageActionRequestedPeerSentMe. + // Info about the shared peers. Peers []RequestedPeerClass } @@ -8137,22 +8155,32 @@ func (m *MessageActionRequestedPeerSentMe) MapPeers() (value RequestedPeerClassA } // MessageActionPaymentRefunded represents TL type `messageActionPaymentRefunded#41b3e202`. +// Describes a payment refund (service message received by both users and bots). // // See https://core.telegram.org/constructor/messageActionPaymentRefunded for reference. type MessageActionPaymentRefunded struct { - // Flags field of MessageActionPaymentRefunded. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Peer field of MessageActionPaymentRefunded. + // Identifier of the peer that returned the funds. Peer PeerClass - // Currency field of MessageActionPaymentRefunded. + // Currency, XTR for Telegram Stars. Currency string - // TotalAmount field of MessageActionPaymentRefunded. + // Total price in the smallest units of the currency (integer, not float/double). For + // example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in + // currencies.json¹, it shows the number of digits past the decimal point for each + // currency (2 for the majority of currencies). + // + // Links: + // 1) https://core.telegram.org/bots/payments/currencies.json TotalAmount int64 - // Payload field of MessageActionPaymentRefunded. + // Bot specified invoice payload (only received by bots). // // Use SetPayload and GetPayload helpers. Payload []byte - // Charge field of MessageActionPaymentRefunded. + // Provider payment identifier Charge PaymentCharge } @@ -8423,26 +8451,43 @@ func (m *MessageActionPaymentRefunded) GetCharge() (value PaymentCharge) { } // MessageActionGiftStars represents TL type `messageActionGiftStars#45d5b021`. +// You gifted or were gifted some Telegram Stars¹. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/messageActionGiftStars for reference. type MessageActionGiftStars struct { - // Flags field of MessageActionGiftStars. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Currency field of MessageActionGiftStars. + // Three-letter ISO 4217 currency¹ code + // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string - // Amount field of MessageActionGiftStars. + // Price of the gift in the smallest units of the currency (integer, not float/double). + // For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in + // currencies.json¹, it shows the number of digits past the decimal point for each + // currency (2 for the majority of currencies). + // + // Links: + // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 - // Stars field of MessageActionGiftStars. + // Amount of gifted stars Stars int64 - // CryptoCurrency field of MessageActionGiftStars. + // If the gift was bought using a cryptocurrency, the cryptocurrency name. // // Use SetCryptoCurrency and GetCryptoCurrency helpers. CryptoCurrency string - // CryptoAmount field of MessageActionGiftStars. + // If the gift was bought using a cryptocurrency, price of the gift in the smallest units + // of a cryptocurrency. // // Use SetCryptoAmount and GetCryptoAmount helpers. CryptoAmount int64 - // TransactionID field of MessageActionGiftStars. + // Identifier of the transaction, only visible to the receiver of the gift. // // Use SetTransactionID and GetTransactionID helpers. TransactionID string diff --git a/tg/tl_message_entity_gen.go b/tg/tl_message_entity_gen.go index 34211b4f09..254c18d640 100644 --- a/tg/tl_message_entity_gen.go +++ b/tg/tl_message_entity_gen.go @@ -3582,9 +3582,12 @@ func (m *MessageEntityCustomEmoji) GetDocumentID() (value int64) { // // See https://core.telegram.org/constructor/messageEntityBlockquote for reference. type MessageEntityBlockquote struct { - // Flags field of MessageEntityBlockquote. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Collapsed field of MessageEntityBlockquote. + // Whether the quote is collapsed by default. Collapsed bool // Offset of message entity within message (in UTF-16 code units¹) // diff --git a/tg/tl_message_extended_media_gen.go b/tg/tl_message_extended_media_gen.go index 7711947d29..130300fa52 100644 --- a/tg/tl_message_extended_media_gen.go +++ b/tg/tl_message_extended_media_gen.go @@ -32,7 +32,10 @@ var ( ) // MessageExtendedMediaPreview represents TL type `messageExtendedMediaPreview#ad628cc8`. -// Extended media preview +// Paid media preview for not yet purchased paid media, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/paid-media // // See https://core.telegram.org/constructor/messageExtendedMediaPreview for reference. type MessageExtendedMediaPreview struct { @@ -49,11 +52,14 @@ type MessageExtendedMediaPreview struct { // // Use SetH and GetH helpers. H int - // Thumbnail + // Extremely low resolution thumbnail¹. + // + // Links: + // 1) https://core.telegram.org/api/files#stripped-thumbnails // // Use SetThumb and GetThumb helpers. Thumb PhotoSizeClass - // Video duration + // Video duration for videos. // // Use SetVideoDuration and GetVideoDuration helpers. VideoDuration int @@ -358,11 +364,14 @@ func (m *MessageExtendedMediaPreview) GetVideoDuration() (value int, ok bool) { } // MessageExtendedMedia represents TL type `messageExtendedMedia#ee479c64`. -// Extended media +// Already purchased paid media, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/paid-media // // See https://core.telegram.org/constructor/messageExtendedMedia for reference. type MessageExtendedMedia struct { - // Media + // The media we purchased. Media MessageMediaClass } diff --git a/tg/tl_message_gen.go b/tg/tl_message_gen.go index 245782e236..a89e6f0cac 100644 --- a/tg/tl_message_gen.go +++ b/tg/tl_message_gen.go @@ -288,9 +288,13 @@ type Message struct { // If set, any eventual webpage preview will be shown on top of the message instead of at // the bottom. InvertMedia bool - // Flags2 field of Message. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags2 bin.Fields - // Offline field of Message. + // If set, the message was sent because of a scheduled action by the message sender, for + // example, as away, or a greeting service message. Offline bool // ID of the message ID int @@ -298,7 +302,19 @@ type Message struct { // // Use SetFromID and GetFromID helpers. FromID PeerClass - // FromBoostsApplied field of Message. + // Supergroups only, contains the number of boosts¹ this user has given the current + // supergroup, and should be shown in the UI in the header of the message. Only present + // for incoming messages from non-anonymous supergroup members that have boosted the + // supergroup. Note that this counter should be locally overridden for non-anonymous + // outgoing messages, according to the current value of channelFull².boosts_applied, to + // ensure the value is correct even for messages sent by the current user before a + // supergroup was boosted (or after a boost has expired or the number of boosts has + // changed); do not update this value for incoming messages from other users, even if + // their boosts have changed. + // + // Links: + // 1) https://core.telegram.org/api/boost + // 2) https://core.telegram.org/constructor/channelFull // // Use SetFromBoostsApplied and GetFromBoostsApplied helpers. FromBoostsApplied int @@ -321,7 +337,11 @@ type Message struct { // // Use SetViaBotID and GetViaBotID helpers. ViaBotID int64 - // ViaBusinessBotID field of Message. + // Whether the message was sent by the business bot¹ specified in via_bot_id on behalf + // of the user. + // + // Links: + // 1) https://core.telegram.org/api/business#connected-bots // // Use SetViaBusinessBotID and GetViaBusinessBotID helpers. ViaBusinessBotID int64 @@ -393,15 +413,25 @@ type Message struct { // // Use SetTTLPeriod and GetTTLPeriod helpers. TTLPeriod int - // QuickReplyShortcutID field of Message. + // If set, this message is a quick reply shortcut message »¹ (note that quick reply + // shortcut messages sent to a private chat will not have this field set). + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts // // Use SetQuickReplyShortcutID and GetQuickReplyShortcutID helpers. QuickReplyShortcutID int - // Effect field of Message. + // A message effect that should be played as specified here »¹. + // + // Links: + // 1) https://core.telegram.org/api/effects // // Use SetEffect and GetEffect helpers. Effect int64 - // Factcheck field of Message. + // Represents a fact-check »¹. + // + // Links: + // 1) https://core.telegram.org/api/factcheck // // Use SetFactcheck and GetFactcheck helpers. Factcheck FactCheck diff --git a/tg/tl_message_media_gen.go b/tg/tl_message_media_gen.go index 2b1a4e7336..e408a3bfc1 100644 --- a/tg/tl_message_media_gen.go +++ b/tg/tl_message_media_gen.go @@ -2095,10 +2095,11 @@ type MessageMediaInvoice struct { // // Use SetReceiptMsgID and GetReceiptMsgID helpers. ReceiptMsgID int - // Three-letter ISO 4217 currency¹ code + // Three-letter ISO 4217 currency¹ code, or XTR for Telegram Stars². // // Links: // 1) https://core.telegram.org/bots/payments#supported-currencies + // 2) https://core.telegram.org/api/stars Currency string // Total price in the smallest units of the currency (integer, not float/double). For // example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in @@ -2110,7 +2111,7 @@ type MessageMediaInvoice struct { TotalAmount int64 // Unique bot deep-linking parameter that can be used to generate this invoice StartParam string - // Extended media + // Deprecated // // Use SetExtendedMedia and GetExtendedMedia helpers. ExtendedMedia MessageExtendedMediaClass @@ -4009,8 +4010,8 @@ type MessageMediaGiveawayResults struct { OnlyNewSubscribers bool // If set, the giveaway was canceled and was fully refunded. Refunded bool - // ID of the channel that was automatically boosted¹ by the winners of the giveaway for - // duration of the Premium subscription. + // ID of the channel/supergroup that was automatically boosted¹ by the winners of the + // giveaway for duration of the Premium subscription. // // Links: // 1) https://core.telegram.org/api/boost @@ -4570,12 +4571,23 @@ func (m *MessageMediaGiveawayResults) GetUntilDate() (value int) { } // MessageMediaPaidMedia represents TL type `messageMediaPaidMedia#a8852491`. +// Paid media, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/paid-media // // See https://core.telegram.org/constructor/messageMediaPaidMedia for reference. type MessageMediaPaidMedia struct { - // StarsAmount field of MessageMediaPaidMedia. + // The price of the media in Telegram Stars¹. + // + // Links: + // 1) https://core.telegram.org/api/stars StarsAmount int64 - // ExtendedMedia field of MessageMediaPaidMedia. + // Either the paid-for media, or super low resolution media previews if the media wasn't + // purchased yet, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/paid-media#viewing-paid-media ExtendedMedia []MessageExtendedMediaClass } diff --git a/tg/tl_message_reactions_gen.go b/tg/tl_message_reactions_gen.go index 973094b32a..b92b745aed 100644 --- a/tg/tl_message_reactions_gen.go +++ b/tg/tl_message_reactions_gen.go @@ -59,7 +59,11 @@ type MessageReactions struct { // Links: // 1) https://core.telegram.org/method/messages.getMessageReactionsList CanSeeList bool - // ReactionsAsTags field of MessageReactions. + // If set or if there are no reactions, all present and future reactions should be + // treated as message tags, see here » for more info¹. + // + // Links: + // 1) https://core.telegram.org/api/saved-messages#tags ReactionsAsTags bool // Reactions Results []ReactionCount diff --git a/tg/tl_message_reply_header_gen.go b/tg/tl_message_reply_header_gen.go index a8dc2c1cd6..b24a14deb3 100644 --- a/tg/tl_message_reply_header_gen.go +++ b/tg/tl_message_reply_header_gen.go @@ -714,7 +714,7 @@ func (m *MessageReplyHeader) MapQuoteEntities() (value MessageEntityClassArray, // // See https://core.telegram.org/constructor/messageReplyStoryHeader for reference. type MessageReplyStoryHeader struct { - // Peer field of MessageReplyStoryHeader. + // Sender of the story. Peer PeerClass // Story ID StoryID int diff --git a/tg/tl_messages_add_chat_user_gen.go b/tg/tl_messages_add_chat_user_gen.go index 1fc6c913e6..1762132989 100644 --- a/tg/tl_messages_add_chat_user_gen.go +++ b/tg/tl_messages_add_chat_user_gen.go @@ -33,13 +33,6 @@ var ( // MessagesAddChatUserRequest represents TL type `messages.addChatUser#cbc6d107`. // Adds a user to a chat and sends a service message on it. -// May also return 0-N updates of type updateGroupInvitePrivacyForbidden¹: it indicates -// we couldn't add a user to a chat because of their privacy settings; if required, an -// invite link² can be shared with the user, instead. -// -// Links: -// 1. https://core.telegram.org/constructor/updateGroupInvitePrivacyForbidden -// 2. https://core.telegram.org/api/invites // // See https://core.telegram.org/method/messages.addChatUser for reference. type MessagesAddChatUserRequest struct { @@ -229,13 +222,6 @@ func (a *MessagesAddChatUserRequest) GetFwdLimit() (value int) { // MessagesAddChatUser invokes method messages.addChatUser#cbc6d107 returning error if any. // Adds a user to a chat and sends a service message on it. -// May also return 0-N updates of type updateGroupInvitePrivacyForbidden¹: it indicates -// we couldn't add a user to a chat because of their privacy settings; if required, an -// invite link² can be shared with the user, instead. -// -// Links: -// 1. https://core.telegram.org/constructor/updateGroupInvitePrivacyForbidden -// 2. https://core.telegram.org/api/invites // // Possible errors: // diff --git a/tg/tl_messages_all_stickers_gen.go b/tg/tl_messages_all_stickers_gen.go index 185f22f7aa..91fcfd1a24 100644 --- a/tg/tl_messages_all_stickers_gen.go +++ b/tg/tl_messages_all_stickers_gen.go @@ -138,7 +138,7 @@ func (a *MessagesAllStickersNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/messages.allStickers for reference. type MessagesAllStickers struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_available_effects_gen.go b/tg/tl_messages_available_effects_gen.go index fe60da7ebf..7e6a18c389 100644 --- a/tg/tl_messages_available_effects_gen.go +++ b/tg/tl_messages_available_effects_gen.go @@ -32,6 +32,10 @@ var ( ) // MessagesAvailableEffectsNotModified represents TL type `messages.availableEffectsNotModified#d1ed9a5b`. +// The full list of usable animated message effects »¹ hasn't changed. +// +// Links: +// 1. https://core.telegram.org/api/effects // // See https://core.telegram.org/constructor/messages.availableEffectsNotModified for reference. type MessagesAvailableEffectsNotModified struct { @@ -133,14 +137,21 @@ func (a *MessagesAvailableEffectsNotModified) DecodeBare(b *bin.Buffer) error { } // MessagesAvailableEffects represents TL type `messages.availableEffects#bddb616e`. +// The full list of usable animated message effects »¹. +// +// Links: +// 1. https://core.telegram.org/api/effects // // See https://core.telegram.org/constructor/messages.availableEffects for reference. type MessagesAvailableEffects struct { - // Hash field of MessagesAvailableEffects. + // Hash used for caching, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int - // Effects field of MessagesAvailableEffects. + // Message effects Effects []AvailableEffect - // Documents field of MessagesAvailableEffects. + // Documents specified in the effects constructors. Documents []DocumentClass } diff --git a/tg/tl_messages_available_reactions_gen.go b/tg/tl_messages_available_reactions_gen.go index 45e77ac78f..a051140bd6 100644 --- a/tg/tl_messages_available_reactions_gen.go +++ b/tg/tl_messages_available_reactions_gen.go @@ -141,7 +141,7 @@ func (a *MessagesAvailableReactionsNotModified) DecodeBare(b *bin.Buffer) error // // See https://core.telegram.org/constructor/messages.availableReactions for reference. type MessagesAvailableReactions struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_check_quick_reply_shortcut_gen.go b/tg/tl_messages_check_quick_reply_shortcut_gen.go index 418a87e200..85a41f8e26 100644 --- a/tg/tl_messages_check_quick_reply_shortcut_gen.go +++ b/tg/tl_messages_check_quick_reply_shortcut_gen.go @@ -32,10 +32,16 @@ var ( ) // MessagesCheckQuickReplyShortcutRequest represents TL type `messages.checkQuickReplyShortcut#f1d0fbd3`. +// Before offering the user the choice to add a message to a quick reply shortcut¹, to +// make sure that none of the limits specified here »² were reached. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts +// 2. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/method/messages.checkQuickReplyShortcut for reference. type MessagesCheckQuickReplyShortcutRequest struct { - // Shortcut field of MessagesCheckQuickReplyShortcutRequest. + // Shorcut name (not ID!). Shortcut string } @@ -161,6 +167,16 @@ func (c *MessagesCheckQuickReplyShortcutRequest) GetShortcut() (value string) { } // MessagesCheckQuickReplyShortcut invokes method messages.checkQuickReplyShortcut#f1d0fbd3 returning error if any. +// Before offering the user the choice to add a message to a quick reply shortcut¹, to +// make sure that none of the limits specified here »² were reached. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts +// 2. https://core.telegram.org/api/business#quick-reply-shortcuts +// +// Possible errors: +// +// 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // // See https://core.telegram.org/method/messages.checkQuickReplyShortcut for reference. func (c *Client) MessagesCheckQuickReplyShortcut(ctx context.Context, shortcut string) (bool, error) { diff --git a/tg/tl_messages_create_chat_gen.go b/tg/tl_messages_create_chat_gen.go index 5649081dfc..0082c6d5b4 100644 --- a/tg/tl_messages_create_chat_gen.go +++ b/tg/tl_messages_create_chat_gen.go @@ -33,13 +33,6 @@ var ( // MessagesCreateChatRequest represents TL type `messages.createChat#92ceddd4`. // Creates a new chat. -// May also return 0-N updates of type updateGroupInvitePrivacyForbidden¹: it indicates -// we couldn't add a user to a chat because of their privacy settings; if required, an -// invite link² can be shared with the user, instead. -// -// Links: -// 1. https://core.telegram.org/constructor/updateGroupInvitePrivacyForbidden -// 2. https://core.telegram.org/api/invites // // See https://core.telegram.org/method/messages.createChat for reference. type MessagesCreateChatRequest struct { @@ -294,13 +287,6 @@ func (c *MessagesCreateChatRequest) MapUsers() (value InputUserClassArray) { // MessagesCreateChat invokes method messages.createChat#92ceddd4 returning error if any. // Creates a new chat. -// May also return 0-N updates of type updateGroupInvitePrivacyForbidden¹: it indicates -// we couldn't add a user to a chat because of their privacy settings; if required, an -// invite link² can be shared with the user, instead. -// -// Links: -// 1. https://core.telegram.org/constructor/updateGroupInvitePrivacyForbidden -// 2. https://core.telegram.org/api/invites // // Possible errors: // diff --git a/tg/tl_messages_delete_fact_check_gen.go b/tg/tl_messages_delete_fact_check_gen.go index 00a5f21a6d..acc73f08e5 100644 --- a/tg/tl_messages_delete_fact_check_gen.go +++ b/tg/tl_messages_delete_fact_check_gen.go @@ -32,12 +32,19 @@ var ( ) // MessagesDeleteFactCheckRequest represents TL type `messages.deleteFactCheck#d1da940c`. +// Delete a fact-check¹ from a message. +// Can only be used by independent fact-checkers as specified by the appConfig +// can_edit_factcheck¹ configuration flag. +// +// Links: +// 1. https://core.telegram.org/api/factcheck +// 2. https://core.telegram.org/api/config#can-edit-factcheck // // See https://core.telegram.org/method/messages.deleteFactCheck for reference. type MessagesDeleteFactCheckRequest struct { - // Peer field of MessagesDeleteFactCheckRequest. + // Peer where the message was sent. Peer InputPeerClass - // MsgID field of MessagesDeleteFactCheckRequest. + // Message ID MsgID int } @@ -193,6 +200,18 @@ func (d *MessagesDeleteFactCheckRequest) GetMsgID() (value int) { } // MessagesDeleteFactCheck invokes method messages.deleteFactCheck#d1da940c returning error if any. +// Delete a fact-check¹ from a message. +// Can only be used by independent fact-checkers as specified by the appConfig +// can_edit_factcheck¹ configuration flag. +// +// Links: +// 1. https://core.telegram.org/api/factcheck +// 2. https://core.telegram.org/api/config#can-edit-factcheck +// +// Possible errors: +// +// 403 CHAT_ACTION_FORBIDDEN: You cannot execute this action. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.deleteFactCheck for reference. func (c *Client) MessagesDeleteFactCheck(ctx context.Context, request *MessagesDeleteFactCheckRequest) (UpdatesClass, error) { diff --git a/tg/tl_messages_delete_quick_reply_messages_gen.go b/tg/tl_messages_delete_quick_reply_messages_gen.go index fac012ee12..312feed283 100644 --- a/tg/tl_messages_delete_quick_reply_messages_gen.go +++ b/tg/tl_messages_delete_quick_reply_messages_gen.go @@ -32,12 +32,21 @@ var ( ) // MessagesDeleteQuickReplyMessagesRequest represents TL type `messages.deleteQuickReplyMessages#e105e910`. +// Delete one or more messages from a quick reply shortcut¹. This will also emit an +// updateDeleteQuickReplyMessages² update. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts +// 2. https://core.telegram.org/constructor/updateDeleteQuickReplyMessages // // See https://core.telegram.org/method/messages.deleteQuickReplyMessages for reference. type MessagesDeleteQuickReplyMessagesRequest struct { - // ShortcutID field of MessagesDeleteQuickReplyMessagesRequest. + // Shortcut ID¹. + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts ShortcutID int - // ID field of MessagesDeleteQuickReplyMessagesRequest. + // IDs of shortcut messages to delete. ID []int } @@ -201,6 +210,16 @@ func (d *MessagesDeleteQuickReplyMessagesRequest) GetID() (value []int) { } // MessagesDeleteQuickReplyMessages invokes method messages.deleteQuickReplyMessages#e105e910 returning error if any. +// Delete one or more messages from a quick reply shortcut¹. This will also emit an +// updateDeleteQuickReplyMessages² update. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts +// 2. https://core.telegram.org/constructor/updateDeleteQuickReplyMessages +// +// Possible errors: +// +// 400 SHORTCUT_INVALID: The specified shortcut is invalid. // // See https://core.telegram.org/method/messages.deleteQuickReplyMessages for reference. func (c *Client) MessagesDeleteQuickReplyMessages(ctx context.Context, request *MessagesDeleteQuickReplyMessagesRequest) (UpdatesClass, error) { diff --git a/tg/tl_messages_delete_quick_reply_shortcut_gen.go b/tg/tl_messages_delete_quick_reply_shortcut_gen.go index e10f471a19..f1ecc8f215 100644 --- a/tg/tl_messages_delete_quick_reply_shortcut_gen.go +++ b/tg/tl_messages_delete_quick_reply_shortcut_gen.go @@ -32,10 +32,22 @@ var ( ) // MessagesDeleteQuickReplyShortcutRequest represents TL type `messages.deleteQuickReplyShortcut#3cc04740`. +// Completely delete a quick reply shortcut¹. +// This will also emit an updateDeleteQuickReply² update to other logged-in sessions +// (and no updateDeleteQuickReplyMessages³ updates, even if all the messages in the +// shortcuts are also deleted by this method). +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts +// 2. https://core.telegram.org/constructor/updateDeleteQuickReply +// 3. https://core.telegram.org/constructor/updateDeleteQuickReplyMessages // // See https://core.telegram.org/method/messages.deleteQuickReplyShortcut for reference. type MessagesDeleteQuickReplyShortcutRequest struct { - // ShortcutID field of MessagesDeleteQuickReplyShortcutRequest. + // Shortcut ID¹ + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts ShortcutID int } @@ -161,6 +173,19 @@ func (d *MessagesDeleteQuickReplyShortcutRequest) GetShortcutID() (value int) { } // MessagesDeleteQuickReplyShortcut invokes method messages.deleteQuickReplyShortcut#3cc04740 returning error if any. +// Completely delete a quick reply shortcut¹. +// This will also emit an updateDeleteQuickReply² update to other logged-in sessions +// (and no updateDeleteQuickReplyMessages³ updates, even if all the messages in the +// shortcuts are also deleted by this method). +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts +// 2. https://core.telegram.org/constructor/updateDeleteQuickReply +// 3. https://core.telegram.org/constructor/updateDeleteQuickReplyMessages +// +// Possible errors: +// +// 400 SHORTCUT_INVALID: The specified shortcut is invalid. // // See https://core.telegram.org/method/messages.deleteQuickReplyShortcut for reference. func (c *Client) MessagesDeleteQuickReplyShortcut(ctx context.Context, shortcutid int) (bool, error) { diff --git a/tg/tl_messages_delete_scheduled_messages_gen.go b/tg/tl_messages_delete_scheduled_messages_gen.go index b68396ce01..94f2f05ee6 100644 --- a/tg/tl_messages_delete_scheduled_messages_gen.go +++ b/tg/tl_messages_delete_scheduled_messages_gen.go @@ -211,6 +211,7 @@ func (d *MessagesDeleteScheduledMessagesRequest) GetID() (value []int) { // // Possible errors: // +// 403 MESSAGE_DELETE_FORBIDDEN: You can't delete one of the messages you tried to delete, most likely because it is a service message. // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.deleteScheduledMessages for reference. diff --git a/tg/tl_messages_dialog_filters_gen.go b/tg/tl_messages_dialog_filters_gen.go index 18a445e06c..68b9c813a8 100644 --- a/tg/tl_messages_dialog_filters_gen.go +++ b/tg/tl_messages_dialog_filters_gen.go @@ -32,14 +32,24 @@ var ( ) // MessagesDialogFilters represents TL type `messages.dialogFilters#2ad93719`. +// Folder and folder tags¹ information +// +// Links: +// 1. https://core.telegram.org/api/folders // // See https://core.telegram.org/constructor/messages.dialogFilters for reference. type MessagesDialogFilters struct { - // Flags field of MessagesDialogFilters. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // TagsEnabled field of MessagesDialogFilters. + // Whether folder tags¹ are enabled. + // + // Links: + // 1) https://core.telegram.org/api/folders#folder-tags TagsEnabled bool - // Filters field of MessagesDialogFilters. + // Folders. Filters []DialogFilterClass } diff --git a/tg/tl_messages_edit_chat_title_gen.go b/tg/tl_messages_edit_chat_title_gen.go index f313cc99d3..24de037b54 100644 --- a/tg/tl_messages_edit_chat_title_gen.go +++ b/tg/tl_messages_edit_chat_title_gen.go @@ -193,6 +193,7 @@ func (e *MessagesEditChatTitleRequest) GetTitle() (value string) { // // Possible errors: // +// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 400 CHAT_TITLE_EMPTY: No chat title provided. diff --git a/tg/tl_messages_edit_fact_check_gen.go b/tg/tl_messages_edit_fact_check_gen.go index 521e870566..b5fcabb6c4 100644 --- a/tg/tl_messages_edit_fact_check_gen.go +++ b/tg/tl_messages_edit_fact_check_gen.go @@ -32,14 +32,24 @@ var ( ) // MessagesEditFactCheckRequest represents TL type `messages.editFactCheck#589ee75`. +// Edit/create a fact-check¹ on a message. +// Can only be used by independent fact-checkers as specified by the appConfig +// can_edit_factcheck¹ configuration flag. +// +// Links: +// 1. https://core.telegram.org/api/factcheck +// 2. https://core.telegram.org/api/config#can-edit-factcheck // // See https://core.telegram.org/method/messages.editFactCheck for reference. type MessagesEditFactCheckRequest struct { - // Peer field of MessagesEditFactCheckRequest. + // Peer where the message was sent Peer InputPeerClass - // MsgID field of MessagesEditFactCheckRequest. + // Message ID MsgID int - // Text field of MessagesEditFactCheckRequest. + // Fact-check (maximum UTF-8 length specified in appConfig.factcheck_length_limit¹). + // + // Links: + // 1) https://core.telegram.org/api/config#factcheck-length-limit Text TextWithEntities } @@ -220,6 +230,18 @@ func (e *MessagesEditFactCheckRequest) GetText() (value TextWithEntities) { } // MessagesEditFactCheck invokes method messages.editFactCheck#589ee75 returning error if any. +// Edit/create a fact-check¹ on a message. +// Can only be used by independent fact-checkers as specified by the appConfig +// can_edit_factcheck¹ configuration flag. +// +// Links: +// 1. https://core.telegram.org/api/factcheck +// 2. https://core.telegram.org/api/config#can-edit-factcheck +// +// Possible errors: +// +// 403 CHAT_ACTION_FORBIDDEN: You cannot execute this action. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.editFactCheck for reference. func (c *Client) MessagesEditFactCheck(ctx context.Context, request *MessagesEditFactCheckRequest) (UpdatesClass, error) { diff --git a/tg/tl_messages_edit_inline_bot_message_gen.go b/tg/tl_messages_edit_inline_bot_message_gen.go index 56023411b5..b0b65c4a42 100644 --- a/tg/tl_messages_edit_inline_bot_message_gen.go +++ b/tg/tl_messages_edit_inline_bot_message_gen.go @@ -495,7 +495,7 @@ func (e *MessagesEditInlineBotMessageRequest) MapEntities() (value MessageEntity // Possible errors: // // 400 BUTTON_DATA_INVALID: The data of one or more of the buttons you provided is invalid. -// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. +// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. // 400 MESSAGE_NOT_MODIFIED: The provided message data is identical to the previous message data, the message wasn't modified. // diff --git a/tg/tl_messages_edit_message_gen.go b/tg/tl_messages_edit_message_gen.go index c5eb494030..c15a6cba42 100644 --- a/tg/tl_messages_edit_message_gen.go +++ b/tg/tl_messages_edit_message_gen.go @@ -76,7 +76,10 @@ type MessagesEditMessageRequest struct { // // Use SetScheduleDate and GetScheduleDate helpers. ScheduleDate int - // QuickReplyShortcutID field of MessagesEditMessageRequest. + // If specified, edits a quick reply shortcut message, instead »¹. + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts // // Use SetQuickReplyShortcutID and GetQuickReplyShortcutID helpers. QuickReplyShortcutID int @@ -633,7 +636,7 @@ func (e *MessagesEditMessageRequest) MapEntities() (value MessageEntityClassArra // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 DOCUMENT_INVALID: The specified document is invalid. // 400 ENTITIES_TOO_LONG: You provided too many styled message entities. -// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. +// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. // 400 FILE_PARTS_INVALID: The number of file parts is invalid. // 400 IMAGE_PROCESS_FAILED: Failure while processing image. // 403 INLINE_BOT_REQUIRED: Only the inline bot can edit message. @@ -658,6 +661,7 @@ func (e *MessagesEditMessageRequest) MapEntities() (value MessageEntityClassArra // 400 REPLY_MARKUP_TOO_LONG: The specified reply_markup is too long. // 400 SCHEDULE_DATE_INVALID: Invalid schedule date provided. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. +// 400 WEBPAGE_NOT_FOUND: A preview for the specified webpage url could not be generated. // // See https://core.telegram.org/method/messages.editMessage for reference. // Can be used by bots. diff --git a/tg/tl_messages_edit_quick_reply_shortcut_gen.go b/tg/tl_messages_edit_quick_reply_shortcut_gen.go index 686734eed4..b22ea1ea0b 100644 --- a/tg/tl_messages_edit_quick_reply_shortcut_gen.go +++ b/tg/tl_messages_edit_quick_reply_shortcut_gen.go @@ -32,12 +32,21 @@ var ( ) // MessagesEditQuickReplyShortcutRequest represents TL type `messages.editQuickReplyShortcut#5c003cef`. +// Rename a quick reply shortcut¹. +// This will emit an updateQuickReplies² update to other logged-in sessions. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts +// 2. https://core.telegram.org/constructor/updateQuickReplies // // See https://core.telegram.org/method/messages.editQuickReplyShortcut for reference. type MessagesEditQuickReplyShortcutRequest struct { - // ShortcutID field of MessagesEditQuickReplyShortcutRequest. + // Shortcut ID¹. + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts ShortcutID int - // Shortcut field of MessagesEditQuickReplyShortcutRequest. + // New shortcut name. Shortcut string } @@ -188,6 +197,17 @@ func (e *MessagesEditQuickReplyShortcutRequest) GetShortcut() (value string) { } // MessagesEditQuickReplyShortcut invokes method messages.editQuickReplyShortcut#5c003cef returning error if any. +// Rename a quick reply shortcut¹. +// This will emit an updateQuickReplies² update to other logged-in sessions. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts +// 2. https://core.telegram.org/constructor/updateQuickReplies +// +// Possible errors: +// +// 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. +// 400 SHORTCUT_INVALID: The specified shortcut is invalid. // // See https://core.telegram.org/method/messages.editQuickReplyShortcut for reference. func (c *Client) MessagesEditQuickReplyShortcut(ctx context.Context, request *MessagesEditQuickReplyShortcutRequest) (bool, error) { diff --git a/tg/tl_messages_emoji_groups_gen.go b/tg/tl_messages_emoji_groups_gen.go index e82dd896f1..e4ab993056 100644 --- a/tg/tl_messages_emoji_groups_gen.go +++ b/tg/tl_messages_emoji_groups_gen.go @@ -35,7 +35,7 @@ var ( // The list of emoji categories¹ hasn't changed. // // Links: -// 1. https://core.telegram.org/api/custom-emoji#emoji-categories +// 1. https://core.telegram.org/api/emoji-categories // // See https://core.telegram.org/constructor/messages.emojiGroupsNotModified for reference. type MessagesEmojiGroupsNotModified struct { @@ -140,11 +140,11 @@ func (e *MessagesEmojiGroupsNotModified) DecodeBare(b *bin.Buffer) error { // Represents a list of emoji categories¹. // // Links: -// 1. https://core.telegram.org/api/custom-emoji#emoji-categories +// 1. https://core.telegram.org/api/emoji-categories // // See https://core.telegram.org/constructor/messages.emojiGroups for reference. type MessagesEmojiGroups struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation @@ -152,7 +152,7 @@ type MessagesEmojiGroups struct { // A list of emoji categories¹. // // Links: - // 1) https://core.telegram.org/api/custom-emoji#emoji-categories + // 1) https://core.telegram.org/api/emoji-categories Groups []EmojiGroupClass } diff --git a/tg/tl_messages_faved_stickers_gen.go b/tg/tl_messages_faved_stickers_gen.go index 6808512b00..2307794594 100644 --- a/tg/tl_messages_faved_stickers_gen.go +++ b/tg/tl_messages_faved_stickers_gen.go @@ -138,7 +138,7 @@ func (f *MessagesFavedStickersNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/messages.favedStickers for reference. type MessagesFavedStickers struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_featured_stickers_gen.go b/tg/tl_messages_featured_stickers_gen.go index b1b173f76c..ed46b013e3 100644 --- a/tg/tl_messages_featured_stickers_gen.go +++ b/tg/tl_messages_featured_stickers_gen.go @@ -178,7 +178,7 @@ type MessagesFeaturedStickers struct { Flags bin.Fields // Whether this is a premium stickerset Premium bool - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_forward_messages_gen.go b/tg/tl_messages_forward_messages_gen.go index 0f2fbb7f3e..f5da4fcd4a 100644 --- a/tg/tl_messages_forward_messages_gen.go +++ b/tg/tl_messages_forward_messages_gen.go @@ -81,7 +81,10 @@ type MessagesForwardMessagesRequest struct { // // Use SetSendAs and GetSendAs helpers. SendAs InputPeerClass - // QuickReplyShortcut field of MessagesForwardMessagesRequest. + // Add the messages to the specified quick reply shortcut »¹, instead. + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts // // Use SetQuickReplyShortcut and GetQuickReplyShortcut helpers. QuickReplyShortcut InputQuickReplyShortcutClass @@ -729,7 +732,7 @@ func (f *MessagesForwardMessagesRequest) GetQuickReplyShortcut() (value InputQui // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 406 CHAT_FORWARDS_RESTRICTED: You can't forward messages from a protected chat. -// 403 CHAT_GUEST_SEND_FORBIDDEN: You join the discussion group before commenting, see here » for more info. +// 403 CHAT_GUEST_SEND_FORBIDDEN: You join the discussion group before commenting, see here » for more info. // 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 CHAT_RESTRICTED: You can't send messages in this chat, you were restricted. // 403 CHAT_SEND_AUDIOS_FORBIDDEN: You can't send audio messages in this chat. @@ -750,11 +753,15 @@ func (f *MessagesForwardMessagesRequest) GetQuickReplyShortcut() (value InputQui // 400 MESSAGE_IDS_EMPTY: No message ids were provided. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. // 400 MSG_ID_INVALID: Invalid message ID provided. -// 406 PAYMENT_UNSUPPORTED: A detailed description of the error will be received separately as described here ». +// 406 PAYMENT_UNSUPPORTED: A detailed description of the error will be received separately as described here ». // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. +// 406 PRIVACY_PREMIUM_REQUIRED: You need a Telegram Premium subscription to send a message to this user. +// 400 QUICK_REPLIES_TOO_MUCH: A maximum of appConfig.quick_replies_limit shortcuts may be created, the limit was reached. // 400 QUIZ_ANSWER_MISSING: You can forward a quiz while hiding the original author only after choosing an option in the quiz. // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. // 400 RANDOM_ID_INVALID: A provided random ID is invalid. +// 400 REPLY_MESSAGES_TOO_MUCH: Each shortcut can contain a maximum of appConfig.quick_reply_messages_limit messages, the limit was reached. // 400 SCHEDULE_BOT_NOT_ALLOWED: Bots cannot schedule messages. // 400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future. // 400 SCHEDULE_TOO_MUCH: There are too many scheduled messages. diff --git a/tg/tl_messages_found_sticker_sets_gen.go b/tg/tl_messages_found_sticker_sets_gen.go index 7cec3474bc..01adbcb941 100644 --- a/tg/tl_messages_found_sticker_sets_gen.go +++ b/tg/tl_messages_found_sticker_sets_gen.go @@ -138,7 +138,7 @@ func (f *MessagesFoundStickerSetsNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/messages.foundStickerSets for reference. type MessagesFoundStickerSets struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_all_stickers_gen.go b/tg/tl_messages_get_all_stickers_gen.go index a2a79a3be6..ecf215eb18 100644 --- a/tg/tl_messages_get_all_stickers_gen.go +++ b/tg/tl_messages_get_all_stickers_gen.go @@ -36,7 +36,7 @@ var ( // // See https://core.telegram.org/method/messages.getAllStickers for reference. type MessagesGetAllStickersRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_attach_menu_bots_gen.go b/tg/tl_messages_get_attach_menu_bots_gen.go index ca2b361645..d5aed886f5 100644 --- a/tg/tl_messages_get_attach_menu_bots_gen.go +++ b/tg/tl_messages_get_attach_menu_bots_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/messages.getAttachMenuBots for reference. type MessagesGetAttachMenuBotsRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_attached_stickers_gen.go b/tg/tl_messages_get_attached_stickers_gen.go index f7c97f11ac..57c20a04e1 100644 --- a/tg/tl_messages_get_attached_stickers_gen.go +++ b/tg/tl_messages_get_attached_stickers_gen.go @@ -169,6 +169,10 @@ func (g *MessagesGetAttachedStickersRequest) GetMedia() (value InputStickeredMed // MessagesGetAttachedStickers invokes method messages.getAttachedStickers#cc5b67cc returning error if any. // Get stickers attached to a photo or video // +// Possible errors: +// +// 400 MEDIA_EMPTY: The provided media object is invalid. +// // See https://core.telegram.org/method/messages.getAttachedStickers for reference. func (c *Client) MessagesGetAttachedStickers(ctx context.Context, media InputStickeredMediaClass) ([]StickerSetCoveredClass, error) { var result StickerSetCoveredClassVector diff --git a/tg/tl_messages_get_available_effects_gen.go b/tg/tl_messages_get_available_effects_gen.go index ba4704f4a9..b68adf0f4d 100644 --- a/tg/tl_messages_get_available_effects_gen.go +++ b/tg/tl_messages_get_available_effects_gen.go @@ -32,10 +32,17 @@ var ( ) // MessagesGetAvailableEffectsRequest represents TL type `messages.getAvailableEffects#dea20a39`. +// Fetch the full list of usable animated message effects »¹. +// +// Links: +// 1. https://core.telegram.org/api/effects // // See https://core.telegram.org/method/messages.getAvailableEffects for reference. type MessagesGetAvailableEffectsRequest struct { - // Hash field of MessagesGetAvailableEffectsRequest. + // Hash used for caching, for more info click here¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int } @@ -161,6 +168,10 @@ func (g *MessagesGetAvailableEffectsRequest) GetHash() (value int) { } // MessagesGetAvailableEffects invokes method messages.getAvailableEffects#dea20a39 returning error if any. +// Fetch the full list of usable animated message effects »¹. +// +// Links: +// 1. https://core.telegram.org/api/effects // // See https://core.telegram.org/method/messages.getAvailableEffects for reference. func (c *Client) MessagesGetAvailableEffects(ctx context.Context, hash int) (MessagesAvailableEffectsClass, error) { diff --git a/tg/tl_messages_get_available_reactions_gen.go b/tg/tl_messages_get_available_reactions_gen.go index 13b9b4279c..ce48d1b5f7 100644 --- a/tg/tl_messages_get_available_reactions_gen.go +++ b/tg/tl_messages_get_available_reactions_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/messages.getAvailableReactions for reference. type MessagesGetAvailableReactionsRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_bot_app_gen.go b/tg/tl_messages_get_bot_app_gen.go index 03fab63399..28d3599e4e 100644 --- a/tg/tl_messages_get_bot_app_gen.go +++ b/tg/tl_messages_get_bot_app_gen.go @@ -44,7 +44,7 @@ type MessagesGetBotAppRequest struct { // Links: // 1) https://core.telegram.org/api/links#direct-mini-app-links App InputBotAppClass - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation @@ -210,7 +210,9 @@ func (g *MessagesGetBotAppRequest) GetHash() (value int64) { // // Possible errors: // +// 400 BOT_APP_BOT_INVALID: The bot_id passed in the inputBotAppShortName constructor is invalid. // 400 BOT_APP_INVALID: The specified bot app is invalid. +// 400 BOT_APP_SHORTNAME_INVALID: The specified bot app short name is invalid. // // See https://core.telegram.org/method/messages.getBotApp for reference. func (c *Client) MessagesGetBotApp(ctx context.Context, request *MessagesGetBotAppRequest) (*MessagesBotApp, error) { diff --git a/tg/tl_messages_get_bot_callback_answer_gen.go b/tg/tl_messages_get_bot_callback_answer_gen.go index 24379dad86..59bed791f6 100644 --- a/tg/tl_messages_get_bot_callback_answer_gen.go +++ b/tg/tl_messages_get_bot_callback_answer_gen.go @@ -374,6 +374,7 @@ func (g *MessagesGetBotCallbackAnswerRequest) GetPasswordAsNotEmpty() (*InputChe // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 DATA_INVALID: Encrypted data invalid. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 PASSWORD_MISSING: You must enable 2FA before executing this operation. // 400 PEER_ID_INVALID: The provided peer id is invalid. // -503 Timeout: Timeout while fetching data. // diff --git a/tg/tl_messages_get_default_history_ttl_gen.go b/tg/tl_messages_get_default_history_ttl_gen.go index d9e10c2fc9..5548a0224e 100644 --- a/tg/tl_messages_get_default_history_ttl_gen.go +++ b/tg/tl_messages_get_default_history_ttl_gen.go @@ -132,7 +132,6 @@ func (g *MessagesGetDefaultHistoryTTLRequest) DecodeBare(b *bin.Buffer) error { // Gets the default value of the Time-To-Live setting, applied to all new chats. // // See https://core.telegram.org/method/messages.getDefaultHistoryTTL for reference. -// Can be used by bots. func (c *Client) MessagesGetDefaultHistoryTTL(ctx context.Context) (*DefaultHistoryTTL, error) { var result DefaultHistoryTTL diff --git a/tg/tl_messages_get_default_tag_reactions_gen.go b/tg/tl_messages_get_default_tag_reactions_gen.go index 0ef68a354d..e70feb349f 100644 --- a/tg/tl_messages_get_default_tag_reactions_gen.go +++ b/tg/tl_messages_get_default_tag_reactions_gen.go @@ -32,10 +32,17 @@ var ( ) // MessagesGetDefaultTagReactionsRequest represents TL type `messages.getDefaultTagReactions#bdf93428`. +// Fetch a default recommended list of saved message tag reactions¹. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages#tags // // See https://core.telegram.org/method/messages.getDefaultTagReactions for reference. type MessagesGetDefaultTagReactionsRequest struct { - // Hash field of MessagesGetDefaultTagReactionsRequest. + // Hash used for caching, for more info click here¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 } @@ -161,6 +168,10 @@ func (g *MessagesGetDefaultTagReactionsRequest) GetHash() (value int64) { } // MessagesGetDefaultTagReactions invokes method messages.getDefaultTagReactions#bdf93428 returning error if any. +// Fetch a default recommended list of saved message tag reactions¹. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages#tags // // See https://core.telegram.org/method/messages.getDefaultTagReactions for reference. func (c *Client) MessagesGetDefaultTagReactions(ctx context.Context, hash int64) (MessagesReactionsClass, error) { diff --git a/tg/tl_messages_get_dialogs_gen.go b/tg/tl_messages_get_dialogs_gen.go index 74816d7afa..8f7b944562 100644 --- a/tg/tl_messages_get_dialogs_gen.go +++ b/tg/tl_messages_get_dialogs_gen.go @@ -68,7 +68,7 @@ type MessagesGetDialogsRequest struct { OffsetPeer InputPeerClass // Number of list elements to be returned Limit int - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_emoji_groups_gen.go b/tg/tl_messages_get_emoji_groups_gen.go index 48760d22e5..ad1cf2a797 100644 --- a/tg/tl_messages_get_emoji_groups_gen.go +++ b/tg/tl_messages_get_emoji_groups_gen.go @@ -32,15 +32,14 @@ var ( ) // MessagesGetEmojiGroupsRequest represents TL type `messages.getEmojiGroups#7488ce5b`. -// Represents a list of emoji categories¹, to be used when selecting custom emojis². +// Represents a list of emoji categories¹. // // Links: -// 1. https://core.telegram.org/api/custom-emoji#emoji-categories -// 2. https://core.telegram.org/api/custom-emoji +// 1. https://core.telegram.org/api/emoji-categories // // See https://core.telegram.org/method/messages.getEmojiGroups for reference. type MessagesGetEmojiGroupsRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation @@ -169,14 +168,12 @@ func (g *MessagesGetEmojiGroupsRequest) GetHash() (value int) { } // MessagesGetEmojiGroups invokes method messages.getEmojiGroups#7488ce5b returning error if any. -// Represents a list of emoji categories¹, to be used when selecting custom emojis². +// Represents a list of emoji categories¹. // // Links: -// 1. https://core.telegram.org/api/custom-emoji#emoji-categories -// 2. https://core.telegram.org/api/custom-emoji +// 1. https://core.telegram.org/api/emoji-categories // // See https://core.telegram.org/method/messages.getEmojiGroups for reference. -// Can be used by bots. func (c *Client) MessagesGetEmojiGroups(ctx context.Context, hash int) (MessagesEmojiGroupsClass, error) { var result MessagesEmojiGroupsBox diff --git a/tg/tl_messages_get_emoji_profile_photo_groups_gen.go b/tg/tl_messages_get_emoji_profile_photo_groups_gen.go index 09d380e88e..0d8b152fdc 100644 --- a/tg/tl_messages_get_emoji_profile_photo_groups_gen.go +++ b/tg/tl_messages_get_emoji_profile_photo_groups_gen.go @@ -36,12 +36,12 @@ var ( // set as profile picture². // // Links: -// 1. https://core.telegram.org/api/custom-emoji#emoji-categories +// 1. https://core.telegram.org/api/emoji-categories // 2. https://core.telegram.org/api/files#sticker-profile-pictures // // See https://core.telegram.org/method/messages.getEmojiProfilePhotoGroups for reference. type MessagesGetEmojiProfilePhotoGroupsRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation @@ -174,11 +174,10 @@ func (g *MessagesGetEmojiProfilePhotoGroupsRequest) GetHash() (value int) { // set as profile picture². // // Links: -// 1. https://core.telegram.org/api/custom-emoji#emoji-categories +// 1. https://core.telegram.org/api/emoji-categories // 2. https://core.telegram.org/api/files#sticker-profile-pictures // // See https://core.telegram.org/method/messages.getEmojiProfilePhotoGroups for reference. -// Can be used by bots. func (c *Client) MessagesGetEmojiProfilePhotoGroups(ctx context.Context, hash int) (MessagesEmojiGroupsClass, error) { var result MessagesEmojiGroupsBox diff --git a/tg/tl_messages_get_emoji_status_groups_gen.go b/tg/tl_messages_get_emoji_status_groups_gen.go index d281320e47..da8b9b7d4a 100644 --- a/tg/tl_messages_get_emoji_status_groups_gen.go +++ b/tg/tl_messages_get_emoji_status_groups_gen.go @@ -36,12 +36,12 @@ var ( // set as custom emoji status². // // Links: -// 1. https://core.telegram.org/api/custom-emoji#emoji-categories +// 1. https://core.telegram.org/api/emoji-categories // 2. https://core.telegram.org/api // // See https://core.telegram.org/method/messages.getEmojiStatusGroups for reference. type MessagesGetEmojiStatusGroupsRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation @@ -174,11 +174,10 @@ func (g *MessagesGetEmojiStatusGroupsRequest) GetHash() (value int) { // set as custom emoji status². // // Links: -// 1. https://core.telegram.org/api/custom-emoji#emoji-categories +// 1. https://core.telegram.org/api/emoji-categories // 2. https://core.telegram.org/api // // See https://core.telegram.org/method/messages.getEmojiStatusGroups for reference. -// Can be used by bots. func (c *Client) MessagesGetEmojiStatusGroups(ctx context.Context, hash int) (MessagesEmojiGroupsClass, error) { var result MessagesEmojiGroupsBox diff --git a/tg/tl_messages_get_emoji_sticker_groups_gen.go b/tg/tl_messages_get_emoji_sticker_groups_gen.go index e71b9662dd..053acbef54 100644 --- a/tg/tl_messages_get_emoji_sticker_groups_gen.go +++ b/tg/tl_messages_get_emoji_sticker_groups_gen.go @@ -32,10 +32,17 @@ var ( ) // MessagesGetEmojiStickerGroupsRequest represents TL type `messages.getEmojiStickerGroups#1dd840f5`. +// Represents a list of emoji categories¹, to be used when choosing a sticker. +// +// Links: +// 1. https://core.telegram.org/api/emoji-categories // // See https://core.telegram.org/method/messages.getEmojiStickerGroups for reference. type MessagesGetEmojiStickerGroupsRequest struct { - // Hash field of MessagesGetEmojiStickerGroupsRequest. + // Hash used for caching, for more info click here¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int } @@ -161,6 +168,10 @@ func (g *MessagesGetEmojiStickerGroupsRequest) GetHash() (value int) { } // MessagesGetEmojiStickerGroups invokes method messages.getEmojiStickerGroups#1dd840f5 returning error if any. +// Represents a list of emoji categories¹, to be used when choosing a sticker. +// +// Links: +// 1. https://core.telegram.org/api/emoji-categories // // See https://core.telegram.org/method/messages.getEmojiStickerGroups for reference. func (c *Client) MessagesGetEmojiStickerGroups(ctx context.Context, hash int) (MessagesEmojiGroupsClass, error) { diff --git a/tg/tl_messages_get_emoji_stickers_gen.go b/tg/tl_messages_get_emoji_stickers_gen.go index 6492c4987b..be8fc91861 100644 --- a/tg/tl_messages_get_emoji_stickers_gen.go +++ b/tg/tl_messages_get_emoji_stickers_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/messages.getEmojiStickers for reference. type MessagesGetEmojiStickersRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_extended_media_gen.go b/tg/tl_messages_get_extended_media_gen.go index 67dae58012..4e7f686a64 100644 --- a/tg/tl_messages_get_extended_media_gen.go +++ b/tg/tl_messages_get_extended_media_gen.go @@ -32,13 +32,20 @@ var ( ) // MessagesGetExtendedMediaRequest represents TL type `messages.getExtendedMedia#84f80814`. -// Get information about extended media +// Fetch updated information about paid media, see here »¹ for the full flow. +// This method will return an array of updateMessageExtendedMedia¹ updates, only for +// messages containing already bought paid media. +// No information will be returned for messages containing not yet bought paid media. +// +// Links: +// 1. https://core.telegram.org/api/paid-media +// 2. https://core.telegram.org/constructor/updateMessageExtendedMedia // // See https://core.telegram.org/method/messages.getExtendedMedia for reference. type MessagesGetExtendedMediaRequest struct { - // Peer + // Peer with visible paid media messages. Peer InputPeerClass - // Message IDs + // IDs of currently visible messages containing paid media. ID []int } @@ -207,7 +214,14 @@ func (g *MessagesGetExtendedMediaRequest) GetID() (value []int) { } // MessagesGetExtendedMedia invokes method messages.getExtendedMedia#84f80814 returning error if any. -// Get information about extended media +// Fetch updated information about paid media, see here »¹ for the full flow. +// This method will return an array of updateMessageExtendedMedia¹ updates, only for +// messages containing already bought paid media. +// No information will be returned for messages containing not yet bought paid media. +// +// Links: +// 1. https://core.telegram.org/api/paid-media +// 2. https://core.telegram.org/constructor/updateMessageExtendedMedia // // See https://core.telegram.org/method/messages.getExtendedMedia for reference. func (c *Client) MessagesGetExtendedMedia(ctx context.Context, request *MessagesGetExtendedMediaRequest) (UpdatesClass, error) { diff --git a/tg/tl_messages_get_fact_check_gen.go b/tg/tl_messages_get_fact_check_gen.go index 5daeded415..48bc2a9be9 100644 --- a/tg/tl_messages_get_fact_check_gen.go +++ b/tg/tl_messages_get_fact_check_gen.go @@ -32,12 +32,19 @@ var ( ) // MessagesGetFactCheckRequest represents TL type `messages.getFactCheck#b9cdc5ee`. +// Fetch one or more factchecks, see here »¹ for the full flow. +// +// Links: +// 1. https://core.telegram.org/api/factcheck // // See https://core.telegram.org/method/messages.getFactCheck for reference. type MessagesGetFactCheckRequest struct { - // Peer field of MessagesGetFactCheckRequest. + // Peer where the messages were sent. Peer InputPeerClass - // MsgID field of MessagesGetFactCheckRequest. + // Messages that have associated factCheck¹ constructors with the need_check flag set. + // + // Links: + // 1) https://core.telegram.org/constructor/factCheck MsgID []int } @@ -206,6 +213,14 @@ func (g *MessagesGetFactCheckRequest) GetMsgID() (value []int) { } // MessagesGetFactCheck invokes method messages.getFactCheck#b9cdc5ee returning error if any. +// Fetch one or more factchecks, see here »¹ for the full flow. +// +// Links: +// 1. https://core.telegram.org/api/factcheck +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.getFactCheck for reference. func (c *Client) MessagesGetFactCheck(ctx context.Context, request *MessagesGetFactCheckRequest) ([]FactCheck, error) { diff --git a/tg/tl_messages_get_faved_stickers_gen.go b/tg/tl_messages_get_faved_stickers_gen.go index fac247c8f2..bdd98b4ca4 100644 --- a/tg/tl_messages_get_faved_stickers_gen.go +++ b/tg/tl_messages_get_faved_stickers_gen.go @@ -36,7 +36,7 @@ var ( // // See https://core.telegram.org/method/messages.getFavedStickers for reference. type MessagesGetFavedStickersRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_featured_emoji_stickers_gen.go b/tg/tl_messages_get_featured_emoji_stickers_gen.go index 4f039938d6..c5eb676ff1 100644 --- a/tg/tl_messages_get_featured_emoji_stickers_gen.go +++ b/tg/tl_messages_get_featured_emoji_stickers_gen.go @@ -36,7 +36,7 @@ var ( // // See https://core.telegram.org/method/messages.getFeaturedEmojiStickers for reference. type MessagesGetFeaturedEmojiStickersRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_featured_stickers_gen.go b/tg/tl_messages_get_featured_stickers_gen.go index 9050916e3c..53fc535c1a 100644 --- a/tg/tl_messages_get_featured_stickers_gen.go +++ b/tg/tl_messages_get_featured_stickers_gen.go @@ -36,7 +36,7 @@ var ( // // See https://core.telegram.org/method/messages.getFeaturedStickers for reference. type MessagesGetFeaturedStickersRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_mask_stickers_gen.go b/tg/tl_messages_get_mask_stickers_gen.go index 77c1601779..0b5aa7ea21 100644 --- a/tg/tl_messages_get_mask_stickers_gen.go +++ b/tg/tl_messages_get_mask_stickers_gen.go @@ -36,7 +36,7 @@ var ( // // See https://core.telegram.org/method/messages.getMaskStickers for reference. type MessagesGetMaskStickersRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_message_read_participants_gen.go b/tg/tl_messages_get_message_read_participants_gen.go index c98d990111..bd053af29a 100644 --- a/tg/tl_messages_get_message_read_participants_gen.go +++ b/tg/tl_messages_get_message_read_participants_gen.go @@ -214,7 +214,7 @@ func (g *MessagesGetMessageReadParticipantsRequest) GetMsgID() (value int) { // // Possible errors: // -// 400 CHAT_TOO_BIG: This method is not available for groups with more than chat_read_mark_size_threshold members, see client configuration ». +// 400 CHAT_TOO_BIG: This method is not available for groups with more than chat_read_mark_size_threshold members, see client configuration ». // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 MSG_TOO_OLD: chat_read_mark_expire_period seconds have passed since the message was sent, read receipts were deleted. // 400 PEER_ID_INVALID: The provided peer id is invalid. diff --git a/tg/tl_messages_get_messages_reactions_gen.go b/tg/tl_messages_get_messages_reactions_gen.go index 593d34ce55..bd11c247ea 100644 --- a/tg/tl_messages_get_messages_reactions_gen.go +++ b/tg/tl_messages_get_messages_reactions_gen.go @@ -217,6 +217,7 @@ func (g *MessagesGetMessagesReactionsRequest) GetID() (value []int) { // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // // See https://core.telegram.org/method/messages.getMessagesReactions for reference. diff --git a/tg/tl_messages_get_my_stickers_gen.go b/tg/tl_messages_get_my_stickers_gen.go index e7086a5b02..3094546724 100644 --- a/tg/tl_messages_get_my_stickers_gen.go +++ b/tg/tl_messages_get_my_stickers_gen.go @@ -32,12 +32,22 @@ var ( ) // MessagesGetMyStickersRequest represents TL type `messages.getMyStickers#d0b5e1fc`. +// Fetch all stickersets »¹ owned by the current user. +// +// Links: +// 1. https://core.telegram.org/api/stickers // // See https://core.telegram.org/method/messages.getMyStickers for reference. type MessagesGetMyStickersRequest struct { - // OffsetID field of MessagesGetMyStickersRequest. + // Offsets for pagination, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets OffsetID int64 - // Limit field of MessagesGetMyStickersRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -188,6 +198,10 @@ func (g *MessagesGetMyStickersRequest) GetLimit() (value int) { } // MessagesGetMyStickers invokes method messages.getMyStickers#d0b5e1fc returning error if any. +// Fetch all stickersets »¹ owned by the current user. +// +// Links: +// 1. https://core.telegram.org/api/stickers // // See https://core.telegram.org/method/messages.getMyStickers for reference. func (c *Client) MessagesGetMyStickers(ctx context.Context, request *MessagesGetMyStickersRequest) (*MessagesMyStickers, error) { diff --git a/tg/tl_messages_get_old_featured_stickers_gen.go b/tg/tl_messages_get_old_featured_stickers_gen.go index 2321a08395..bd7970f5eb 100644 --- a/tg/tl_messages_get_old_featured_stickers_gen.go +++ b/tg/tl_messages_get_old_featured_stickers_gen.go @@ -43,7 +43,7 @@ type MessagesGetOldFeaturedStickersRequest struct { // Links: // 1) https://core.telegram.org/api/offsets Limit int - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_outbox_read_date_gen.go b/tg/tl_messages_get_outbox_read_date_gen.go index 7e5941b96f..31cdea9589 100644 --- a/tg/tl_messages_get_outbox_read_date_gen.go +++ b/tg/tl_messages_get_outbox_read_date_gen.go @@ -32,12 +32,30 @@ var ( ) // MessagesGetOutboxReadDateRequest represents TL type `messages.getOutboxReadDate#8c4bfe5d`. +// Get the exact read date of one of our messages, sent to a private chat with another +// user. +// Can be only done for private outgoing messages not older than appConfig +// pm_read_date_expire_period »¹. +// If the peer's userFull¹.read_dates_private flag is set, we will not be able to fetch +// the exact read date of messages we send to them, and a USER_PRIVACY_RESTRICTED RPC +// error will be emitted. +// The exact read date of messages might still be unavailable for other reasons, see here +// »² for more info. +// To set userFull³.read_dates_private for ourselves invoke account +// setGlobalPrivacySettings⁴, setting the settings.hide_read_marks flag. +// +// Links: +// 1. https://core.telegram.org/api/config#pm-read-date-expire-period +// 2. https://core.telegram.org/constructor/userFull +// 3. https://core.telegram.org/constructor/globalPrivacySettings +// 4. https://core.telegram.org/constructor/userFull +// 5. https://core.telegram.org/method/account.setGlobalPrivacySettings // // See https://core.telegram.org/method/messages.getOutboxReadDate for reference. type MessagesGetOutboxReadDateRequest struct { - // Peer field of MessagesGetOutboxReadDateRequest. + // The user to whom we sent the message. Peer InputPeerClass - // MsgID field of MessagesGetOutboxReadDateRequest. + // The message ID. MsgID int } @@ -193,6 +211,33 @@ func (g *MessagesGetOutboxReadDateRequest) GetMsgID() (value int) { } // MessagesGetOutboxReadDate invokes method messages.getOutboxReadDate#8c4bfe5d returning error if any. +// Get the exact read date of one of our messages, sent to a private chat with another +// user. +// Can be only done for private outgoing messages not older than appConfig +// pm_read_date_expire_period »¹. +// If the peer's userFull¹.read_dates_private flag is set, we will not be able to fetch +// the exact read date of messages we send to them, and a USER_PRIVACY_RESTRICTED RPC +// error will be emitted. +// The exact read date of messages might still be unavailable for other reasons, see here +// »² for more info. +// To set userFull³.read_dates_private for ourselves invoke account +// setGlobalPrivacySettings⁴, setting the settings.hide_read_marks flag. +// +// Links: +// 1. https://core.telegram.org/api/config#pm-read-date-expire-period +// 2. https://core.telegram.org/constructor/userFull +// 3. https://core.telegram.org/constructor/globalPrivacySettings +// 4. https://core.telegram.org/constructor/userFull +// 5. https://core.telegram.org/method/account.setGlobalPrivacySettings +// +// Possible errors: +// +// 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 MESSAGE_NOT_READ_YET: The specified message wasn't read yet. +// 400 MESSAGE_TOO_OLD: The message is too old, the requested information is not available. +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 403 USER_PRIVACY_RESTRICTED: The user's privacy settings do not allow you to do this. +// 403 YOUR_PRIVACY_RESTRICTED: You cannot fetch the read date of this message because you have disallowed other users to do so for your messages; to fix, allow other users to see your exact last online date OR purchase a Telegram Premium subscription. // // See https://core.telegram.org/method/messages.getOutboxReadDate for reference. func (c *Client) MessagesGetOutboxReadDate(ctx context.Context, request *MessagesGetOutboxReadDateRequest) (*OutboxReadDate, error) { diff --git a/tg/tl_messages_get_quick_replies_gen.go b/tg/tl_messages_get_quick_replies_gen.go index f130682c59..f1d883137c 100644 --- a/tg/tl_messages_get_quick_replies_gen.go +++ b/tg/tl_messages_get_quick_replies_gen.go @@ -32,10 +32,18 @@ var ( ) // MessagesGetQuickRepliesRequest represents TL type `messages.getQuickReplies#d483f2a8`. +// Fetch basic info about all existing quick reply shortcuts¹. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/method/messages.getQuickReplies for reference. type MessagesGetQuickRepliesRequest struct { - // Hash field of MessagesGetQuickRepliesRequest. + // Hash for pagination, generated as specified here »¹ (not the usual algorithm used + // for hash generation.) + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts Hash int64 } @@ -161,6 +169,10 @@ func (g *MessagesGetQuickRepliesRequest) GetHash() (value int64) { } // MessagesGetQuickReplies invokes method messages.getQuickReplies#d483f2a8 returning error if any. +// Fetch basic info about all existing quick reply shortcuts¹. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/method/messages.getQuickReplies for reference. func (c *Client) MessagesGetQuickReplies(ctx context.Context, hash int64) (MessagesQuickRepliesClass, error) { diff --git a/tg/tl_messages_get_quick_reply_messages_gen.go b/tg/tl_messages_get_quick_reply_messages_gen.go index bcd2fbba52..560d3e98f9 100644 --- a/tg/tl_messages_get_quick_reply_messages_gen.go +++ b/tg/tl_messages_get_quick_reply_messages_gen.go @@ -32,18 +32,28 @@ var ( ) // MessagesGetQuickReplyMessagesRequest represents TL type `messages.getQuickReplyMessages#94a495c3`. +// Fetch (a subset or all) messages in a quick reply shortcut »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/method/messages.getQuickReplyMessages for reference. type MessagesGetQuickReplyMessagesRequest struct { - // Flags field of MessagesGetQuickReplyMessagesRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ShortcutID field of MessagesGetQuickReplyMessagesRequest. + // Quick reply shortcut ID. ShortcutID int - // ID field of MessagesGetQuickReplyMessagesRequest. + // IDs of the messages to fetch, if empty fetches all of them. // // Use SetID and GetID helpers. ID []int - // Hash field of MessagesGetQuickReplyMessagesRequest. + // Hash used for caching, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 } @@ -267,6 +277,14 @@ func (g *MessagesGetQuickReplyMessagesRequest) GetHash() (value int64) { } // MessagesGetQuickReplyMessages invokes method messages.getQuickReplyMessages#94a495c3 returning error if any. +// Fetch (a subset or all) messages in a quick reply shortcut »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts +// +// Possible errors: +// +// 400 SHORTCUT_INVALID: The specified shortcut is invalid. // // See https://core.telegram.org/method/messages.getQuickReplyMessages for reference. func (c *Client) MessagesGetQuickReplyMessages(ctx context.Context, request *MessagesGetQuickReplyMessagesRequest) (MessagesMessagesClass, error) { diff --git a/tg/tl_messages_get_recent_locations_gen.go b/tg/tl_messages_get_recent_locations_gen.go index 4e2f2dcfff..07d8d8570e 100644 --- a/tg/tl_messages_get_recent_locations_gen.go +++ b/tg/tl_messages_get_recent_locations_gen.go @@ -43,7 +43,7 @@ type MessagesGetRecentLocationsRequest struct { // Links: // 1) https://core.telegram.org/api/offsets Limit int - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_recent_reactions_gen.go b/tg/tl_messages_get_recent_reactions_gen.go index dc32dd22ed..4d6eeab1f7 100644 --- a/tg/tl_messages_get_recent_reactions_gen.go +++ b/tg/tl_messages_get_recent_reactions_gen.go @@ -44,7 +44,7 @@ type MessagesGetRecentReactionsRequest struct { // Links: // 1) https://core.telegram.org/api/offsets Limit int - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_recent_stickers_gen.go b/tg/tl_messages_get_recent_stickers_gen.go index 4a5119c233..a90dfbf647 100644 --- a/tg/tl_messages_get_recent_stickers_gen.go +++ b/tg/tl_messages_get_recent_stickers_gen.go @@ -43,7 +43,7 @@ type MessagesGetRecentStickersRequest struct { Flags bin.Fields // Get stickers recently attached to photo or video files Attached bool - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_replies_gen.go b/tg/tl_messages_get_replies_gen.go index 8961d8a64e..314b2d6762 100644 --- a/tg/tl_messages_get_replies_gen.go +++ b/tg/tl_messages_get_replies_gen.go @@ -66,7 +66,7 @@ type MessagesGetRepliesRequest struct { // If a positive value was transferred, the method will return only messages with ID // bigger than min_id MinID int - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_saved_dialogs_gen.go b/tg/tl_messages_get_saved_dialogs_gen.go index 75d89a9929..2a213e3a13 100644 --- a/tg/tl_messages_get_saved_dialogs_gen.go +++ b/tg/tl_messages_get_saved_dialogs_gen.go @@ -64,7 +64,7 @@ type MessagesGetSavedDialogsRequest struct { OffsetPeer InputPeerClass // Number of list elements to be returned Limit int - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_saved_gifs_gen.go b/tg/tl_messages_get_saved_gifs_gen.go index d381bd56db..40dd8c2f2f 100644 --- a/tg/tl_messages_get_saved_gifs_gen.go +++ b/tg/tl_messages_get_saved_gifs_gen.go @@ -32,11 +32,11 @@ var ( ) // MessagesGetSavedGifsRequest represents TL type `messages.getSavedGifs#5cf09635`. -// Get saved GIFs +// Get saved GIFs. // // See https://core.telegram.org/method/messages.getSavedGifs for reference. type MessagesGetSavedGifsRequest struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation @@ -165,7 +165,7 @@ func (g *MessagesGetSavedGifsRequest) GetHash() (value int64) { } // MessagesGetSavedGifs invokes method messages.getSavedGifs#5cf09635 returning error if any. -// Get saved GIFs +// Get saved GIFs. // // See https://core.telegram.org/method/messages.getSavedGifs for reference. func (c *Client) MessagesGetSavedGifs(ctx context.Context, hash int64) (MessagesSavedGifsClass, error) { diff --git a/tg/tl_messages_get_saved_reaction_tags_gen.go b/tg/tl_messages_get_saved_reaction_tags_gen.go index 3151f98704..d1fd261404 100644 --- a/tg/tl_messages_get_saved_reaction_tags_gen.go +++ b/tg/tl_messages_get_saved_reaction_tags_gen.go @@ -32,16 +32,29 @@ var ( ) // MessagesGetSavedReactionTagsRequest represents TL type `messages.getSavedReactionTags#3637e05b`. +// Fetch the full list of saved message tags¹ created by the user. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages#tags // // See https://core.telegram.org/method/messages.getSavedReactionTags for reference. type MessagesGetSavedReactionTagsRequest struct { - // Flags field of MessagesGetSavedReactionTagsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Peer field of MessagesGetSavedReactionTagsRequest. + // If set, returns tags only used in the specified saved message dialog¹. + // + // Links: + // 1) https://core.telegram.org/api/saved-messages#saved-message-dialogs // // Use SetPeer and GetPeer helpers. Peer InputPeerClass - // Hash field of MessagesGetSavedReactionTagsRequest. + // Hash used for caching, for more info click here¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 } @@ -232,6 +245,10 @@ func (g *MessagesGetSavedReactionTagsRequest) GetHash() (value int64) { } // MessagesGetSavedReactionTags invokes method messages.getSavedReactionTags#3637e05b returning error if any. +// Fetch the full list of saved message tags¹ created by the user. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages#tags // // See https://core.telegram.org/method/messages.getSavedReactionTags for reference. func (c *Client) MessagesGetSavedReactionTags(ctx context.Context, request *MessagesGetSavedReactionTagsRequest) (MessagesSavedReactionTagsClass, error) { diff --git a/tg/tl_messages_get_scheduled_history_gen.go b/tg/tl_messages_get_scheduled_history_gen.go index 8d99e8f8e8..d76ab40464 100644 --- a/tg/tl_messages_get_scheduled_history_gen.go +++ b/tg/tl_messages_get_scheduled_history_gen.go @@ -38,7 +38,9 @@ var ( type MessagesGetScheduledHistoryRequest struct { // Peer Peer InputPeerClass - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. To generate the hash, populate the + // ids array with the id, date and edit_date (in this order) of the previously returned + // messages (in order, i.e. ids = [id1, date1, edit_date1, id2, date2, edit_date2, ...]). // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_search_results_calendar_gen.go b/tg/tl_messages_get_search_results_calendar_gen.go index 6a7cd49f38..6358cf1d45 100644 --- a/tg/tl_messages_get_search_results_calendar_gen.go +++ b/tg/tl_messages_get_search_results_calendar_gen.go @@ -352,6 +352,7 @@ func (g *MessagesGetSearchResultsCalendarRequest) GetOffsetDate() (value int) { // Possible errors: // // 400 FILTER_NOT_SUPPORTED: The specified filter cannot be used in this context. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.getSearchResultsCalendar for reference. func (c *Client) MessagesGetSearchResultsCalendar(ctx context.Context, request *MessagesGetSearchResultsCalendarRequest) (*MessagesSearchResultsCalendar, error) { diff --git a/tg/tl_messages_get_search_results_positions_gen.go b/tg/tl_messages_get_search_results_positions_gen.go index b7cc17eaa5..cec6ec6047 100644 --- a/tg/tl_messages_get_search_results_positions_gen.go +++ b/tg/tl_messages_get_search_results_positions_gen.go @@ -349,6 +349,10 @@ func (g *MessagesGetSearchResultsPositionsRequest) GetLimit() (value int) { // Returns the results in reverse chronological order (i.e., in order of decreasing // message_id). // +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// // See https://core.telegram.org/method/messages.getSearchResultsPositions for reference. func (c *Client) MessagesGetSearchResultsPositions(ctx context.Context, request *MessagesGetSearchResultsPositionsRequest) (*MessagesSearchResultsPositions, error) { var result MessagesSearchResultsPositions diff --git a/tg/tl_messages_get_sticker_set_gen.go b/tg/tl_messages_get_sticker_set_gen.go index 52b5fb06fc..0da828b455 100644 --- a/tg/tl_messages_get_sticker_set_gen.go +++ b/tg/tl_messages_get_sticker_set_gen.go @@ -38,7 +38,7 @@ var ( type MessagesGetStickerSetRequest struct { // Stickerset Stickerset InputStickerSetClass - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_stickers_gen.go b/tg/tl_messages_get_stickers_gen.go index 709009b3be..63cc5f2d45 100644 --- a/tg/tl_messages_get_stickers_gen.go +++ b/tg/tl_messages_get_stickers_gen.go @@ -38,7 +38,7 @@ var ( type MessagesGetStickersRequest struct { // The emoji Emoticon string - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_top_reactions_gen.go b/tg/tl_messages_get_top_reactions_gen.go index 36c6906545..378e2e024f 100644 --- a/tg/tl_messages_get_top_reactions_gen.go +++ b/tg/tl_messages_get_top_reactions_gen.go @@ -44,7 +44,7 @@ type MessagesGetTopReactionsRequest struct { // Links: // 1) https://core.telegram.org/api/offsets Limit int - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_unread_reactions_gen.go b/tg/tl_messages_get_unread_reactions_gen.go index 80caf41801..f6202c06f3 100644 --- a/tg/tl_messages_get_unread_reactions_gen.go +++ b/tg/tl_messages_get_unread_reactions_gen.go @@ -385,6 +385,10 @@ func (g *MessagesGetUnreadReactionsRequest) GetMinID() (value int) { // MessagesGetUnreadReactions invokes method messages.getUnreadReactions#3223495b returning error if any. // Get unread reactions to messages you sent // +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// // See https://core.telegram.org/method/messages.getUnreadReactions for reference. func (c *Client) MessagesGetUnreadReactions(ctx context.Context, request *MessagesGetUnreadReactionsRequest) (MessagesMessagesClass, error) { var result MessagesMessagesBox diff --git a/tg/tl_messages_get_web_page_gen.go b/tg/tl_messages_get_web_page_gen.go index fe59f1a173..cae47b922f 100644 --- a/tg/tl_messages_get_web_page_gen.go +++ b/tg/tl_messages_get_web_page_gen.go @@ -41,10 +41,15 @@ var ( type MessagesGetWebPageRequest struct { // URL of IV page to fetch URL string - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. Note: the usual hash generation + // algorithm cannot be used in this case, please re-use the webPage².hash field returned + // by a previous call to the method, or pass 0 if this is the first call or if the + // previous call did not return a webPage³. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation + // 2) https://core.telegram.org/constructor/webPage + // 3) https://core.telegram.org/constructor/webPage Hash int } diff --git a/tg/tl_messages_get_web_page_preview_gen.go b/tg/tl_messages_get_web_page_preview_gen.go index dc9d8e14b8..aac956940f 100644 --- a/tg/tl_messages_get_web_page_preview_gen.go +++ b/tg/tl_messages_get_web_page_preview_gen.go @@ -264,7 +264,7 @@ func (g *MessagesGetWebPagePreviewRequest) MapEntities() (value MessageEntityCla // // Possible errors: // -// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. +// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. // 400 MESSAGE_EMPTY: The provided message is empty. // // See https://core.telegram.org/method/messages.getWebPagePreview for reference. diff --git a/tg/tl_messages_hide_peer_settings_bar_gen.go b/tg/tl_messages_hide_peer_settings_bar_gen.go index 3ee9f73d1c..390946b43e 100644 --- a/tg/tl_messages_hide_peer_settings_bar_gen.go +++ b/tg/tl_messages_hide_peer_settings_bar_gen.go @@ -181,6 +181,10 @@ func (h *MessagesHidePeerSettingsBarRequest) GetPeer() (value InputPeerClass) { // 1. https://core.telegram.org/api/action-bar // 2. https://core.telegram.org/api/action-bar // +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// // See https://core.telegram.org/method/messages.hidePeerSettingsBar for reference. func (c *Client) MessagesHidePeerSettingsBar(ctx context.Context, peer InputPeerClass) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_init_history_import_gen.go b/tg/tl_messages_init_history_import_gen.go index 8855ac458c..a9fddad8f0 100644 --- a/tg/tl_messages_init_history_import_gen.go +++ b/tg/tl_messages_init_history_import_gen.go @@ -245,8 +245,11 @@ func (i *MessagesInitHistoryImportRequest) GetMediaCount() (value int) { // // Possible errors: // +// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 IMPORT_FILE_INVALID: The specified chat export file is invalid. +// 400 IMPORT_FORMAT_DATE_INVALID: The date specified in the import file is invalid. // 400 IMPORT_FORMAT_UNRECOGNIZED: The specified chat export file was exported from an unsupported chat app. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // 406 PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_%dMIN: Import for this chat is already in progress, wait %d minutes before starting a new one. // // See https://core.telegram.org/method/messages.initHistoryImport for reference. diff --git a/tg/tl_messages_invited_users_gen.go b/tg/tl_messages_invited_users_gen.go index 2d7e34cf7a..9f079084bf 100644 --- a/tg/tl_messages_invited_users_gen.go +++ b/tg/tl_messages_invited_users_gen.go @@ -32,12 +32,18 @@ var ( ) // MessagesInvitedUsers represents TL type `messages.invitedUsers#7f5defa6`. +// Contains info about successfully or unsuccessfully invited »¹ users. +// +// Links: +// 1. https://core.telegram.org/api/invites#direct-invites // // See https://core.telegram.org/constructor/messages.invitedUsers for reference. type MessagesInvitedUsers struct { - // Updates field of MessagesInvitedUsers. + // List of updates about successfully invited users (and eventually info about the + // created group) Updates UpdatesClass - // MissingInvitees field of MessagesInvitedUsers. + // A list of users that could not be invited, along with the reason why they couldn't be + // invited. MissingInvitees []MissingInvitee } diff --git a/tg/tl_messages_my_stickers_gen.go b/tg/tl_messages_my_stickers_gen.go index b41655d16b..adf0e9cf85 100644 --- a/tg/tl_messages_my_stickers_gen.go +++ b/tg/tl_messages_my_stickers_gen.go @@ -32,12 +32,16 @@ var ( ) // MessagesMyStickers represents TL type `messages.myStickers#faff629d`. +// The list of stickersets owned by the current account »¹. +// +// Links: +// 1. https://core.telegram.org/api/stickers // // See https://core.telegram.org/constructor/messages.myStickers for reference. type MessagesMyStickers struct { - // Count field of MessagesMyStickers. + // Total number of owned stickersets. Count int - // Sets field of MessagesMyStickers. + // Stickersets Sets []StickerSetCoveredClass } diff --git a/tg/tl_messages_prolong_web_view_gen.go b/tg/tl_messages_prolong_web_view_gen.go index 5a9ee79275..e7e4212911 100644 --- a/tg/tl_messages_prolong_web_view_gen.go +++ b/tg/tl_messages_prolong_web_view_gen.go @@ -408,6 +408,10 @@ func (p *MessagesProlongWebViewRequest) GetSendAs() (value InputPeerClass, ok bo // Indicate to the server (from the user side) that the user is still using a web app. // If the method returns a QUERY_ID_INVALID error, the webview must be closed. // +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. +// // See https://core.telegram.org/method/messages.prolongWebView for reference. func (c *Client) MessagesProlongWebView(ctx context.Context, request *MessagesProlongWebViewRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_quick_replies_gen.go b/tg/tl_messages_quick_replies_gen.go index 6557c1ac39..a6f6dad03d 100644 --- a/tg/tl_messages_quick_replies_gen.go +++ b/tg/tl_messages_quick_replies_gen.go @@ -32,16 +32,20 @@ var ( ) // MessagesQuickReplies represents TL type `messages.quickReplies#c68d6695`. +// Info about quick reply shortcuts »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/constructor/messages.quickReplies for reference. type MessagesQuickReplies struct { - // QuickReplies field of MessagesQuickReplies. + // Quick reply shortcuts. QuickReplies []QuickReply - // Messages field of MessagesQuickReplies. + // Messages mentioned in quick_replies. Messages []MessageClass - // Chats field of MessagesQuickReplies. + // Mentioned chats Chats []ChatClass - // Users field of MessagesQuickReplies. + // Mentioned users Users []UserClass } @@ -331,6 +335,10 @@ func (q *MessagesQuickReplies) MapUsers() (value UserClassArray) { } // MessagesQuickRepliesNotModified represents TL type `messages.quickRepliesNotModified#5f91eb5b`. +// Info about quick reply shortcuts »¹ hasn't changed. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/constructor/messages.quickRepliesNotModified for reference. type MessagesQuickRepliesNotModified struct { diff --git a/tg/tl_messages_reactions_gen.go b/tg/tl_messages_reactions_gen.go index 92a27284f1..cb3fcb2527 100644 --- a/tg/tl_messages_reactions_gen.go +++ b/tg/tl_messages_reactions_gen.go @@ -144,7 +144,7 @@ func (r *MessagesReactionsNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/messages.reactions for reference. type MessagesReactions struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_read_encrypted_history_gen.go b/tg/tl_messages_read_encrypted_history_gen.go index b8faf048e5..c908188093 100644 --- a/tg/tl_messages_read_encrypted_history_gen.go +++ b/tg/tl_messages_read_encrypted_history_gen.go @@ -193,6 +193,7 @@ func (r *MessagesReadEncryptedHistoryRequest) GetMaxDate() (value int) { // // Possible errors: // +// 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 MAX_DATE_INVALID: The specified maximum date is invalid. // 400 MSG_WAIT_FAILED: A waiting call returned an error. // diff --git a/tg/tl_messages_recent_stickers_gen.go b/tg/tl_messages_recent_stickers_gen.go index c8e0e066a6..43ff94e24a 100644 --- a/tg/tl_messages_recent_stickers_gen.go +++ b/tg/tl_messages_recent_stickers_gen.go @@ -138,7 +138,7 @@ func (r *MessagesRecentStickersNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/messages.recentStickers for reference. type MessagesRecentStickers struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_reorder_quick_replies_gen.go b/tg/tl_messages_reorder_quick_replies_gen.go index e768743f1e..fff6ca3c6c 100644 --- a/tg/tl_messages_reorder_quick_replies_gen.go +++ b/tg/tl_messages_reorder_quick_replies_gen.go @@ -32,10 +32,19 @@ var ( ) // MessagesReorderQuickRepliesRequest represents TL type `messages.reorderQuickReplies#60331907`. +// Reorder quick reply shortcuts¹. +// This will emit an updateQuickReplies¹ update to other logged-in sessions. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts +// 2. https://core.telegram.org/constructor/updateQuickReplies // // See https://core.telegram.org/method/messages.reorderQuickReplies for reference. type MessagesReorderQuickRepliesRequest struct { - // Order field of MessagesReorderQuickRepliesRequest. + // IDs of all created quick reply shortcuts¹, in the desired order. + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts Order []int } @@ -174,6 +183,16 @@ func (r *MessagesReorderQuickRepliesRequest) GetOrder() (value []int) { } // MessagesReorderQuickReplies invokes method messages.reorderQuickReplies#60331907 returning error if any. +// Reorder quick reply shortcuts¹. +// This will emit an updateQuickReplies¹ update to other logged-in sessions. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts +// 2. https://core.telegram.org/constructor/updateQuickReplies +// +// Possible errors: +// +// 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // // See https://core.telegram.org/method/messages.reorderQuickReplies for reference. func (c *Client) MessagesReorderQuickReplies(ctx context.Context, order []int) (bool, error) { diff --git a/tg/tl_messages_report_reaction_gen.go b/tg/tl_messages_report_reaction_gen.go index b4d96bf3a4..a6b920bf3f 100644 --- a/tg/tl_messages_report_reaction_gen.go +++ b/tg/tl_messages_report_reaction_gen.go @@ -237,6 +237,7 @@ func (r *MessagesReportReactionRequest) GetReactionPeer() (value InputPeerClass) // Possible errors: // // 400 MSG_ID_INVALID: Invalid message ID provided. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/messages.reportReaction for reference. diff --git a/tg/tl_messages_request_app_web_view_gen.go b/tg/tl_messages_request_app_web_view_gen.go index 80aacf2170..97542e8e28 100644 --- a/tg/tl_messages_request_app_web_view_gen.go +++ b/tg/tl_messages_request_app_web_view_gen.go @@ -55,7 +55,12 @@ type MessagesRequestAppWebViewRequest struct { // Links: // 1) https://core.telegram.org/api/links#direct-mini-app-links WriteAllowed bool - // Compact field of MessagesRequestAppWebViewRequest. + // If set, requests to open the mini app in compact mode (as opposed to fullview mode). + // Must be set if the mode parameter of the direct Mini App deep link¹ is equal to + // compact. + // + // Links: + // 1) https://core.telegram.org/api/links#direct-mini-app-links Compact bool // If the client has clicked on the link in a Telegram chat, pass the chat's peer // information; otherwise pass the bot's peer information, instead. diff --git a/tg/tl_messages_request_main_web_view_gen.go b/tg/tl_messages_request_main_web_view_gen.go index ad95d3b86f..b3c654930a 100644 --- a/tg/tl_messages_request_main_web_view_gen.go +++ b/tg/tl_messages_request_main_web_view_gen.go @@ -32,26 +32,46 @@ var ( ) // MessagesRequestMainWebViewRequest represents TL type `messages.requestMainWebView#c9e01e7b`. +// Open a Main Mini App¹. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-apps // // See https://core.telegram.org/method/messages.requestMainWebView for reference. type MessagesRequestMainWebViewRequest struct { - // Flags field of MessagesRequestMainWebViewRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Compact field of MessagesRequestMainWebViewRequest. + // If set, requests to open the mini app in compact mode (as opposed to fullview mode). + // Must be set if the mode parameter of the Main Mini App link¹ is equal to compact. + // + // Links: + // 1) https://core.telegram.org/api/links#main-mini-app-links Compact bool - // Peer field of MessagesRequestMainWebViewRequest. + // Currently open chat, may be inputPeerEmpty¹ if no chat is currently open. + // + // Links: + // 1) https://core.telegram.org/constructor/inputPeerEmpty Peer InputPeerClass - // Bot field of MessagesRequestMainWebViewRequest. + // Bot that owns the main mini app. Bot InputUserClass - // StartParam field of MessagesRequestMainWebViewRequest. + // Start parameter, if opening from a Main Mini App link »¹. + // + // Links: + // 1) https://core.telegram.org/api/links#main-mini-app-links // // Use SetStartParam and GetStartParam helpers. StartParam string - // ThemeParams field of MessagesRequestMainWebViewRequest. + // Theme parameters »¹ + // + // Links: + // 1) https://core.telegram.org/api/bots/webapps#theme-parameters // // Use SetThemeParams and GetThemeParams helpers. ThemeParams DataJSON - // Platform field of MessagesRequestMainWebViewRequest. + // Short name of the application; 0-64 English letters, digits, and underscores Platform string } @@ -374,6 +394,14 @@ func (r *MessagesRequestMainWebViewRequest) GetPlatform() (value string) { } // MessagesRequestMainWebView invokes method messages.requestMainWebView#c9e01e7b returning error if any. +// Open a Main Mini App¹. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-apps +// +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. // // See https://core.telegram.org/method/messages.requestMainWebView for reference. func (c *Client) MessagesRequestMainWebView(ctx context.Context, request *MessagesRequestMainWebViewRequest) (*WebViewResultURL, error) { diff --git a/tg/tl_messages_request_simple_web_view_gen.go b/tg/tl_messages_request_simple_web_view_gen.go index 6d88d2f136..a32c04ae68 100644 --- a/tg/tl_messages_request_simple_web_view_gen.go +++ b/tg/tl_messages_request_simple_web_view_gen.go @@ -50,14 +50,12 @@ type MessagesRequestSimpleWebViewRequest struct { // Links: // 1) https://core.telegram.org/method/messages.getInlineBotResults FromSwitchWebview bool - // Set this flag if opening the Mini App from the installed side menu entry »¹ or from - // a Mini App link »². + // Set this flag if opening the Mini App from the installed side menu entry »¹. // // Links: // 1) https://core.telegram.org/api/bots/attach - // 2) https://core.telegram.org/api/links#mini-app-links FromSideMenu bool - // Compact field of MessagesRequestSimpleWebViewRequest. + // Deprecated. Compact bool // Bot that owns the mini app Bot InputUserClass @@ -65,10 +63,7 @@ type MessagesRequestSimpleWebViewRequest struct { // // Use SetURL and GetURL helpers. URL string - // Start parameter, if opening from a Mini App link »¹. - // - // Links: - // 1) https://core.telegram.org/api/links#mini-app-links + // Deprecated. // // Use SetStartParam and GetStartParam helpers. StartParam string @@ -487,6 +482,11 @@ func (r *MessagesRequestSimpleWebViewRequest) GetPlatform() (value string) { // Links: // 1. https://core.telegram.org/api/bots/webapps // +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. +// 400 URL_INVALID: Invalid URL provided. +// // See https://core.telegram.org/method/messages.requestSimpleWebView for reference. func (c *Client) MessagesRequestSimpleWebView(ctx context.Context, request *MessagesRequestSimpleWebViewRequest) (*WebViewResultURL, error) { var result WebViewResultURL diff --git a/tg/tl_messages_request_web_view_gen.go b/tg/tl_messages_request_web_view_gen.go index 9512c4d98d..d57be1657b 100644 --- a/tg/tl_messages_request_web_view_gen.go +++ b/tg/tl_messages_request_web_view_gen.go @@ -59,7 +59,12 @@ type MessagesRequestWebViewRequest struct { // Links: // 1) https://core.telegram.org/method/messages.sendWebViewResultMessage Silent bool - // Compact field of MessagesRequestWebViewRequest. + // If set, requests to open the mini app in compact mode (as opposed to fullview mode). + // Must be set if the mode parameter of the attachment menu deep link¹ is equal to + // compact. + // + // Links: + // 1) https://core.telegram.org/api/links#bot-attachment-or-side-menu-links Compact bool // Dialog where the web app is being opened, and where the resulting message will be sent // (see the docs for more info »¹). @@ -652,7 +657,10 @@ func (r *MessagesRequestWebViewRequest) GetSendAs() (value InputPeerClass, ok bo // 400 BOT_INVALID: This is not a valid bot. // 400 BOT_WEBVIEW_DISABLED: A webview cannot be opened in the specified conditions: emitted for example if from_bot_menu or url are set and peer is not the chat with the bot. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. +// 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 403 PRIVACY_PREMIUM_REQUIRED: You need a Telegram Premium subscription to send a message to this user. +// 400 SEND_AS_PEER_INVALID: You can't send messages as the specified peer. // 400 YOU_BLOCKED_USER: You blocked this user. // // See https://core.telegram.org/method/messages.requestWebView for reference. diff --git a/tg/tl_messages_save_draft_gen.go b/tg/tl_messages_save_draft_gen.go index a1fb21b3e3..87b477a818 100644 --- a/tg/tl_messages_save_draft_gen.go +++ b/tg/tl_messages_save_draft_gen.go @@ -69,7 +69,10 @@ type MessagesSaveDraftRequest struct { // // Use SetMedia and GetMedia helpers. Media InputMediaClass - // Effect field of MessagesSaveDraftRequest. + // Specifies a message effect »¹ to use for the message. + // + // Links: + // 1) https://core.telegram.org/api/effects // // Use SetEffect and GetEffect helpers. Effect int64 @@ -528,7 +531,7 @@ func (s *MessagesSaveDraftRequest) MapEntities() (value MessageEntityClassArray, // // Possible errors: // -// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. +// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. // diff --git a/tg/tl_messages_saved_gifs_gen.go b/tg/tl_messages_saved_gifs_gen.go index 5da96e48e9..9941ea9d7a 100644 --- a/tg/tl_messages_saved_gifs_gen.go +++ b/tg/tl_messages_saved_gifs_gen.go @@ -138,7 +138,7 @@ func (s *MessagesSavedGifsNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/messages.savedGifs for reference. type MessagesSavedGifs struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_saved_reaction_tags_gen.go b/tg/tl_messages_saved_reaction_tags_gen.go index 41acb12b68..a5371e2a20 100644 --- a/tg/tl_messages_saved_reaction_tags_gen.go +++ b/tg/tl_messages_saved_reaction_tags_gen.go @@ -32,6 +32,10 @@ var ( ) // MessagesSavedReactionTagsNotModified represents TL type `messages.savedReactionTagsNotModified#889b59ef`. +// The list of reaction tag »¹ names assigned by the user hasn't changed. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages#tags // // See https://core.telegram.org/constructor/messages.savedReactionTagsNotModified for reference. type MessagesSavedReactionTagsNotModified struct { @@ -133,12 +137,19 @@ func (s *MessagesSavedReactionTagsNotModified) DecodeBare(b *bin.Buffer) error { } // MessagesSavedReactionTags represents TL type `messages.savedReactionTags#3259950a`. +// List of reaction tag »¹ names assigned by the user. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages#tags // // See https://core.telegram.org/constructor/messages.savedReactionTags for reference. type MessagesSavedReactionTags struct { - // Tags field of MessagesSavedReactionTags. + // Saved reaction tags. Tags []SavedReactionTag - // Hash field of MessagesSavedReactionTags. + // Hash used for caching, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 } diff --git a/tg/tl_messages_search_custom_emoji_gen.go b/tg/tl_messages_search_custom_emoji_gen.go index 5219af8918..4d7dd09457 100644 --- a/tg/tl_messages_search_custom_emoji_gen.go +++ b/tg/tl_messages_search_custom_emoji_gen.go @@ -41,7 +41,7 @@ var ( type MessagesSearchCustomEmojiRequest struct { // The emoji Emoticon string - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation @@ -205,7 +205,6 @@ func (s *MessagesSearchCustomEmojiRequest) GetHash() (value int64) { // 400 EMOTICON_EMPTY: The emoji is empty. // // See https://core.telegram.org/method/messages.searchCustomEmoji for reference. -// Can be used by bots. func (c *Client) MessagesSearchCustomEmoji(ctx context.Context, request *MessagesSearchCustomEmojiRequest) (EmojiListClass, error) { var result EmojiListBox diff --git a/tg/tl_messages_search_emoji_sticker_sets_gen.go b/tg/tl_messages_search_emoji_sticker_sets_gen.go index 6c1e7d9981..68170cbe9f 100644 --- a/tg/tl_messages_search_emoji_sticker_sets_gen.go +++ b/tg/tl_messages_search_emoji_sticker_sets_gen.go @@ -48,7 +48,7 @@ type MessagesSearchEmojiStickerSetsRequest struct { ExcludeFeatured bool // Query string Q string - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_search_gen.go b/tg/tl_messages_search_gen.go index 4ecd1297c7..a4efc958a9 100644 --- a/tg/tl_messages_search_gen.go +++ b/tg/tl_messages_search_gen.go @@ -63,7 +63,11 @@ type MessagesSearchRequest struct { // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID InputPeerClass - // SavedReaction field of MessagesSearchRequest. + // You may search for saved messages tagged »¹ with one or more reactions using this + // flag. + // + // Links: + // 1) https://core.telegram.org/api/saved-messages#tags // // Use SetSavedReaction and GetSavedReaction helpers. SavedReaction []ReactionClass diff --git a/tg/tl_messages_search_global_gen.go b/tg/tl_messages_search_global_gen.go index 988977398b..89ca93c2cc 100644 --- a/tg/tl_messages_search_global_gen.go +++ b/tg/tl_messages_search_global_gen.go @@ -41,7 +41,11 @@ type MessagesSearchGlobalRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // BroadcastsOnly field of MessagesSearchGlobalRequest. + // If set, only returns results from channels (used in the global channel search tab + // »¹). + // + // Links: + // 1) https://core.telegram.org/api/search#global-search BroadcastsOnly bool // Peer folder ID, for more info click here¹ // @@ -487,6 +491,7 @@ func (s *MessagesSearchGlobalRequest) GetLimit() (value int) { // Possible errors: // // 400 FOLDER_ID_INVALID: Invalid folder ID. +// 400 INPUT_FILTER_INVALID: The specified filter is invalid. // 400 SEARCH_QUERY_EMPTY: The search query is empty. // // See https://core.telegram.org/method/messages.searchGlobal for reference. diff --git a/tg/tl_messages_search_sticker_sets_gen.go b/tg/tl_messages_search_sticker_sets_gen.go index f82bcac291..5a85143afa 100644 --- a/tg/tl_messages_search_sticker_sets_gen.go +++ b/tg/tl_messages_search_sticker_sets_gen.go @@ -45,7 +45,7 @@ type MessagesSearchStickerSetsRequest struct { ExcludeFeatured bool // Query string Q string - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_send_bot_requested_peer_gen.go b/tg/tl_messages_send_bot_requested_peer_gen.go index 252b189320..b75ad9cc09 100644 --- a/tg/tl_messages_send_bot_requested_peer_gen.go +++ b/tg/tl_messages_send_bot_requested_peer_gen.go @@ -289,6 +289,10 @@ func (s *MessagesSendBotRequestedPeerRequest) MapRequestedPeers() (value InputPe // Links: // 1. https://core.telegram.org/constructor/keyboardButtonRequestPeer // +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// // See https://core.telegram.org/method/messages.sendBotRequestedPeer for reference. func (c *Client) MessagesSendBotRequestedPeer(ctx context.Context, request *MessagesSendBotRequestedPeerRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_send_inline_bot_result_gen.go b/tg/tl_messages_send_inline_bot_result_gen.go index 4e66c69447..02ba2c2ca1 100644 --- a/tg/tl_messages_send_inline_bot_result_gen.go +++ b/tg/tl_messages_send_inline_bot_result_gen.go @@ -87,7 +87,10 @@ type MessagesSendInlineBotResultRequest struct { // // Use SetSendAs and GetSendAs helpers. SendAs InputPeerClass - // QuickReplyShortcut field of MessagesSendInlineBotResultRequest. + // Add the message to the specified quick reply shortcut »¹, instead. + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts // // Use SetQuickReplyShortcut and GetQuickReplyShortcut helpers. QuickReplyShortcut InputQuickReplyShortcutClass @@ -644,7 +647,7 @@ func (s *MessagesSendInlineBotResultRequest) GetQuickReplyShortcut() (value Inpu // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. -// 403 CHAT_GUEST_SEND_FORBIDDEN: You join the discussion group before commenting, see here » for more info. +// 403 CHAT_GUEST_SEND_FORBIDDEN: You join the discussion group before commenting, see here » for more info. // 400 CHAT_RESTRICTED: You can't send messages in this chat, you were restricted. // 403 CHAT_SEND_AUDIOS_FORBIDDEN: You can't send audio messages in this chat. // 403 CHAT_SEND_GAME_FORBIDDEN: You can't send a game to this chat. @@ -656,14 +659,16 @@ func (s *MessagesSendInlineBotResultRequest) GetQuickReplyShortcut() (value Inpu // 403 CHAT_SEND_STICKERS_FORBIDDEN: You can't send stickers in this chat. // 403 CHAT_SEND_VOICES_FORBIDDEN: You can't send voice recordings in this chat. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. -// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. +// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. // 400 INLINE_RESULT_EXPIRED: The inline query expired. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 MEDIA_EMPTY: The provided media object is invalid. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 QUERY_ID_EMPTY: The query ID is empty. +// 400 QUICK_REPLIES_TOO_MUCH: A maximum of appConfig.quick_replies_limit shortcuts may be created, the limit was reached. // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. +// 400 REPLY_MESSAGES_TOO_MUCH: Each shortcut can contain a maximum of appConfig.quick_reply_messages_limit messages, the limit was reached. // 400 RESULT_ID_EMPTY: Result ID empty. // 400 RESULT_ID_INVALID: One of the specified result IDs is invalid. // 400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future. diff --git a/tg/tl_messages_send_media_gen.go b/tg/tl_messages_send_media_gen.go index 0f8b9275b4..84cb532ce0 100644 --- a/tg/tl_messages_send_media_gen.go +++ b/tg/tl_messages_send_media_gen.go @@ -96,11 +96,17 @@ type MessagesSendMediaRequest struct { // // Use SetSendAs and GetSendAs helpers. SendAs InputPeerClass - // QuickReplyShortcut field of MessagesSendMediaRequest. + // Add the message to the specified quick reply shortcut »¹, instead. + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts // // Use SetQuickReplyShortcut and GetQuickReplyShortcut helpers. QuickReplyShortcut InputQuickReplyShortcutClass - // Effect field of MessagesSendMediaRequest. + // Specifies a message effect »¹ to use for the message. + // + // Links: + // 1) https://core.telegram.org/api/effects // // Use SetEffect and GetEffect helpers. Effect int64 @@ -885,16 +891,18 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // // Possible errors: // +// 400 BOT_GAMES_DISABLED: Games can't be sent to channels. // 400 BOT_PAYMENTS_DISABLED: Please enable bot payments in botfather before calling this method. // 400 BROADCAST_PUBLIC_VOTERS_FORBIDDEN: You can't forward polls with public voters. // 400 BUTTON_DATA_INVALID: The data of one or more of the buttons you provided is invalid. +// 400 BUTTON_POS_INVALID: The position of one of the keyboard buttons is invalid (i.e. a Game or Pay button not in the first position, and so on...). // 400 BUTTON_TYPE_INVALID: The type of one or more of the buttons you provided is invalid. // 400 BUTTON_URL_INVALID: Button URL invalid. // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_FORWARDS_RESTRICTED: You can't forward messages from a protected chat. -// 403 CHAT_GUEST_SEND_FORBIDDEN: You join the discussion group before commenting, see here » for more info. +// 403 CHAT_GUEST_SEND_FORBIDDEN: You join the discussion group before commenting, see here » for more info. // 400 CHAT_RESTRICTED: You can't send messages in this chat, you were restricted. // 403 CHAT_SEND_AUDIOS_FORBIDDEN: You can't send audio messages in this chat. // 403 CHAT_SEND_DOCS_FORBIDDEN: You can't send documents in this chat. @@ -903,6 +911,7 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 403 CHAT_SEND_PHOTOS_FORBIDDEN: You can't send photos in this chat. // 403 CHAT_SEND_PLAIN_FORBIDDEN: You can't send non-media (text) messages in this chat. // 403 CHAT_SEND_POLL_FORBIDDEN: You can't send polls in this chat. +// 403 CHAT_SEND_ROUNDVIDEOS_FORBIDDEN: You can't send round videos to this chat. // 403 CHAT_SEND_STICKERS_FORBIDDEN: You can't send stickers in this chat. // 403 CHAT_SEND_VIDEOS_FORBIDDEN: You can't send videos in this chat. // 403 CHAT_SEND_VOICES_FORBIDDEN: You can't send voice recordings in this chat. @@ -910,7 +919,7 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 400 CURRENCY_TOTAL_AMOUNT_INVALID: The total amount of all prices is invalid. // 400 DOCUMENT_INVALID: The specified document is invalid. // 400 EMOTICON_INVALID: The specified emoji is invalid. -// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. +// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. // 400 EXTERNAL_URL_INVALID: External URL invalid. // 400 FILE_PARTS_INVALID: The number of file parts is invalid. // 400 FILE_PART_LENGTH_INVALID: The length of a file part is invalid. @@ -918,6 +927,7 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 400 FILE_REFERENCE_EXPIRED: File reference expired, it must be refetched as described in the documentation. // 400 GAME_BOT_INVALID: Bots can't send another bot's game. // 400 IMAGE_PROCESS_FAILED: Failure while processing image. +// 400 INPUT_FILE_INVALID: The specified InputFile is invalid. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 MD5_CHECKSUM_INVALID: The MD5 checksums do not match. // 400 MEDIA_CAPTION_TOO_LONG: The caption is too long. @@ -936,19 +946,24 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 400 POLL_OPTION_INVALID: Invalid poll option provided. // 400 POLL_QUESTION_INVALID: One of the poll questions is not acceptable. // 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. +// 403 PRIVACY_PREMIUM_REQUIRED: You need a Telegram Premium subscription to send a message to this user. +// 400 QUICK_REPLIES_TOO_MUCH: A maximum of appConfig.quick_replies_limit shortcuts may be created, the limit was reached. // 400 QUIZ_CORRECT_ANSWERS_EMPTY: No correct quiz answer was specified. // 400 QUIZ_CORRECT_ANSWERS_TOO_MUCH: You specified too many correct answers in a quiz, quizzes can only have one right answer! // 400 QUIZ_CORRECT_ANSWER_INVALID: An invalid value was provided to the correct_answers field. // 400 QUIZ_MULTIPLE_INVALID: Quizzes can't have the multiple_choice flag set! // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. // 400 REPLY_MARKUP_BUY_EMPTY: Reply markup for buy button empty. +// 400 REPLY_MARKUP_GAME_EMPTY: A game message is being edited, but the newly provided keyboard doesn't have a keyboardButtonGame button. // 400 REPLY_MARKUP_INVALID: The provided reply markup is invalid. // 400 REPLY_MARKUP_TOO_LONG: The specified reply_markup is too long. +// 400 REPLY_MESSAGES_TOO_MUCH: Each shortcut can contain a maximum of appConfig.quick_reply_messages_limit messages, the limit was reached. // 400 SCHEDULE_BOT_NOT_ALLOWED: Bots cannot schedule messages. // 400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future. // 400 SCHEDULE_TOO_MUCH: There are too many scheduled messages. // 400 SEND_AS_PEER_INVALID: You can't send messages as the specified peer. // 420 SLOWMODE_WAIT_%d: Slowmode is enabled in this chat: wait %d seconds before sending another message to this chat. +// 400 STORY_ID_INVALID: The specified story ID is invalid. // 406 TOPIC_CLOSED: This topic was closed, you can't send messages to it anymore. // 406 TOPIC_DELETED: The specified topic was deleted. // 400 TTL_MEDIA_INVALID: Invalid media Time To Live was provided. diff --git a/tg/tl_messages_send_message_gen.go b/tg/tl_messages_send_message_gen.go index 14f3b687ce..e2c00d1743 100644 --- a/tg/tl_messages_send_message_gen.go +++ b/tg/tl_messages_send_message_gen.go @@ -66,7 +66,7 @@ type MessagesSendMessageRequest struct { // The destination where the message will be sent Peer InputPeerClass // If set, indicates that the message should be sent in reply to the specified message or - // story. + // story. Also used to quote other messages. // // Use SetReplyTo and GetReplyTo helpers. ReplyTo InputReplyToClass @@ -96,11 +96,17 @@ type MessagesSendMessageRequest struct { // // Use SetSendAs and GetSendAs helpers. SendAs InputPeerClass - // QuickReplyShortcut field of MessagesSendMessageRequest. + // Add the message to the specified quick reply shortcut »¹, instead. + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts // // Use SetQuickReplyShortcut and GetQuickReplyShortcut helpers. QuickReplyShortcut InputQuickReplyShortcutClass - // Effect field of MessagesSendMessageRequest. + // Specifies a message effect »¹ to use for the message. + // + // Links: + // 1) https://core.telegram.org/api/effects // // Use SetEffect and GetEffect helpers. Effect int64 @@ -891,6 +897,7 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // 400 ADMIN_RIGHTS_EMPTY: The chatAdminRights constructor passed in keyboardButtonRequestPeer.peer_type.user_admin_rights has no rights set (i.e. flags is 0). // 400 BOT_DOMAIN_INVALID: Bot domain invalid. // 400 BOT_INVALID: This is not a valid bot. +// 400 BUSINESS_PEER_INVALID: Messages can't be set to the specified peer through the current business connection. // 400 BUTTON_DATA_INVALID: The data of one or more of the buttons you provided is invalid. // 400 BUTTON_TYPE_INVALID: The type of one or more of the buttons you provided is invalid. // 400 BUTTON_URL_INVALID: Button URL invalid. @@ -899,7 +906,7 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. -// 403 CHAT_GUEST_SEND_FORBIDDEN: You join the discussion group before commenting, see here » for more info. +// 403 CHAT_GUEST_SEND_FORBIDDEN: You join the discussion group before commenting, see here » for more info. // 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 CHAT_RESTRICTED: You can't send messages in this chat, you were restricted. // 403 CHAT_SEND_PLAIN_FORBIDDEN: You can't send non-media (text) messages in this chat. @@ -907,7 +914,7 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // 400 DOCUMENT_INVALID: The specified document is invalid. // 400 ENCRYPTION_DECLINED: The secret chat was declined. // 400 ENTITIES_TOO_LONG: You provided too many styled message entities. -// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. +// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. // 400 ENTITY_MENTION_USER_INVALID: You mentioned an invalid user. // 400 FROM_MESSAGE_BOT_DISABLED: Bots can't use fromMessage min constructors. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. @@ -915,14 +922,18 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // 400 MESSAGE_TOO_LONG: The provided message is too long. // 400 MSG_ID_INVALID: Invalid message ID provided. // 500 MSG_WAIT_FAILED: A waiting call returned an error. -// 406 PAYMENT_UNSUPPORTED: A detailed description of the error will be received separately as described here ». +// 406 PAYMENT_UNSUPPORTED: A detailed description of the error will be received separately as described here ». // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 PINNED_DIALOGS_TOO_MUCH: Too many pinned dialogs. // 400 POLL_OPTION_INVALID: Invalid poll option provided. // 406 PRIVACY_PREMIUM_REQUIRED: You need a Telegram Premium subscription to send a message to this user. +// 400 QUICK_REPLIES_TOO_MUCH: A maximum of appConfig.quick_replies_limit shortcuts may be created, the limit was reached. +// 400 QUOTE_TEXT_INVALID: The specified reply_to.quote_text field is invalid. // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. // 400 REPLY_MARKUP_INVALID: The provided reply markup is invalid. // 400 REPLY_MARKUP_TOO_LONG: The specified reply_markup is too long. +// 400 REPLY_MESSAGES_TOO_MUCH: Each shortcut can contain a maximum of appConfig.quick_reply_messages_limit messages, the limit was reached. +// 400 REPLY_MESSAGE_ID_INVALID: The specified reply-to message ID is invalid. // 400 REPLY_TO_INVALID: The specified reply_to field is invalid. // 400 REPLY_TO_USER_INVALID: The replied-to user is invalid. // 400 SCHEDULE_BOT_NOT_ALLOWED: Bots cannot schedule messages. diff --git a/tg/tl_messages_send_multi_media_gen.go b/tg/tl_messages_send_multi_media_gen.go index aac09bb6ba..e1adb338d7 100644 --- a/tg/tl_messages_send_multi_media_gen.go +++ b/tg/tl_messages_send_multi_media_gen.go @@ -88,11 +88,17 @@ type MessagesSendMultiMediaRequest struct { // // Use SetSendAs and GetSendAs helpers. SendAs InputPeerClass - // QuickReplyShortcut field of MessagesSendMultiMediaRequest. + // Add the message to the specified quick reply shortcut »¹, instead. + // + // Links: + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts // // Use SetQuickReplyShortcut and GetQuickReplyShortcut helpers. QuickReplyShortcut InputQuickReplyShortcutClass - // Effect field of MessagesSendMultiMediaRequest. + // Specifies a message effect »¹ to use for the message. + // + // Links: + // 1) https://core.telegram.org/api/effects // // Use SetEffect and GetEffect helpers. Effect int64 @@ -721,6 +727,7 @@ func (s *MessagesSendMultiMediaRequest) GetEffect() (value int64, ok bool) { // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_FORWARDS_RESTRICTED: You can't forward messages from a protected chat. @@ -728,14 +735,18 @@ func (s *MessagesSendMultiMediaRequest) GetEffect() (value int64, ok bool) { // 403 CHAT_SEND_PHOTOS_FORBIDDEN: You can't send photos in this chat. // 403 CHAT_SEND_VIDEOS_FORBIDDEN: You can't send videos in this chat. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. -// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. +// 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. +// 400 FILE_REFERENCE_%d_EXPIRED: The file reference of the media file at index %d in the passed media array expired, it must be refreshed. +// 400 FILE_REFERENCE_%d_INVALID: The file reference of the media file at index %d in the passed media array is invalid. // 400 MEDIA_CAPTION_TOO_LONG: The caption is too long. // 400 MEDIA_EMPTY: The provided media object is invalid. // 400 MEDIA_INVALID: Media invalid. // 400 MULTI_MEDIA_TOO_LONG: Too many media files for album. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 QUICK_REPLIES_TOO_MUCH: A maximum of appConfig.quick_replies_limit shortcuts may be created, the limit was reached. // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. // 400 RANDOM_ID_EMPTY: Random ID empty. +// 400 REPLY_MESSAGES_TOO_MUCH: Each shortcut can contain a maximum of appConfig.quick_reply_messages_limit messages, the limit was reached. // 400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future. // 400 SCHEDULE_TOO_MUCH: There are too many scheduled messages. // 400 SEND_AS_PEER_INVALID: You can't send messages as the specified peer. diff --git a/tg/tl_messages_send_quick_reply_messages_gen.go b/tg/tl_messages_send_quick_reply_messages_gen.go index 4f1c172516..973a5ed9f2 100644 --- a/tg/tl_messages_send_quick_reply_messages_gen.go +++ b/tg/tl_messages_send_quick_reply_messages_gen.go @@ -32,16 +32,22 @@ var ( ) // MessagesSendQuickReplyMessagesRequest represents TL type `messages.sendQuickReplyMessages#6c750de1`. +// Send a quick reply shortcut »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/method/messages.sendQuickReplyMessages for reference. type MessagesSendQuickReplyMessagesRequest struct { - // Peer field of MessagesSendQuickReplyMessagesRequest. + // The peer where to send the shortcut (users only, for now). Peer InputPeerClass - // ShortcutID field of MessagesSendQuickReplyMessagesRequest. + // The ID of the quick reply shortcut to send. ShortcutID int - // ID field of MessagesSendQuickReplyMessagesRequest. + // Specify a subset of messages from the shortcut to send; if empty, defaults to all of + // them. ID []int - // RandomID field of MessagesSendQuickReplyMessagesRequest. + // Unique client IDs required to prevent message resending, one for each message we're + // sending, may be empty (but not recommended). RandomID []int64 } @@ -273,6 +279,15 @@ func (s *MessagesSendQuickReplyMessagesRequest) GetRandomID() (value []int64) { } // MessagesSendQuickReplyMessages invokes method messages.sendQuickReplyMessages#6c750de1 returning error if any. +// Send a quick reply shortcut »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // // See https://core.telegram.org/method/messages.sendQuickReplyMessages for reference. func (c *Client) MessagesSendQuickReplyMessages(ctx context.Context, request *MessagesSendQuickReplyMessagesRequest) (UpdatesClass, error) { diff --git a/tg/tl_messages_send_reaction_gen.go b/tg/tl_messages_send_reaction_gen.go index 623001ae32..15d550cc9c 100644 --- a/tg/tl_messages_send_reaction_gen.go +++ b/tg/tl_messages_send_reaction_gen.go @@ -387,7 +387,7 @@ func (s *MessagesSendReactionRequest) MapReaction() (value ReactionClassArray, o // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. -// 400 REACTIONS_TOO_MANY: The message already has exactly reactions_uniq_max reaction emojis, you can't react with a new emoji, see the docs for more info ». +// 400 REACTIONS_TOO_MANY: The message already has exactly reactions_uniq_max reaction emojis, you can't react with a new emoji, see the docs for more info ». // 400 REACTION_EMPTY: Empty reaction provided. // 400 REACTION_INVALID: The specified reaction is invalid. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. diff --git a/tg/tl_messages_send_scheduled_messages_gen.go b/tg/tl_messages_send_scheduled_messages_gen.go index 29158352b7..9d0d838ff8 100644 --- a/tg/tl_messages_send_scheduled_messages_gen.go +++ b/tg/tl_messages_send_scheduled_messages_gen.go @@ -213,6 +213,7 @@ func (s *MessagesSendScheduledMessagesRequest) GetID() (value []int) { // // 400 MESSAGE_ID_INVALID: The provided message id is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. // // See https://core.telegram.org/method/messages.sendScheduledMessages for reference. func (c *Client) MessagesSendScheduledMessages(ctx context.Context, request *MessagesSendScheduledMessagesRequest) (UpdatesClass, error) { diff --git a/tg/tl_messages_send_web_view_data_gen.go b/tg/tl_messages_send_web_view_data_gen.go index e3886f72e3..d0dc094a11 100644 --- a/tg/tl_messages_send_web_view_data_gen.go +++ b/tg/tl_messages_send_web_view_data_gen.go @@ -264,6 +264,10 @@ func (s *MessagesSendWebViewDataRequest) GetData() (value string) { // Links: // 1. https://core.telegram.org/api/bots/webapps // +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. +// // See https://core.telegram.org/method/messages.sendWebViewData for reference. func (c *Client) MessagesSendWebViewData(ctx context.Context, request *MessagesSendWebViewDataRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_send_web_view_result_message_gen.go b/tg/tl_messages_send_web_view_result_message_gen.go index 1496f13c19..689627b1ae 100644 --- a/tg/tl_messages_send_web_view_result_message_gen.go +++ b/tg/tl_messages_send_web_view_result_message_gen.go @@ -210,6 +210,7 @@ func (s *MessagesSendWebViewResultMessageRequest) GetResult() (value InputBotInl // Possible errors: // // 400 QUERY_ID_INVALID: The query ID is invalid. +// 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/messages.sendWebViewResultMessage for reference. // Can be used by bots. diff --git a/tg/tl_messages_set_bot_precheckout_results_gen.go b/tg/tl_messages_set_bot_precheckout_results_gen.go index b5e2ab3aa3..ad80b01b20 100644 --- a/tg/tl_messages_set_bot_precheckout_results_gen.go +++ b/tg/tl_messages_set_bot_precheckout_results_gen.go @@ -291,6 +291,7 @@ func (s *MessagesSetBotPrecheckoutResultsRequest) GetError() (value string, ok b // Possible errors: // // 400 ERROR_TEXT_EMPTY: The provided error message is empty. +// 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/messages.setBotPrecheckoutResults for reference. // Can be used by bots. diff --git a/tg/tl_messages_set_bot_shipping_results_gen.go b/tg/tl_messages_set_bot_shipping_results_gen.go index 32f0ff4712..356edb46e5 100644 --- a/tg/tl_messages_set_bot_shipping_results_gen.go +++ b/tg/tl_messages_set_bot_shipping_results_gen.go @@ -311,6 +311,7 @@ func (s *MessagesSetBotShippingResultsRequest) GetShippingOptions() (value []Shi // Possible errors: // // 400 QUERY_ID_INVALID: The query ID is invalid. +// 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/messages.setBotShippingResults for reference. // Can be used by bots. diff --git a/tg/tl_messages_set_chat_available_reactions_gen.go b/tg/tl_messages_set_chat_available_reactions_gen.go index 0f714de961..0dddcb78af 100644 --- a/tg/tl_messages_set_chat_available_reactions_gen.go +++ b/tg/tl_messages_set_chat_available_reactions_gen.go @@ -40,13 +40,23 @@ var ( // // See https://core.telegram.org/method/messages.setChatAvailableReactions for reference. type MessagesSetChatAvailableReactionsRequest struct { - // Flags field of MessagesSetChatAvailableReactionsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Group where to apply changes Peer InputPeerClass // Allowed reaction emojis AvailableReactions ChatReactionsClass - // ReactionsLimit field of MessagesSetChatAvailableReactionsRequest. + // This flag may be used to impose a custom limit of unique reactions (i.e. a + // customizable version of appConfig.reactions_uniq_max¹); this field and the other info + // set by the method will then be available to users in channelFull² and chatFull³. + // + // Links: + // 1) https://core.telegram.org/api/config#reactions-uniq-max + // 2) https://core.telegram.org/constructor/channelFull + // 3) https://core.telegram.org/constructor/chatFull // // Use SetReactionsLimit and GetReactionsLimit helpers. ReactionsLimit int diff --git a/tg/tl_messages_set_chat_wall_paper_gen.go b/tg/tl_messages_set_chat_wall_paper_gen.go index 613f8eb2f2..39351fa822 100644 --- a/tg/tl_messages_set_chat_wall_paper_gen.go +++ b/tg/tl_messages_set_chat_wall_paper_gen.go @@ -444,7 +444,6 @@ func (s *MessagesSetChatWallPaperRequest) GetID() (value int, ok bool) { // 400 WALLPAPER_NOT_FOUND: The specified wallpaper could not be found. // // See https://core.telegram.org/method/messages.setChatWallPaper for reference. -// Can be used by bots. func (c *Client) MessagesSetChatWallPaper(ctx context.Context, request *MessagesSetChatWallPaperRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_set_default_history_ttl_gen.go b/tg/tl_messages_set_default_history_ttl_gen.go index 291ccba95c..1fe8b94795 100644 --- a/tg/tl_messages_set_default_history_ttl_gen.go +++ b/tg/tl_messages_set_default_history_ttl_gen.go @@ -169,7 +169,6 @@ func (s *MessagesSetDefaultHistoryTTLRequest) GetPeriod() (value int) { // 400 TTL_PERIOD_INVALID: The specified TTL period is invalid. // // See https://core.telegram.org/method/messages.setDefaultHistoryTTL for reference. -// Can be used by bots. func (c *Client) MessagesSetDefaultHistoryTTL(ctx context.Context, period int) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_set_history_ttl_gen.go b/tg/tl_messages_set_history_ttl_gen.go index 13eea9d72c..83190ee200 100644 --- a/tg/tl_messages_set_history_ttl_gen.go +++ b/tg/tl_messages_set_history_ttl_gen.go @@ -199,6 +199,7 @@ func (s *MessagesSetHistoryTTLRequest) GetPeriod() (value int) { // Possible errors: // // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 TTL_PERIOD_INVALID: The specified TTL period is invalid. // // See https://core.telegram.org/method/messages.setHistoryTTL for reference. diff --git a/tg/tl_messages_set_inline_bot_results_gen.go b/tg/tl_messages_set_inline_bot_results_gen.go index ff925dea39..89bfb96615 100644 --- a/tg/tl_messages_set_inline_bot_results_gen.go +++ b/tg/tl_messages_set_inline_bot_results_gen.go @@ -518,8 +518,10 @@ func (s *MessagesSetInlineBotResultsRequest) MapResults() (value InputBotInlineR // 400 START_PARAM_INVALID: Start parameter invalid. // 400 STICKER_DOCUMENT_INVALID: The specified sticker document is invalid. // 400 SWITCH_PM_TEXT_EMPTY: The switch_pm.text field was empty. +// 400 SWITCH_WEBVIEW_URL_INVALID: The URL specified in switch_webview.url is invalid! // 400 URL_INVALID: Invalid URL provided. // 403 USER_BOT_INVALID: User accounts must provide the bot method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts. +// 400 USER_BOT_REQUIRED: This method can only be called by a bot. // 400 VIDEO_TITLE_EMPTY: The specified video title is empty. // 400 WEBDOCUMENT_INVALID: Invalid webdocument URL provided. // 400 WEBDOCUMENT_MIME_INVALID: Invalid webdocument mime type provided. diff --git a/tg/tl_messages_stickers_gen.go b/tg/tl_messages_stickers_gen.go index 2c07595b4a..5a1a9b843b 100644 --- a/tg/tl_messages_stickers_gen.go +++ b/tg/tl_messages_stickers_gen.go @@ -138,7 +138,7 @@ func (s *MessagesStickersNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/messages.stickers for reference. type MessagesStickers struct { - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_toggle_bot_in_attach_menu_gen.go b/tg/tl_messages_toggle_bot_in_attach_menu_gen.go index 92126c81aa..d7f70fb3cf 100644 --- a/tg/tl_messages_toggle_bot_in_attach_menu_gen.go +++ b/tg/tl_messages_toggle_bot_in_attach_menu_gen.go @@ -262,6 +262,10 @@ func (t *MessagesToggleBotInAttachMenuRequest) GetEnabled() (value bool) { // Links: // 1. https://core.telegram.org/api/bots/attach // +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. +// // See https://core.telegram.org/method/messages.toggleBotInAttachMenu for reference. func (c *Client) MessagesToggleBotInAttachMenu(ctx context.Context, request *MessagesToggleBotInAttachMenuRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_toggle_dialog_filter_tags_gen.go b/tg/tl_messages_toggle_dialog_filter_tags_gen.go index 2d07138fcf..6b00ba14cb 100644 --- a/tg/tl_messages_toggle_dialog_filter_tags_gen.go +++ b/tg/tl_messages_toggle_dialog_filter_tags_gen.go @@ -32,10 +32,14 @@ var ( ) // MessagesToggleDialogFilterTagsRequest represents TL type `messages.toggleDialogFilterTags#fd2dda49`. +// Enable or disable folder tags »¹. +// +// Links: +// 1. https://core.telegram.org/api/folders#folder-tags // // See https://core.telegram.org/method/messages.toggleDialogFilterTags for reference. type MessagesToggleDialogFilterTagsRequest struct { - // Enabled field of MessagesToggleDialogFilterTagsRequest. + // Enable or disable folder tags. Enabled bool } @@ -161,6 +165,14 @@ func (t *MessagesToggleDialogFilterTagsRequest) GetEnabled() (value bool) { } // MessagesToggleDialogFilterTags invokes method messages.toggleDialogFilterTags#fd2dda49 returning error if any. +// Enable or disable folder tags »¹. +// +// Links: +// 1. https://core.telegram.org/api/folders#folder-tags +// +// Possible errors: +// +// 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // // See https://core.telegram.org/method/messages.toggleDialogFilterTags for reference. func (c *Client) MessagesToggleDialogFilterTags(ctx context.Context, enabled bool) (bool, error) { diff --git a/tg/tl_messages_toggle_peer_translations_gen.go b/tg/tl_messages_toggle_peer_translations_gen.go index 92212549d1..1685b9eaf9 100644 --- a/tg/tl_messages_toggle_peer_translations_gen.go +++ b/tg/tl_messages_toggle_peer_translations_gen.go @@ -231,8 +231,11 @@ func (t *MessagesTogglePeerTranslationsRequest) GetPeer() (value InputPeerClass) // Links: // 1. https://core.telegram.org/api/translation // +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// // See https://core.telegram.org/method/messages.togglePeerTranslations for reference. -// Can be used by bots. func (c *Client) MessagesTogglePeerTranslations(ctx context.Context, request *MessagesTogglePeerTranslationsRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_translate_text_gen.go b/tg/tl_messages_translate_text_gen.go index 03fa925078..147e8c5641 100644 --- a/tg/tl_messages_translate_text_gen.go +++ b/tg/tl_messages_translate_text_gen.go @@ -379,6 +379,7 @@ func (t *MessagesTranslateTextRequest) GetToLang() (value string) { // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 TO_LANG_INVALID: The specified destination language is invalid. +// 400 TRANSLATE_REQ_QUOTA_EXCEEDED: Translation is currently unavailable due to a temporary server-side lack of resources. // // See https://core.telegram.org/method/messages.translateText for reference. func (c *Client) MessagesTranslateText(ctx context.Context, request *MessagesTranslateTextRequest) (*MessagesTranslateResult, error) { diff --git a/tg/tl_messages_unpin_all_messages_gen.go b/tg/tl_messages_unpin_all_messages_gen.go index 1528854c5f..a3de1dbcef 100644 --- a/tg/tl_messages_unpin_all_messages_gen.go +++ b/tg/tl_messages_unpin_all_messages_gen.go @@ -251,6 +251,7 @@ func (u *MessagesUnpinAllMessagesRequest) GetTopMsgID() (value int, ok bool) { // // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.unpinAllMessages for reference. // Can be used by bots. diff --git a/tg/tl_messages_update_dialog_filter_gen.go b/tg/tl_messages_update_dialog_filter_gen.go index 92120c93d3..cc95a13d6d 100644 --- a/tg/tl_messages_update_dialog_filter_gen.go +++ b/tg/tl_messages_update_dialog_filter_gen.go @@ -257,6 +257,8 @@ func (u *MessagesUpdateDialogFilterRequest) GetFilter() (value DialogFilterClass // 400 FILTER_ID_INVALID: The specified filter ID is invalid. // 400 FILTER_INCLUDE_EMPTY: The include_peers vector of the filter is empty. // 400 FILTER_TITLE_EMPTY: The title field of the filter is empty. +// 400 MSG_ID_INVALID: Invalid message ID provided. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.updateDialogFilter for reference. func (c *Client) MessagesUpdateDialogFilter(ctx context.Context, request *MessagesUpdateDialogFilterRequest) (bool, error) { diff --git a/tg/tl_messages_update_saved_reaction_tag_gen.go b/tg/tl_messages_update_saved_reaction_tag_gen.go index 5491d99987..8c1af1b146 100644 --- a/tg/tl_messages_update_saved_reaction_tag_gen.go +++ b/tg/tl_messages_update_saved_reaction_tag_gen.go @@ -32,14 +32,25 @@ var ( ) // MessagesUpdateSavedReactionTagRequest represents TL type `messages.updateSavedReactionTag#60297dec`. +// Update the description of a saved message tag »¹. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages#tags // // See https://core.telegram.org/method/messages.updateSavedReactionTag for reference. type MessagesUpdateSavedReactionTagRequest struct { - // Flags field of MessagesUpdateSavedReactionTagRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Reaction field of MessagesUpdateSavedReactionTagRequest. + // Reaction¹ associated to the tag + // + // Links: + // 1) https://core.telegram.org/api/reactions Reaction ReactionClass - // Title field of MessagesUpdateSavedReactionTagRequest. + // Tag description, max 12 UTF-8 characters; to remove the description call the method + // without setting this flag. // // Use SetTitle and GetTitle helpers. Title string @@ -232,6 +243,15 @@ func (u *MessagesUpdateSavedReactionTagRequest) GetTitle() (value string, ok boo } // MessagesUpdateSavedReactionTag invokes method messages.updateSavedReactionTag#60297dec returning error if any. +// Update the description of a saved message tag »¹. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages#tags +// +// Possible errors: +// +// 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. +// 400 REACTION_INVALID: The specified reaction is invalid. // // See https://core.telegram.org/method/messages.updateSavedReactionTag for reference. func (c *Client) MessagesUpdateSavedReactionTag(ctx context.Context, request *MessagesUpdateSavedReactionTagRequest) (bool, error) { diff --git a/tg/tl_messages_upload_encrypted_file_gen.go b/tg/tl_messages_upload_encrypted_file_gen.go index 72c19ffc98..b0048afb0a 100644 --- a/tg/tl_messages_upload_encrypted_file_gen.go +++ b/tg/tl_messages_upload_encrypted_file_gen.go @@ -201,6 +201,10 @@ func (u *MessagesUploadEncryptedFileRequest) GetFileAsNotEmpty() (NotEmptyInputE // MessagesUploadEncryptedFile invokes method messages.uploadEncryptedFile#5057c497 returning error if any. // Upload encrypted file and associate it to a secret chat // +// Possible errors: +// +// 400 CHAT_ID_INVALID: The provided chat id is invalid. +// // See https://core.telegram.org/method/messages.uploadEncryptedFile for reference. func (c *Client) MessagesUploadEncryptedFile(ctx context.Context, request *MessagesUploadEncryptedFileRequest) (EncryptedFileClass, error) { var result EncryptedFileBox diff --git a/tg/tl_messages_upload_imported_media_gen.go b/tg/tl_messages_upload_imported_media_gen.go index 470440ed11..03e89d2d46 100644 --- a/tg/tl_messages_upload_imported_media_gen.go +++ b/tg/tl_messages_upload_imported_media_gen.go @@ -268,6 +268,7 @@ func (u *MessagesUploadImportedMediaRequest) GetMedia() (value InputMediaClass) // Possible errors: // // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 IMPORT_ID_INVALID: The specified import ID is invalid. // // See https://core.telegram.org/method/messages.uploadImportedMedia for reference. func (c *Client) MessagesUploadImportedMedia(ctx context.Context, request *MessagesUploadImportedMediaRequest) (MessageMediaClass, error) { diff --git a/tg/tl_messages_upload_media_gen.go b/tg/tl_messages_upload_media_gen.go index 3b55b61fbd..ba7a72c165 100644 --- a/tg/tl_messages_upload_media_gen.go +++ b/tg/tl_messages_upload_media_gen.go @@ -36,9 +36,16 @@ var ( // // See https://core.telegram.org/method/messages.uploadMedia for reference. type MessagesUploadMediaRequest struct { - // Flags field of MessagesUploadMediaRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // BusinessConnectionID field of MessagesUploadMediaRequest. + // Whether the media will be used only in the specified business connection »¹, and not + // directly by the bot. + // + // Links: + // 1) https://core.telegram.org/api/business#connected-bots // // Use SetBusinessConnectionID and GetBusinessConnectionID helpers. BusinessConnectionID string diff --git a/tg/tl_missing_invitee_gen.go b/tg/tl_missing_invitee_gen.go index 8d802b9e34..79b484ac62 100644 --- a/tg/tl_missing_invitee_gen.go +++ b/tg/tl_missing_invitee_gen.go @@ -32,16 +32,37 @@ var ( ) // MissingInvitee represents TL type `missingInvitee#628c9224`. +// Info about why a specific user could not be invited »¹. +// +// Links: +// 1. https://core.telegram.org/api/invites#direct-invites // // See https://core.telegram.org/constructor/missingInvitee for reference. type MissingInvitee struct { - // Flags field of MissingInvitee. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // PremiumWouldAllowInvite field of MissingInvitee. + // If set, we could not add the user only because the current account needs to purchase a + // Telegram Premium¹ subscription to complete the operation. + // + // Links: + // 1) https://core.telegram.org/api/premium PremiumWouldAllowInvite bool - // PremiumRequiredForPm field of MissingInvitee. + // If set, we could not add the user because of their privacy settings, and additionally, + // the current account needs to purchase a Telegram Premium¹ subscription to directly + // share an invite link with the user via a private message. + // + // Links: + // 1) https://core.telegram.org/api/premium PremiumRequiredForPm bool - // UserID field of MissingInvitee. + // ID of the user. If neither of the flags below are set, we could not add the user + // because of their privacy settings, and we can create and directly share an invite + // link¹ with them using a normal message, instead. + // + // Links: + // 1) https://core.telegram.org/api/invites#invite-links UserID int64 } diff --git a/tg/tl_outbox_read_date_gen.go b/tg/tl_outbox_read_date_gen.go index 5f5b1e418f..f04ab75559 100644 --- a/tg/tl_outbox_read_date_gen.go +++ b/tg/tl_outbox_read_date_gen.go @@ -32,10 +32,11 @@ var ( ) // OutboxReadDate represents TL type `outboxReadDate#3bb842ac`. +// Exact read date of a private message we sent to another user. // // See https://core.telegram.org/constructor/outboxReadDate for reference. type OutboxReadDate struct { - // Date field of OutboxReadDate. + // UNIX timestamp with the read date. Date int } diff --git a/tg/tl_payments_assign_app_store_transaction_gen.go b/tg/tl_payments_assign_app_store_transaction_gen.go index a20f59aeb5..3ed1631d68 100644 --- a/tg/tl_payments_assign_app_store_transaction_gen.go +++ b/tg/tl_payments_assign_app_store_transaction_gen.go @@ -198,6 +198,10 @@ func (a *PaymentsAssignAppStoreTransactionRequest) GetPurpose() (value InputStor // Informs server about a purchase made through the App Store: for official applications // only. // +// Possible errors: +// +// 400 RECEIPT_EMPTY: The specified receipt is empty. +// // See https://core.telegram.org/method/payments.assignAppStoreTransaction for reference. func (c *Client) PaymentsAssignAppStoreTransaction(ctx context.Context, request *PaymentsAssignAppStoreTransactionRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_payments_assign_play_market_transaction_gen.go b/tg/tl_payments_assign_play_market_transaction_gen.go index 5bbfe09f10..5b6669f498 100644 --- a/tg/tl_payments_assign_play_market_transaction_gen.go +++ b/tg/tl_payments_assign_play_market_transaction_gen.go @@ -198,6 +198,10 @@ func (a *PaymentsAssignPlayMarketTransactionRequest) GetPurpose() (value InputSt // Informs server about a purchase made through the Play Store: for official applications // only. // +// Possible errors: +// +// 400 DATA_JSON_INVALID: The provided JSON data is invalid. +// // See https://core.telegram.org/method/payments.assignPlayMarketTransaction for reference. func (c *Client) PaymentsAssignPlayMarketTransaction(ctx context.Context, request *PaymentsAssignPlayMarketTransactionRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_payments_can_purchase_premium_gen.go b/tg/tl_payments_can_purchase_premium_gen.go index 5b004892d3..762808a7de 100644 --- a/tg/tl_payments_can_purchase_premium_gen.go +++ b/tg/tl_payments_can_purchase_premium_gen.go @@ -171,6 +171,10 @@ func (c *PaymentsCanPurchasePremiumRequest) GetPurpose() (value InputStorePaymen // Checks whether Telegram Premium purchase is possible. Must be called before in-store // Premium purchase, official apps only. // +// Possible errors: +// +// 406 PREMIUM_CURRENTLY_UNAVAILABLE: You cannot currently purchase a Premium subscription. +// // See https://core.telegram.org/method/payments.canPurchasePremium for reference. func (c *Client) PaymentsCanPurchasePremium(ctx context.Context, purpose InputStorePaymentPurposeClass) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_check_gift_code_gen.go b/tg/tl_payments_check_gift_code_gen.go index e60e57b0e0..012f8c9986 100644 --- a/tg/tl_payments_check_gift_code_gen.go +++ b/tg/tl_payments_check_gift_code_gen.go @@ -172,6 +172,7 @@ func (c *PaymentsCheckGiftCodeRequest) GetSlug() (value string) { // // Possible errors: // +// 400 GIFT_SLUG_EXPIRED: The specified gift slug has expired. // 400 GIFT_SLUG_INVALID: The specified slug is invalid. // // See https://core.telegram.org/method/payments.checkGiftCode for reference. diff --git a/tg/tl_payments_get_payment_form_gen.go b/tg/tl_payments_get_payment_form_gen.go index ba15c00136..610dd53b7e 100644 --- a/tg/tl_payments_get_payment_form_gen.go +++ b/tg/tl_payments_get_payment_form_gen.go @@ -246,6 +246,7 @@ func (g *PaymentsGetPaymentFormRequest) GetThemeParams() (value DataJSON, ok boo // // 400 BOOST_PEER_INVALID: The specified boost_peer is invalid. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 SLUG_INVALID: The specified invoice slug is invalid. // 400 UNTIL_DATE_INVALID: Invalid until date provided. // diff --git a/tg/tl_payments_get_stars_gift_options_gen.go b/tg/tl_payments_get_stars_gift_options_gen.go index 99c031fd2b..eaabf22c4e 100644 --- a/tg/tl_payments_get_stars_gift_options_gen.go +++ b/tg/tl_payments_get_stars_gift_options_gen.go @@ -32,12 +32,20 @@ var ( ) // PaymentsGetStarsGiftOptionsRequest represents TL type `payments.getStarsGiftOptions#d3c96bc8`. +// Obtain a list of Telegram Stars gift options »¹ as starsGiftOption² constructors. +// +// Links: +// 1. https://core.telegram.org/api/stars#buying-or-gifting-stars +// 2. https://core.telegram.org/constructor/starsGiftOption // // See https://core.telegram.org/method/payments.getStarsGiftOptions for reference. type PaymentsGetStarsGiftOptionsRequest struct { - // Flags field of PaymentsGetStarsGiftOptionsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // UserID field of PaymentsGetStarsGiftOptionsRequest. + // Receiver of the gift (optional). // // Use SetUserID and GetUserID helpers. UserID InputUserClass @@ -205,6 +213,11 @@ func (g *PaymentsGetStarsGiftOptionsRequest) GetUserID() (value InputUserClass, } // PaymentsGetStarsGiftOptions invokes method payments.getStarsGiftOptions#d3c96bc8 returning error if any. +// Obtain a list of Telegram Stars gift options »¹ as starsGiftOption² constructors. +// +// Links: +// 1. https://core.telegram.org/api/stars#buying-or-gifting-stars +// 2. https://core.telegram.org/constructor/starsGiftOption // // See https://core.telegram.org/method/payments.getStarsGiftOptions for reference. func (c *Client) PaymentsGetStarsGiftOptions(ctx context.Context, request *PaymentsGetStarsGiftOptionsRequest) ([]StarsGiftOption, error) { diff --git a/tg/tl_payments_get_stars_revenue_ads_account_url_gen.go b/tg/tl_payments_get_stars_revenue_ads_account_url_gen.go index 825bb69f79..e166cf9c32 100644 --- a/tg/tl_payments_get_stars_revenue_ads_account_url_gen.go +++ b/tg/tl_payments_get_stars_revenue_ads_account_url_gen.go @@ -32,10 +32,16 @@ var ( ) // PaymentsGetStarsRevenueAdsAccountURLRequest represents TL type `payments.getStarsRevenueAdsAccountUrl#d1d7efc5`. +// Returns a URL for a Telegram Ad platform account that can be used to set up +// advertisements for channel/bot in peer, paid using the Telegram Stars owned by the +// specified peer, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/stars#paying-for-ads // // See https://core.telegram.org/method/payments.getStarsRevenueAdsAccountUrl for reference. type PaymentsGetStarsRevenueAdsAccountURLRequest struct { - // Peer field of PaymentsGetStarsRevenueAdsAccountURLRequest. + // Channel or bot that owns the stars. Peer InputPeerClass } @@ -166,6 +172,16 @@ func (g *PaymentsGetStarsRevenueAdsAccountURLRequest) GetPeer() (value InputPeer } // PaymentsGetStarsRevenueAdsAccountURL invokes method payments.getStarsRevenueAdsAccountUrl#d1d7efc5 returning error if any. +// Returns a URL for a Telegram Ad platform account that can be used to set up +// advertisements for channel/bot in peer, paid using the Telegram Stars owned by the +// specified peer, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/stars#paying-for-ads +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.getStarsRevenueAdsAccountUrl for reference. func (c *Client) PaymentsGetStarsRevenueAdsAccountURL(ctx context.Context, peer InputPeerClass) (*PaymentsStarsRevenueAdsAccountURL, error) { diff --git a/tg/tl_payments_get_stars_revenue_stats_gen.go b/tg/tl_payments_get_stars_revenue_stats_gen.go index 051b4e954b..ff77b1b639 100644 --- a/tg/tl_payments_get_stars_revenue_stats_gen.go +++ b/tg/tl_payments_get_stars_revenue_stats_gen.go @@ -32,14 +32,24 @@ var ( ) // PaymentsGetStarsRevenueStatsRequest represents TL type `payments.getStarsRevenueStats#d91ffad6`. +// Get Telegram Star revenue statistics »¹. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/method/payments.getStarsRevenueStats for reference. type PaymentsGetStarsRevenueStatsRequest struct { - // Flags field of PaymentsGetStarsRevenueStatsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Dark field of PaymentsGetStarsRevenueStatsRequest. + // Whether to enable dark theme for graph colors Dark bool - // Peer field of PaymentsGetStarsRevenueStatsRequest. + // Get statistics for the specified bot, channel or ourselves (inputPeerSelf¹). + // + // Links: + // 1) https://core.telegram.org/constructor/inputPeerSelf Peer InputPeerClass } @@ -219,6 +229,14 @@ func (g *PaymentsGetStarsRevenueStatsRequest) GetPeer() (value InputPeerClass) { } // PaymentsGetStarsRevenueStats invokes method payments.getStarsRevenueStats#d91ffad6 returning error if any. +// Get Telegram Star revenue statistics »¹. +// +// Links: +// 1. https://core.telegram.org/api/stars +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.getStarsRevenueStats for reference. func (c *Client) PaymentsGetStarsRevenueStats(ctx context.Context, request *PaymentsGetStarsRevenueStatsRequest) (*PaymentsStarsRevenueStats, error) { diff --git a/tg/tl_payments_get_stars_revenue_withdrawal_url_gen.go b/tg/tl_payments_get_stars_revenue_withdrawal_url_gen.go index 66d6571f42..e994d32a88 100644 --- a/tg/tl_payments_get_stars_revenue_withdrawal_url_gen.go +++ b/tg/tl_payments_get_stars_revenue_withdrawal_url_gen.go @@ -32,14 +32,21 @@ var ( ) // PaymentsGetStarsRevenueWithdrawalURLRequest represents TL type `payments.getStarsRevenueWithdrawalUrl#13bbe8b3`. +// Withdraw funds from a channel or bot's star balance »¹. +// +// Links: +// 1. https://core.telegram.org/api/stars#withdrawing-revenue // // See https://core.telegram.org/method/payments.getStarsRevenueWithdrawalUrl for reference. type PaymentsGetStarsRevenueWithdrawalURLRequest struct { - // Peer field of PaymentsGetStarsRevenueWithdrawalURLRequest. + // Channel or bot from which to withdraw funds. Peer InputPeerClass - // Stars field of PaymentsGetStarsRevenueWithdrawalURLRequest. + // Amount of stars to withdraw. Stars int64 - // Password field of PaymentsGetStarsRevenueWithdrawalURLRequest. + // 2FA password, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/srp#using-the-2fa-password Password InputCheckPasswordSRPClass } @@ -230,6 +237,16 @@ func (g *PaymentsGetStarsRevenueWithdrawalURLRequest) GetPasswordAsNotEmpty() (* } // PaymentsGetStarsRevenueWithdrawalURL invokes method payments.getStarsRevenueWithdrawalUrl#13bbe8b3 returning error if any. +// Withdraw funds from a channel or bot's star balance »¹. +// +// Links: +// 1. https://core.telegram.org/api/stars#withdrawing-revenue +// +// Possible errors: +// +// 400 PASSWORD_HASH_INVALID: The provided password hash is invalid. +// 400 PASSWORD_MISSING: You must enable 2FA before executing this operation. +// 400 PASSWORD_TOO_FRESH_%d: The password was modified less than 24 hours ago, try again in %d seconds. // // See https://core.telegram.org/method/payments.getStarsRevenueWithdrawalUrl for reference. func (c *Client) PaymentsGetStarsRevenueWithdrawalURL(ctx context.Context, request *PaymentsGetStarsRevenueWithdrawalURLRequest) (*PaymentsStarsRevenueWithdrawalURL, error) { diff --git a/tg/tl_payments_get_stars_status_gen.go b/tg/tl_payments_get_stars_status_gen.go index 5fb9996754..a4f19014ff 100644 --- a/tg/tl_payments_get_stars_status_gen.go +++ b/tg/tl_payments_get_stars_status_gen.go @@ -32,10 +32,16 @@ var ( ) // PaymentsGetStarsStatusRequest represents TL type `payments.getStarsStatus#104fcfa7`. +// Get the current Telegram Stars balance¹ of the current account (with +// peer=inputPeerSelf²), or the stars balance of the bot specified in peer. +// +// Links: +// 1. https://core.telegram.org/api/stars +// 2. https://core.telegram.org/constructor/inputPeerSelf // // See https://core.telegram.org/method/payments.getStarsStatus for reference. type PaymentsGetStarsStatusRequest struct { - // Peer field of PaymentsGetStarsStatusRequest. + // Peer of which to get the balance. Peer InputPeerClass } @@ -166,6 +172,16 @@ func (g *PaymentsGetStarsStatusRequest) GetPeer() (value InputPeerClass) { } // PaymentsGetStarsStatus invokes method payments.getStarsStatus#104fcfa7 returning error if any. +// Get the current Telegram Stars balance¹ of the current account (with +// peer=inputPeerSelf²), or the stars balance of the bot specified in peer. +// +// Links: +// 1. https://core.telegram.org/api/stars +// 2. https://core.telegram.org/constructor/inputPeerSelf +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.getStarsStatus for reference. func (c *Client) PaymentsGetStarsStatus(ctx context.Context, peer InputPeerClass) (*PaymentsStarsStatus, error) { diff --git a/tg/tl_payments_get_stars_topup_options_gen.go b/tg/tl_payments_get_stars_topup_options_gen.go index bb6f7828a4..2cd810a873 100644 --- a/tg/tl_payments_get_stars_topup_options_gen.go +++ b/tg/tl_payments_get_stars_topup_options_gen.go @@ -32,6 +32,11 @@ var ( ) // PaymentsGetStarsTopupOptionsRequest represents TL type `payments.getStarsTopupOptions#c00ec7d3`. +// Obtain a list of Telegram Stars topup options »¹ as starsTopupOption² constructors. +// +// Links: +// 1. https://core.telegram.org/api/stars#buying-or-gifting-stars +// 2. https://core.telegram.org/constructor/starsTopupOption // // See https://core.telegram.org/method/payments.getStarsTopupOptions for reference. type PaymentsGetStarsTopupOptionsRequest struct { @@ -128,6 +133,11 @@ func (g *PaymentsGetStarsTopupOptionsRequest) DecodeBare(b *bin.Buffer) error { } // PaymentsGetStarsTopupOptions invokes method payments.getStarsTopupOptions#c00ec7d3 returning error if any. +// Obtain a list of Telegram Stars topup options »¹ as starsTopupOption² constructors. +// +// Links: +// 1. https://core.telegram.org/api/stars#buying-or-gifting-stars +// 2. https://core.telegram.org/constructor/starsTopupOption // // See https://core.telegram.org/method/payments.getStarsTopupOptions for reference. func (c *Client) PaymentsGetStarsTopupOptions(ctx context.Context) ([]StarsTopupOption, error) { diff --git a/tg/tl_payments_get_stars_transactions_by_id_gen.go b/tg/tl_payments_get_stars_transactions_by_id_gen.go index bac3dbfcfc..c6e3e5b1a3 100644 --- a/tg/tl_payments_get_stars_transactions_by_id_gen.go +++ b/tg/tl_payments_get_stars_transactions_by_id_gen.go @@ -32,12 +32,16 @@ var ( ) // PaymentsGetStarsTransactionsByIDRequest represents TL type `payments.getStarsTransactionsByID#27842d2e`. +// Obtain info about Telegram Star transactions »¹ using specific transaction IDs. +// +// Links: +// 1. https://core.telegram.org/api/stars#balance-and-transaction-history // // See https://core.telegram.org/method/payments.getStarsTransactionsByID for reference. type PaymentsGetStarsTransactionsByIDRequest struct { - // Peer field of PaymentsGetStarsTransactionsByIDRequest. + // Channel or bot. Peer InputPeerClass - // ID field of PaymentsGetStarsTransactionsByIDRequest. + // Transaction IDs. ID []InputStarsTransaction } @@ -208,6 +212,14 @@ func (g *PaymentsGetStarsTransactionsByIDRequest) GetID() (value []InputStarsTra } // PaymentsGetStarsTransactionsByID invokes method payments.getStarsTransactionsByID#27842d2e returning error if any. +// Obtain info about Telegram Star transactions »¹ using specific transaction IDs. +// +// Links: +// 1. https://core.telegram.org/api/stars#balance-and-transaction-history +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.getStarsTransactionsByID for reference. func (c *Client) PaymentsGetStarsTransactionsByID(ctx context.Context, request *PaymentsGetStarsTransactionsByIDRequest) (*PaymentsStarsStatus, error) { diff --git a/tg/tl_payments_get_stars_transactions_gen.go b/tg/tl_payments_get_stars_transactions_gen.go index b71fea095e..d9d96d52fb 100644 --- a/tg/tl_payments_get_stars_transactions_gen.go +++ b/tg/tl_payments_get_stars_transactions_gen.go @@ -32,26 +32,45 @@ var ( ) // PaymentsGetStarsTransactionsRequest represents TL type `payments.getStarsTransactions#69da4557`. +// Fetch Telegram Stars transactions¹. +// The inbound and outbound flags are mutually exclusive: if none of the two are set, +// both incoming and outgoing transactions are fetched. +// +// Links: +// 1. https://core.telegram.org/api/stars#balance-and-transaction-history // // See https://core.telegram.org/method/payments.getStarsTransactions for reference. type PaymentsGetStarsTransactionsRequest struct { - // Flags field of PaymentsGetStarsTransactionsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Inbound field of PaymentsGetStarsTransactionsRequest. + // If set, fetches only incoming transactions. Inbound bool - // Outbound field of PaymentsGetStarsTransactionsRequest. + // If set, fetches only outgoing transactions. Outbound bool - // Ascending field of PaymentsGetStarsTransactionsRequest. + // Return transactions in ascending order by date (instead of descending order by date). Ascending bool // SubscriptionID field of PaymentsGetStarsTransactionsRequest. // // Use SetSubscriptionID and GetSubscriptionID helpers. SubscriptionID string - // Peer field of PaymentsGetStarsTransactionsRequest. + // Fetch the transaction history of the peer (inputPeerSelf¹ or a bot we own). + // + // Links: + // 1) https://core.telegram.org/constructor/inputPeerSelf Peer InputPeerClass - // Offset field of PaymentsGetStarsTransactionsRequest. + // Offset for pagination, obtained from the returned next_offset, initially an empty + // string »¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets Offset string - // Limit field of PaymentsGetStarsTransactionsRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -391,8 +410,20 @@ func (g *PaymentsGetStarsTransactionsRequest) GetLimit() (value int) { } // PaymentsGetStarsTransactions invokes method payments.getStarsTransactions#69da4557 returning error if any. +// Fetch Telegram Stars transactions¹. +// The inbound and outbound flags are mutually exclusive: if none of the two are set, +// both incoming and outgoing transactions are fetched. +// +// Links: +// 1. https://core.telegram.org/api/stars#balance-and-transaction-history +// +// Possible errors: +// +// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.getStarsTransactions for reference. +// Can be used by bots. func (c *Client) PaymentsGetStarsTransactions(ctx context.Context, request *PaymentsGetStarsTransactionsRequest) (*PaymentsStarsStatus, error) { var result PaymentsStarsStatus diff --git a/tg/tl_payments_payment_form_gen.go b/tg/tl_payments_payment_form_gen.go index e6bb3c33b1..fadc30b49d 100644 --- a/tg/tl_payments_payment_form_gen.go +++ b/tg/tl_payments_payment_form_gen.go @@ -803,26 +803,34 @@ func (p *PaymentsPaymentForm) MapUsers() (value UserClassArray) { } // PaymentsPaymentFormStars represents TL type `payments.paymentFormStars#7bf6b15c`. +// Represents a payment form, for payments to be using Telegram Stars, see here »¹ for +// more info. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/payments.paymentFormStars for reference. type PaymentsPaymentFormStars struct { - // Flags field of PaymentsPaymentFormStars. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // FormID field of PaymentsPaymentFormStars. + // Form ID. FormID int64 - // BotID field of PaymentsPaymentFormStars. + // Bot ID. BotID int64 - // Title field of PaymentsPaymentFormStars. + // Form title Title string - // Description field of PaymentsPaymentFormStars. + // Description Description string - // Photo field of PaymentsPaymentFormStars. + // Product photo // // Use SetPhoto and GetPhoto helpers. Photo WebDocumentClass - // Invoice field of PaymentsPaymentFormStars. + // Invoice Invoice Invoice - // Users field of PaymentsPaymentFormStars. + // Info about users mentioned in the other fields. Users []UserClass } diff --git a/tg/tl_payments_payment_receipt_gen.go b/tg/tl_payments_payment_receipt_gen.go index c3ba05c282..5b3c1934fd 100644 --- a/tg/tl_payments_payment_receipt_gen.go +++ b/tg/tl_payments_payment_receipt_gen.go @@ -660,32 +660,42 @@ func (p *PaymentsPaymentReceipt) MapUsers() (value UserClassArray) { } // PaymentsPaymentReceiptStars represents TL type `payments.paymentReceiptStars#dabbf83a`. +// Receipt for payment made using Telegram Stars¹. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/payments.paymentReceiptStars for reference. type PaymentsPaymentReceiptStars struct { - // Flags field of PaymentsPaymentReceiptStars. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Date field of PaymentsPaymentReceiptStars. + // Date of generation Date int - // BotID field of PaymentsPaymentReceiptStars. + // Bot ID BotID int64 - // Title field of PaymentsPaymentReceiptStars. + // Title Title string - // Description field of PaymentsPaymentReceiptStars. + // Description Description string - // Photo field of PaymentsPaymentReceiptStars. + // Product photo // // Use SetPhoto and GetPhoto helpers. Photo WebDocumentClass - // Invoice field of PaymentsPaymentReceiptStars. + // Invoice Invoice Invoice - // Currency field of PaymentsPaymentReceiptStars. + // Currency, always XTR. Currency string - // TotalAmount field of PaymentsPaymentReceiptStars. + // Amount of Telegram Stars¹. + // + // Links: + // 1) https://core.telegram.org/api/stars TotalAmount int64 - // TransactionID field of PaymentsPaymentReceiptStars. + // Transaction ID TransactionID string - // Users field of PaymentsPaymentReceiptStars. + // Info about users mentioned in the other fields. Users []UserClass } diff --git a/tg/tl_payments_refund_stars_charge_gen.go b/tg/tl_payments_refund_stars_charge_gen.go index f24655cb44..f7bdfdbb3d 100644 --- a/tg/tl_payments_refund_stars_charge_gen.go +++ b/tg/tl_payments_refund_stars_charge_gen.go @@ -32,12 +32,17 @@ var ( ) // PaymentsRefundStarsChargeRequest represents TL type `payments.refundStarsCharge#25ae8f4a`. +// Refund a Telegram Stars¹ transaction, see here »² for more info. +// +// Links: +// 1. https://core.telegram.org/api/stars +// 2. https://core.telegram.org/api/payments#6-refunds // // See https://core.telegram.org/method/payments.refundStarsCharge for reference. type PaymentsRefundStarsChargeRequest struct { - // UserID field of PaymentsRefundStarsChargeRequest. + // User to refund. UserID InputUserClass - // ChargeID field of PaymentsRefundStarsChargeRequest. + // Transaction ID. ChargeID string } @@ -193,8 +198,20 @@ func (r *PaymentsRefundStarsChargeRequest) GetChargeID() (value string) { } // PaymentsRefundStarsCharge invokes method payments.refundStarsCharge#25ae8f4a returning error if any. +// Refund a Telegram Stars¹ transaction, see here »² for more info. +// +// Links: +// 1. https://core.telegram.org/api/stars +// 2. https://core.telegram.org/api/payments#6-refunds +// +// Possible errors: +// +// 400 CHARGE_ALREADY_REFUNDED: The transaction was already refunded. +// 400 USER_BOT_REQUIRED: This method can only be called by a bot. +// 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/payments.refundStarsCharge for reference. +// Can be used by bots. func (c *Client) PaymentsRefundStarsCharge(ctx context.Context, request *PaymentsRefundStarsChargeRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_payments_send_payment_form_gen.go b/tg/tl_payments_send_payment_form_gen.go index eb2c9cbfd7..1d6603f0bb 100644 --- a/tg/tl_payments_send_payment_form_gen.go +++ b/tg/tl_payments_send_payment_form_gen.go @@ -405,6 +405,7 @@ func (s *PaymentsSendPaymentFormRequest) GetTipAmount() (value int64, ok bool) { // Possible errors: // // 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.sendPaymentForm for reference. func (c *Client) PaymentsSendPaymentForm(ctx context.Context, request *PaymentsSendPaymentFormRequest) (PaymentsPaymentResultClass, error) { diff --git a/tg/tl_payments_send_stars_form_gen.go b/tg/tl_payments_send_stars_form_gen.go index e2609940c6..ad06264328 100644 --- a/tg/tl_payments_send_stars_form_gen.go +++ b/tg/tl_payments_send_stars_form_gen.go @@ -32,14 +32,21 @@ var ( ) // PaymentsSendStarsFormRequest represents TL type `payments.sendStarsForm#2bb731d`. +// Make a payment using Telegram Stars, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/stars#using-stars // // See https://core.telegram.org/method/payments.sendStarsForm for reference. type PaymentsSendStarsFormRequest struct { - // Flags field of PaymentsSendStarsFormRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // FormID field of PaymentsSendStarsFormRequest. + // Payment form ID FormID int64 - // Invoice field of PaymentsSendStarsFormRequest. + // Invoice Invoice InputInvoiceClass } @@ -211,6 +218,16 @@ func (s *PaymentsSendStarsFormRequest) GetInvoice() (value InputInvoiceClass) { } // PaymentsSendStarsForm invokes method payments.sendStarsForm#2bb731d returning error if any. +// Make a payment using Telegram Stars, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/stars#using-stars +// +// Possible errors: +// +// 400 BALANCE_TOO_LOW: The transaction cannot be completed because the current Telegram Stars balance is too low. +// 400 FORM_EXPIRED: The form was generated more than 10 minutes ago and has expired, please re-generate it using payments.getPaymentForm and pass the new form_id. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.sendStarsForm for reference. func (c *Client) PaymentsSendStarsForm(ctx context.Context, request *PaymentsSendStarsFormRequest) (PaymentsPaymentResultClass, error) { diff --git a/tg/tl_payments_stars_revenue_ads_account_url_gen.go b/tg/tl_payments_stars_revenue_ads_account_url_gen.go index 8264a7581d..a60c2217f7 100644 --- a/tg/tl_payments_stars_revenue_ads_account_url_gen.go +++ b/tg/tl_payments_stars_revenue_ads_account_url_gen.go @@ -32,10 +32,15 @@ var ( ) // PaymentsStarsRevenueAdsAccountURL represents TL type `payments.starsRevenueAdsAccountUrl#394e7f21`. +// Contains a URL leading to a page where the user will be able to place ads for the +// channel/bot, paying using Telegram Stars¹. +// +// Links: +// 1. https://core.telegram.org/api/stars#paying-for-ads // // See https://core.telegram.org/constructor/payments.starsRevenueAdsAccountUrl for reference. type PaymentsStarsRevenueAdsAccountURL struct { - // URL field of PaymentsStarsRevenueAdsAccountURL. + // URL to open. URL string } diff --git a/tg/tl_payments_stars_revenue_stats_gen.go b/tg/tl_payments_stars_revenue_stats_gen.go index 776a2cc93d..bd3f040ec9 100644 --- a/tg/tl_payments_stars_revenue_stats_gen.go +++ b/tg/tl_payments_stars_revenue_stats_gen.go @@ -32,14 +32,19 @@ var ( ) // PaymentsStarsRevenueStats represents TL type `payments.starsRevenueStats#c92bb73b`. +// Star revenue statistics, see here »¹ for more info. +// Note that all balances and currency amounts and graph values are in Stars. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/payments.starsRevenueStats for reference. type PaymentsStarsRevenueStats struct { - // RevenueGraph field of PaymentsStarsRevenueStats. + // Star revenue graph (number of earned stars) RevenueGraph StatsGraphClass - // Status field of PaymentsStarsRevenueStats. + // Current balance, current withdrawable balance and overall earned Telegram Stars Status StarsRevenueStatus - // UsdRate field of PaymentsStarsRevenueStats. + // Current conversion rate of Telegram Stars to USD UsdRate float64 } diff --git a/tg/tl_payments_stars_revenue_withdrawal_url_gen.go b/tg/tl_payments_stars_revenue_withdrawal_url_gen.go index e505679adf..8e3ec4577c 100644 --- a/tg/tl_payments_stars_revenue_withdrawal_url_gen.go +++ b/tg/tl_payments_stars_revenue_withdrawal_url_gen.go @@ -32,10 +32,17 @@ var ( ) // PaymentsStarsRevenueWithdrawalURL represents TL type `payments.starsRevenueWithdrawalUrl#1dab80b7`. +// Contains the URL to use to withdraw Telegram Star revenue¹. +// +// Links: +// 1. https://core.telegram.org/api/stars#withdrawing-revenue // // See https://core.telegram.org/constructor/payments.starsRevenueWithdrawalUrl for reference. type PaymentsStarsRevenueWithdrawalURL struct { - // URL field of PaymentsStarsRevenueWithdrawalURL. + // Contains the URL to use to withdraw Telegram Star revenue¹. + // + // Links: + // 1) https://core.telegram.org/api/stars#withdrawing-revenue URL string } diff --git a/tg/tl_payments_stars_status_gen.go b/tg/tl_payments_stars_status_gen.go index 20526df3a0..4844c4bb6a 100644 --- a/tg/tl_payments_stars_status_gen.go +++ b/tg/tl_payments_stars_status_gen.go @@ -32,12 +32,19 @@ var ( ) // PaymentsStarsStatus represents TL type `payments.starsStatus#bbfa316c`. +// Info about the current Telegram Star balance and transaction history »¹. +// +// Links: +// 1. https://core.telegram.org/api/stars#balance-and-transaction-history // // See https://core.telegram.org/constructor/payments.starsStatus for reference. type PaymentsStarsStatus struct { - // Flags field of PaymentsStarsStatus. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Balance field of PaymentsStarsStatus. + // Current Telegram Star balance. Balance int64 // Subscriptions field of PaymentsStarsStatus. // @@ -51,17 +58,21 @@ type PaymentsStarsStatus struct { // // Use SetSubscriptionsMissingBalance and GetSubscriptionsMissingBalance helpers. SubscriptionsMissingBalance int64 - // History field of PaymentsStarsStatus. + // List of Telegram Star transactions (partial if next_offset is set). // // Use SetHistory and GetHistory helpers. History []StarsTransaction - // NextOffset field of PaymentsStarsStatus. + // Offset to use to fetch more transactions from the transaction history using payments + // getStarsTransactions¹. + // + // Links: + // 1) https://core.telegram.org/method/payments.getStarsTransactions // // Use SetNextOffset and GetNextOffset helpers. NextOffset string - // Chats field of PaymentsStarsStatus. + // Chats mentioned in history. Chats []ChatClass - // Users field of PaymentsStarsStatus. + // Users mentioned in history. Users []UserClass } diff --git a/tg/tl_payments_validate_requested_info_gen.go b/tg/tl_payments_validate_requested_info_gen.go index 4119e7c9d6..ed24884910 100644 --- a/tg/tl_payments_validate_requested_info_gen.go +++ b/tg/tl_payments_validate_requested_info_gen.go @@ -255,6 +255,7 @@ func (v *PaymentsValidateRequestedInfoRequest) GetInfo() (value PaymentRequested // Possible errors: // // 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.validateRequestedInfo for reference. func (c *Client) PaymentsValidateRequestedInfo(ctx context.Context, request *PaymentsValidateRequestedInfoRequest) (*PaymentsValidatedRequestedInfo, error) { diff --git a/tg/tl_peer_settings_gen.go b/tg/tl_peer_settings_gen.go index dd8d89375b..b8905d4c3d 100644 --- a/tg/tl_peer_settings_gen.go +++ b/tg/tl_peer_settings_gen.go @@ -74,9 +74,21 @@ type PeerSettings struct { // 1) https://core.telegram.org/api/invites#join-requests // 2) https://core.telegram.org/api/invites#join-requests RequestChatBroadcast bool - // BusinessBotPaused field of PeerSettings. + // This flag is set if both business_bot_id and business_bot_manage_url are set and all + // connected business bots »¹ were paused in this chat using account + // toggleConnectedBotPaused »². + // + // Links: + // 1) https://core.telegram.org/api/business#connected-bots + // 2) https://core.telegram.org/method/account.toggleConnectedBotPaused BusinessBotPaused bool - // BusinessBotCanReply field of PeerSettings. + // This flag is set if both business_bot_id and business_bot_manage_url are set and + // connected business bots »¹ can reply to messages in this chat, as specified by the + // settings during initial configuration². + // + // Links: + // 1) https://core.telegram.org/api/business#connected-bots + // 2) https://core.telegram.org/api/business#connected-bots BusinessBotCanReply bool // Distance in meters between us and this peer // @@ -96,11 +108,19 @@ type PeerSettings struct { // // Use SetRequestChatDate and GetRequestChatDate helpers. RequestChatDate int - // BusinessBotID field of PeerSettings. + // Contains the ID of the business bot »¹ managing this chat, used to display info + // about the bot in the action bar. + // + // Links: + // 1) https://core.telegram.org/api/business#connected-bots // // Use SetBusinessBotID and GetBusinessBotID helpers. BusinessBotID int64 - // BusinessBotManageURL field of PeerSettings. + // Contains a deep link »¹, used to open a management menu in the business bot. This + // flag is set if and only if business_bot_id is set. + // + // Links: + // 1) https://core.telegram.org/api/links // // Use SetBusinessBotManageURL and GetBusinessBotManageURL helpers. BusinessBotManageURL string diff --git a/tg/tl_phone_call_gen.go b/tg/tl_phone_call_gen.go index 3f33639f00..63dea15582 100644 --- a/tg/tl_phone_call_gen.go +++ b/tg/tl_phone_call_gen.go @@ -1288,11 +1288,11 @@ type PhoneCall struct { KeyFingerprint int64 // Call protocol info to be passed to libtgvoip Protocol PhoneCallProtocol - // List of endpoints the user can connect to to exchange call data + // List of endpoints the user can connect to exchange call data Connections []PhoneConnectionClass // When was the call actually started StartDate int - // CustomParameters field of PhoneCall. + // Custom JSON-encoded call parameters to be passed to tgcalls. // // Use SetCustomParameters and GetCustomParameters helpers. CustomParameters DataJSON diff --git a/tg/tl_phone_check_group_call_gen.go b/tg/tl_phone_check_group_call_gen.go index ff386a3eff..14ab447dec 100644 --- a/tg/tl_phone_check_group_call_gen.go +++ b/tg/tl_phone_check_group_call_gen.go @@ -212,6 +212,7 @@ func (c *PhoneCheckGroupCallRequest) GetSources() (value []int) { // // Possible errors: // +// 400 GROUPCALL_INVALID: The specified group call is invalid. // 400 GROUPCALL_JOIN_MISSING: You haven't joined this group call. // // See https://core.telegram.org/method/phone.checkGroupCall for reference. diff --git a/tg/tl_phone_edit_group_call_participant_gen.go b/tg/tl_phone_edit_group_call_participant_gen.go index 4d0ff8a7f9..0a829dbf44 100644 --- a/tg/tl_phone_edit_group_call_participant_gen.go +++ b/tg/tl_phone_edit_group_call_participant_gen.go @@ -518,8 +518,12 @@ func (e *PhoneEditGroupCallParticipantRequest) GetPresentationPaused() (value bo // Possible errors: // // 403 GROUPCALL_FORBIDDEN: The group call has already ended. +// 400 GROUPCALL_INVALID: The specified group call is invalid. // 400 PARTICIPANT_JOIN_MISSING: Trying to enable a presentation, when the user hasn't joined the Video Chat with phone.joinGroupCall. +// 400 RAISE_HAND_FORBIDDEN: You cannot raise your hand. // 400 USER_VOLUME_INVALID: The specified user volume is invalid. +// 400 VIDEO_PAUSE_FORBIDDEN: You cannot pause the video stream. +// 400 VIDEO_STOP_FORBIDDEN: You cannot stop the video stream. // // See https://core.telegram.org/method/phone.editGroupCallParticipant for reference. func (c *Client) PhoneEditGroupCallParticipant(ctx context.Context, request *PhoneEditGroupCallParticipantRequest) (UpdatesClass, error) { diff --git a/tg/tl_phone_edit_group_call_title_gen.go b/tg/tl_phone_edit_group_call_title_gen.go index 8f851ae61d..83080d8395 100644 --- a/tg/tl_phone_edit_group_call_title_gen.go +++ b/tg/tl_phone_edit_group_call_title_gen.go @@ -194,6 +194,7 @@ func (e *PhoneEditGroupCallTitleRequest) GetTitle() (value string) { // Possible errors: // // 403 GROUPCALL_FORBIDDEN: The group call has already ended. +// 400 GROUPCALL_INVALID: The specified group call is invalid. // // See https://core.telegram.org/method/phone.editGroupCallTitle for reference. func (c *Client) PhoneEditGroupCallTitle(ctx context.Context, request *PhoneEditGroupCallTitleRequest) (UpdatesClass, error) { diff --git a/tg/tl_phone_export_group_call_invite_gen.go b/tg/tl_phone_export_group_call_invite_gen.go index 1443ddcfee..b169d40ff9 100644 --- a/tg/tl_phone_export_group_call_invite_gen.go +++ b/tg/tl_phone_export_group_call_invite_gen.go @@ -230,6 +230,7 @@ func (e *PhoneExportGroupCallInviteRequest) GetCall() (value InputGroupCall) { // // Possible errors: // +// 400 GROUPCALL_INVALID: The specified group call is invalid. // 403 PUBLIC_CHANNEL_MISSING: You can only export group call invite links for public chats or channels. // // See https://core.telegram.org/method/phone.exportGroupCallInvite for reference. diff --git a/tg/tl_phone_get_group_call_stream_rtmp_url_gen.go b/tg/tl_phone_get_group_call_stream_rtmp_url_gen.go index 76a3f4a18b..2bd11c2647 100644 --- a/tg/tl_phone_get_group_call_stream_rtmp_url_gen.go +++ b/tg/tl_phone_get_group_call_stream_rtmp_url_gen.go @@ -207,6 +207,7 @@ func (g *PhoneGetGroupCallStreamRtmpURLRequest) GetRevoke() (value bool) { // Possible errors: // // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/phone.getGroupCallStreamRtmpUrl for reference. func (c *Client) PhoneGetGroupCallStreamRtmpURL(ctx context.Context, request *PhoneGetGroupCallStreamRtmpURLRequest) (*PhoneGroupCallStreamRtmpURL, error) { diff --git a/tg/tl_phone_get_group_participants_gen.go b/tg/tl_phone_get_group_participants_gen.go index 80da26a494..76b366b4a4 100644 --- a/tg/tl_phone_get_group_participants_gen.go +++ b/tg/tl_phone_get_group_participants_gen.go @@ -318,6 +318,10 @@ func (g *PhoneGetGroupParticipantsRequest) MapIDs() (value InputPeerClassArray) // PhoneGetGroupParticipants invokes method phone.getGroupParticipants#c558d8ab returning error if any. // Get group call participants // +// Possible errors: +// +// 400 GROUPCALL_INVALID: The specified group call is invalid. +// // See https://core.telegram.org/method/phone.getGroupParticipants for reference. func (c *Client) PhoneGetGroupParticipants(ctx context.Context, request *PhoneGetGroupParticipantsRequest) (*PhoneGroupParticipants, error) { var result PhoneGroupParticipants diff --git a/tg/tl_phone_invite_to_group_call_gen.go b/tg/tl_phone_invite_to_group_call_gen.go index a54cf13308..bbc7c8873b 100644 --- a/tg/tl_phone_invite_to_group_call_gen.go +++ b/tg/tl_phone_invite_to_group_call_gen.go @@ -220,6 +220,7 @@ func (i *PhoneInviteToGroupCallRequest) MapUsers() (value InputUserClassArray) { // 400 GROUPCALL_INVALID: The specified group call is invalid. // 400 INVITE_FORBIDDEN_WITH_JOINAS: If the user has anonymously joined a group call as a channel, they can't invite other users to the group call because that would cause deanonymization, because the invite would be sent using the original user ID, not the anonymized channel ID. // 400 USER_ALREADY_INVITED: You have already invited this user. +// 403 USER_NOT_PARTICIPANT: You're not a member of this supergroup/channel. // // See https://core.telegram.org/method/phone.inviteToGroupCall for reference. func (c *Client) PhoneInviteToGroupCall(ctx context.Context, request *PhoneInviteToGroupCallRequest) (UpdatesClass, error) { diff --git a/tg/tl_phone_join_group_call_presentation_gen.go b/tg/tl_phone_join_group_call_presentation_gen.go index 1a0bfc5dd3..6b63823179 100644 --- a/tg/tl_phone_join_group_call_presentation_gen.go +++ b/tg/tl_phone_join_group_call_presentation_gen.go @@ -193,6 +193,7 @@ func (j *PhoneJoinGroupCallPresentationRequest) GetParams() (value DataJSON) { // // Possible errors: // +// 400 GROUPCALL_INVALID: The specified group call is invalid. // 403 PARTICIPANT_JOIN_MISSING: Trying to enable a presentation, when the user hasn't joined the Video Chat with phone.joinGroupCall. // // See https://core.telegram.org/method/phone.joinGroupCallPresentation for reference. diff --git a/tg/tl_phone_leave_group_call_gen.go b/tg/tl_phone_leave_group_call_gen.go index 3473924e64..c803f8a330 100644 --- a/tg/tl_phone_leave_group_call_gen.go +++ b/tg/tl_phone_leave_group_call_gen.go @@ -191,6 +191,10 @@ func (l *PhoneLeaveGroupCallRequest) GetSource() (value int) { // PhoneLeaveGroupCall invokes method phone.leaveGroupCall#500377f9 returning error if any. // Leave a group call // +// Possible errors: +// +// 400 GROUPCALL_INVALID: The specified group call is invalid. +// // See https://core.telegram.org/method/phone.leaveGroupCall for reference. func (c *Client) PhoneLeaveGroupCall(ctx context.Context, request *PhoneLeaveGroupCallRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_phone_leave_group_call_presentation_gen.go b/tg/tl_phone_leave_group_call_presentation_gen.go index 2ef894c0fa..ccf9e500c8 100644 --- a/tg/tl_phone_leave_group_call_presentation_gen.go +++ b/tg/tl_phone_leave_group_call_presentation_gen.go @@ -164,6 +164,10 @@ func (l *PhoneLeaveGroupCallPresentationRequest) GetCall() (value InputGroupCall // PhoneLeaveGroupCallPresentation invokes method phone.leaveGroupCallPresentation#1c50d144 returning error if any. // Stop screen sharing in a group call // +// Possible errors: +// +// 400 GROUPCALL_INVALID: The specified group call is invalid. +// // See https://core.telegram.org/method/phone.leaveGroupCallPresentation for reference. func (c *Client) PhoneLeaveGroupCallPresentation(ctx context.Context, call InputGroupCall) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_phone_save_call_log_gen.go b/tg/tl_phone_save_call_log_gen.go index e51ffd3aee..f4412497a4 100644 --- a/tg/tl_phone_save_call_log_gen.go +++ b/tg/tl_phone_save_call_log_gen.go @@ -196,6 +196,10 @@ func (s *PhoneSaveCallLogRequest) GetFile() (value InputFileClass) { // PhoneSaveCallLog invokes method phone.saveCallLog#41248786 returning error if any. // Save phone call debug information // +// Possible errors: +// +// 400 CALL_PEER_INVALID: The provided call peer object is invalid. +// // See https://core.telegram.org/method/phone.saveCallLog for reference. func (c *Client) PhoneSaveCallLog(ctx context.Context, request *PhoneSaveCallLogRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_phone_save_default_group_call_join_as_gen.go b/tg/tl_phone_save_default_group_call_join_as_gen.go index e3c4ef5d31..72c90e30fd 100644 --- a/tg/tl_phone_save_default_group_call_join_as_gen.go +++ b/tg/tl_phone_save_default_group_call_join_as_gen.go @@ -205,6 +205,7 @@ func (s *PhoneSaveDefaultGroupCallJoinAsRequest) GetJoinAs() (value InputPeerCla // Possible errors: // // 400 JOIN_AS_PEER_INVALID: The specified peer cannot be used to join a group call. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/phone.saveDefaultGroupCallJoinAs for reference. func (c *Client) PhoneSaveDefaultGroupCallJoinAs(ctx context.Context, request *PhoneSaveDefaultGroupCallJoinAsRequest) (bool, error) { diff --git a/tg/tl_phone_send_signaling_data_gen.go b/tg/tl_phone_send_signaling_data_gen.go index f259509e24..86294f9d64 100644 --- a/tg/tl_phone_send_signaling_data_gen.go +++ b/tg/tl_phone_send_signaling_data_gen.go @@ -191,6 +191,10 @@ func (s *PhoneSendSignalingDataRequest) GetData() (value []byte) { // PhoneSendSignalingData invokes method phone.sendSignalingData#ff7a9383 returning error if any. // Send VoIP signaling data // +// Possible errors: +// +// 400 CALL_PEER_INVALID: The provided call peer object is invalid. +// // See https://core.telegram.org/method/phone.sendSignalingData for reference. func (c *Client) PhoneSendSignalingData(ctx context.Context, request *PhoneSendSignalingDataRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_phone_start_scheduled_group_call_gen.go b/tg/tl_phone_start_scheduled_group_call_gen.go index 46b382a33d..5e5035c9b7 100644 --- a/tg/tl_phone_start_scheduled_group_call_gen.go +++ b/tg/tl_phone_start_scheduled_group_call_gen.go @@ -164,6 +164,11 @@ func (s *PhoneStartScheduledGroupCallRequest) GetCall() (value InputGroupCall) { // PhoneStartScheduledGroupCall invokes method phone.startScheduledGroupCall#5680e342 returning error if any. // Start a scheduled group call. // +// Possible errors: +// +// 403 GROUPCALL_ALREADY_STARTED: The groupcall has already started, you can join directly using phone.joinGroupCall. +// 400 GROUPCALL_INVALID: The specified group call is invalid. +// // See https://core.telegram.org/method/phone.startScheduledGroupCall for reference. func (c *Client) PhoneStartScheduledGroupCall(ctx context.Context, call InputGroupCall) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_phone_toggle_group_call_record_gen.go b/tg/tl_phone_toggle_group_call_record_gen.go index c5771be80d..557d4e9764 100644 --- a/tg/tl_phone_toggle_group_call_record_gen.go +++ b/tg/tl_phone_toggle_group_call_record_gen.go @@ -356,6 +356,7 @@ func (t *PhoneToggleGroupCallRecordRequest) GetVideoPortrait() (value bool, ok b // Possible errors: // // 403 GROUPCALL_FORBIDDEN: The group call has already ended. +// 400 GROUPCALL_INVALID: The specified group call is invalid. // 400 GROUPCALL_NOT_MODIFIED: Group call settings weren't modified. // // See https://core.telegram.org/method/phone.toggleGroupCallRecord for reference. diff --git a/tg/tl_phone_toggle_group_call_settings_gen.go b/tg/tl_phone_toggle_group_call_settings_gen.go index 95b942e282..f3c1096cb0 100644 --- a/tg/tl_phone_toggle_group_call_settings_gen.go +++ b/tg/tl_phone_toggle_group_call_settings_gen.go @@ -271,6 +271,7 @@ func (t *PhoneToggleGroupCallSettingsRequest) GetJoinMuted() (value bool, ok boo // // Possible errors: // +// 400 GROUPCALL_INVALID: The specified group call is invalid. // 400 GROUPCALL_NOT_MODIFIED: Group call settings weren't modified. // // See https://core.telegram.org/method/phone.toggleGroupCallSettings for reference. diff --git a/tg/tl_phone_toggle_group_call_start_subscription_gen.go b/tg/tl_phone_toggle_group_call_start_subscription_gen.go index 0e5a972228..6af9f2f23a 100644 --- a/tg/tl_phone_toggle_group_call_start_subscription_gen.go +++ b/tg/tl_phone_toggle_group_call_start_subscription_gen.go @@ -194,6 +194,7 @@ func (t *PhoneToggleGroupCallStartSubscriptionRequest) GetSubscribed() (value bo // Possible errors: // // 403 GROUPCALL_ALREADY_STARTED: The groupcall has already started, you can join directly using phone.joinGroupCall. +// 400 GROUPCALL_INVALID: The specified group call is invalid. // // See https://core.telegram.org/method/phone.toggleGroupCallStartSubscription for reference. func (c *Client) PhoneToggleGroupCallStartSubscription(ctx context.Context, request *PhoneToggleGroupCallStartSubscriptionRequest) (UpdatesClass, error) { diff --git a/tg/tl_photos_upload_contact_profile_photo_gen.go b/tg/tl_photos_upload_contact_profile_photo_gen.go index 0a2c2e3f28..6cea55b288 100644 --- a/tg/tl_photos_upload_contact_profile_photo_gen.go +++ b/tg/tl_photos_upload_contact_profile_photo_gen.go @@ -498,7 +498,6 @@ func (u *PhotosUploadContactProfilePhotoRequest) GetVideoEmojiMarkup() (value Vi // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/photos.uploadContactProfilePhoto for reference. -// Can be used by bots. func (c *Client) PhotosUploadContactProfilePhoto(ctx context.Context, request *PhotosUploadContactProfilePhotoRequest) (*PhotosPhoto, error) { var result PhotosPhoto diff --git a/tg/tl_poll_answer_gen.go b/tg/tl_poll_answer_gen.go index d13892fbcd..d9da62d72e 100644 --- a/tg/tl_poll_answer_gen.go +++ b/tg/tl_poll_answer_gen.go @@ -36,7 +36,12 @@ var ( // // See https://core.telegram.org/constructor/pollAnswer for reference. type PollAnswer struct { - // Textual representation of the answer + // Textual representation of the answer (only Premium¹ users can use custom emoji + // entities² here). + // + // Links: + // 1) https://core.telegram.org/api/premium + // 2) https://core.telegram.org/api/custom-emoji Text TextWithEntities // The param that has to be passed to messages.sendVote¹. // diff --git a/tg/tl_poll_gen.go b/tg/tl_poll_gen.go index dd90dd0432..6ccb47bf88 100644 --- a/tg/tl_poll_gen.go +++ b/tg/tl_poll_gen.go @@ -52,7 +52,11 @@ type Poll struct { // Whether this is a quiz (with wrong and correct answers, results shown in the return // type) Quiz bool - // The question of the poll + // The question of the poll (only Premium¹ users can use custom emoji entities² here). + // + // Links: + // 1) https://core.telegram.org/api/premium + // 2) https://core.telegram.org/api/custom-emoji Question TextWithEntities // The possible answers, vote using messages.sendVote¹. // diff --git a/tg/tl_premium_boosts_status_gen.go b/tg/tl_premium_boosts_status_gen.go index 0901d43acf..959d6833a6 100644 --- a/tg/tl_premium_boosts_status_gen.go +++ b/tg/tl_premium_boosts_status_gen.go @@ -44,16 +44,17 @@ type PremiumBoostsStatus struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Whether we're currently boosting this channel, my_boost_slots will also be set. + // Whether we're currently boosting this channel/supergroup, my_boost_slots will also be + // set. MyBoost bool - // The current boost level of the channel. + // The current boost level of the channel/supergroup. Level int // The number of boosts acquired so far in the current level. CurrentLevelBoosts int // Total number of boosts acquired so far. Boosts int // The number of boosts acquired from created Telegram Premium gift codes¹ and - // giveaways²; only returned to channel admins. + // giveaways²; only returned to channel/supergroup admins. // // Links: // 1) https://core.telegram.org/api/giveaways @@ -66,8 +67,9 @@ type PremiumBoostsStatus struct { // // Use SetNextLevelBoosts and GetNextLevelBoosts helpers. NextLevelBoosts int - // Only returned to channel admins: contains the approximated number of Premium users - // subscribed to the channel, related to the total number of subscribers. + // Only returned to channel/supergroup admins: contains the approximated number of + // Premium users subscribed to the channel/supergroup, related to the total number of + // subscribers. // // Use SetPremiumAudience and GetPremiumAudience helpers. PremiumAudience StatsPercentValue @@ -76,7 +78,8 @@ type PremiumBoostsStatus struct { // Links: // 1) https://core.telegram.org/api/links#boost-links BoostURL string - // A list of prepaid giveaways¹ available for the chat; only returned to channel admins. + // A list of prepaid giveaways¹ available for the chat; only returned to + // channel/supergroup admins. // // Links: // 1) https://core.telegram.org/api/giveaways diff --git a/tg/tl_premium_get_boosts_list_gen.go b/tg/tl_premium_get_boosts_list_gen.go index ec6fb97e1b..a46a3e6c1b 100644 --- a/tg/tl_premium_get_boosts_list_gen.go +++ b/tg/tl_premium_get_boosts_list_gen.go @@ -32,7 +32,8 @@ var ( ) // PremiumGetBoostsListRequest represents TL type `premium.getBoostsList#60f67660`. -// Obtains info about the boosts that were applied to a certain channel (admins only) +// Obtains info about the boosts that were applied to a certain channel or supergroup +// (admins only) // // See https://core.telegram.org/method/premium.getBoostsList for reference. type PremiumGetBoostsListRequest struct { @@ -42,12 +43,12 @@ type PremiumGetBoostsListRequest struct { // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Whether to return only info about boosts received from gift codes and giveaways - // created by the channel »¹ + // created by the channel/supergroup »¹ // // Links: // 1) https://core.telegram.org/api/giveaways Gifts bool - // The channel + // The channel/supergroup Peer InputPeerClass // Offset for pagination, obtained from premium.boostsList¹.next_offset // @@ -287,7 +288,8 @@ func (g *PremiumGetBoostsListRequest) GetLimit() (value int) { } // PremiumGetBoostsList invokes method premium.getBoostsList#60f67660 returning error if any. -// Obtains info about the boosts that were applied to a certain channel (admins only) +// Obtains info about the boosts that were applied to a certain channel or supergroup +// (admins only) // // Possible errors: // diff --git a/tg/tl_premium_get_boosts_status_gen.go b/tg/tl_premium_get_boosts_status_gen.go index 21ea527c42..6d56234049 100644 --- a/tg/tl_premium_get_boosts_status_gen.go +++ b/tg/tl_premium_get_boosts_status_gen.go @@ -32,7 +32,7 @@ var ( ) // PremiumGetBoostsStatusRequest represents TL type `premium.getBoostsStatus#42f1f61`. -// Gets the current number of boosts¹ of a channel. +// Gets the current number of boosts¹ of a channel/supergroup. // // Links: // 1. https://core.telegram.org/api/boost @@ -170,7 +170,7 @@ func (g *PremiumGetBoostsStatusRequest) GetPeer() (value InputPeerClass) { } // PremiumGetBoostsStatus invokes method premium.getBoostsStatus#42f1f61 returning error if any. -// Gets the current number of boosts¹ of a channel. +// Gets the current number of boosts¹ of a channel/supergroup. // // Links: // 1. https://core.telegram.org/api/boost diff --git a/tg/tl_premium_get_user_boosts_gen.go b/tg/tl_premium_get_user_boosts_gen.go index bd5b4edec3..f4e28db288 100644 --- a/tg/tl_premium_get_user_boosts_gen.go +++ b/tg/tl_premium_get_user_boosts_gen.go @@ -32,12 +32,12 @@ var ( ) // PremiumGetUserBoostsRequest represents TL type `premium.getUserBoosts#39854d1f`. -// Returns the lists of boost that were applied to a channel by a specific user (admins -// only) +// Returns the lists of boost that were applied to a channel/supergroup by a specific +// user (admins only) // // See https://core.telegram.org/method/premium.getUserBoosts for reference. type PremiumGetUserBoostsRequest struct { - // The channel + // The channel/supergroup Peer InputPeerClass // The user UserID InputUserClass @@ -200,8 +200,8 @@ func (g *PremiumGetUserBoostsRequest) GetUserID() (value InputUserClass) { } // PremiumGetUserBoosts invokes method premium.getUserBoosts#39854d1f returning error if any. -// Returns the lists of boost that were applied to a channel by a specific user (admins -// only) +// Returns the lists of boost that were applied to a channel/supergroup by a specific +// user (admins only) // // Possible errors: // diff --git a/tg/tl_privacy_key_gen.go b/tg/tl_privacy_key_gen.go index 7315113f66..36cf9dc922 100644 --- a/tg/tl_privacy_key_gen.go +++ b/tg/tl_privacy_key_gen.go @@ -32,7 +32,20 @@ var ( ) // PrivacyKeyStatusTimestamp represents TL type `privacyKeyStatusTimestamp#bc2eab30`. -// Whether we can see the last online timestamp of this user +// Whether we can see the last online timestamp of this user. +// Note that if we decide to hide our exact last online timestamp to someone (i.e., users +// A, B, C, or all users) and we do not have a Premium¹ subscription, we won't be able +// to see the exact last online timestamp of those users (A, B, C, or all users), even if +// those users do share it with us. +// If those users do share their exact online status with us, but we can't see it due to +// the reason mentioned above, the by_me flag of userStatusRecently¹, +// userStatusLastWeek², userStatusLastMonth³ will be set. +// +// Links: +// 1. https://core.telegram.org/api/premium +// 2. https://core.telegram.org/constructor/userStatusRecently +// 3. https://core.telegram.org/constructor/userStatusLastWeek +// 4. https://core.telegram.org/constructor/userStatusLastMonth // // See https://core.telegram.org/constructor/privacyKeyStatusTimestamp for reference. type PrivacyKeyStatusTimestamp struct { @@ -1055,6 +1068,7 @@ func (p *PrivacyKeyAbout) DecodeBare(b *bin.Buffer) error { } // PrivacyKeyBirthday represents TL type `privacyKeyBirthday#2000a518`. +// Whether the user can see our birthday. // // See https://core.telegram.org/constructor/privacyKeyBirthday for reference. type PrivacyKeyBirthday struct { diff --git a/tg/tl_privacy_rule_gen.go b/tg/tl_privacy_rule_gen.go index 791ec949b1..cbf9f6c3be 100644 --- a/tg/tl_privacy_rule_gen.go +++ b/tg/tl_privacy_rule_gen.go @@ -1137,6 +1137,12 @@ func (p *PrivacyValueAllowCloseFriends) DecodeBare(b *bin.Buffer) error { } // PrivacyValueAllowPremium represents TL type `privacyValueAllowPremium#ece9814b`. +// Allow only users with a Premium subscription »¹, currently only usable for +// inputPrivacyKeyChatInvite². +// +// Links: +// 1. https://core.telegram.org/api/premium +// 2. https://core.telegram.org/constructor/inputPrivacyKeyChatInvite // // See https://core.telegram.org/constructor/privacyValueAllowPremium for reference. type PrivacyValueAllowPremium struct { diff --git a/tg/tl_quick_reply_gen.go b/tg/tl_quick_reply_gen.go index 97859a2ebb..9f652e5753 100644 --- a/tg/tl_quick_reply_gen.go +++ b/tg/tl_quick_reply_gen.go @@ -32,16 +32,20 @@ var ( ) // QuickReply represents TL type `quickReply#697102b`. +// A quick reply shortcut¹. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/constructor/quickReply for reference. type QuickReply struct { - // ShortcutID field of QuickReply. + // Unique shortcut ID. ShortcutID int - // Shortcut field of QuickReply. + // Shortcut name. Shortcut string - // TopMessage field of QuickReply. + // ID of the last message in the shortcut. TopMessage int - // Count field of QuickReply. + // Total number of messages in the shortcut. Count int } diff --git a/tg/tl_reaction_notifications_from_gen.go b/tg/tl_reaction_notifications_from_gen.go index 1f0f312a27..6babc34d7e 100644 --- a/tg/tl_reaction_notifications_from_gen.go +++ b/tg/tl_reaction_notifications_from_gen.go @@ -32,6 +32,7 @@ var ( ) // ReactionNotificationsFromContacts represents TL type `reactionNotificationsFromContacts#bac3a61a`. +// Receive notifications about reactions made only by our contacts. // // See https://core.telegram.org/constructor/reactionNotificationsFromContacts for reference. type ReactionNotificationsFromContacts struct { @@ -133,6 +134,7 @@ func (r *ReactionNotificationsFromContacts) DecodeBare(b *bin.Buffer) error { } // ReactionNotificationsFromAll represents TL type `reactionNotificationsFromAll#4b9e22a0`. +// Receive notifications about reactions made by any user. // // See https://core.telegram.org/constructor/reactionNotificationsFromAll for reference. type ReactionNotificationsFromAll struct { diff --git a/tg/tl_reactions_notify_settings_gen.go b/tg/tl_reactions_notify_settings_gen.go index 27254d0d14..05ff5daf7b 100644 --- a/tg/tl_reactions_notify_settings_gen.go +++ b/tg/tl_reactions_notify_settings_gen.go @@ -32,22 +32,39 @@ var ( ) // ReactionsNotifySettings represents TL type `reactionsNotifySettings#56e34970`. +// Reaction notification settings, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/reactions#notifications-about-reactions // // See https://core.telegram.org/constructor/reactionsNotifySettings for reference. type ReactionsNotifySettings struct { - // Flags field of ReactionsNotifySettings. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // MessagesNotifyFrom field of ReactionsNotifySettings. + // Message reaction notification settings, if not set completely disables + // notifications/updates about message reactions. // // Use SetMessagesNotifyFrom and GetMessagesNotifyFrom helpers. MessagesNotifyFrom ReactionNotificationsFromClass - // StoriesNotifyFrom field of ReactionsNotifySettings. + // Story reaction notification settings, if not set completely disables + // notifications/updates about reactions to stories. // // Use SetStoriesNotifyFrom and GetStoriesNotifyFrom helpers. StoriesNotifyFrom ReactionNotificationsFromClass - // Sound field of ReactionsNotifySettings. + // Notification sound for reactions »¹ + // + // Links: + // 1) https://core.telegram.org/api/ringtones Sound NotificationSoundClass - // ShowPreviews field of ReactionsNotifySettings. + // If false, push notifications »¹ about message/story reactions will only be of type + // REACT_HIDDEN/REACT_STORY_HIDDEN, without any information about the reacted-to story or + // the reaction itself. + // + // Links: + // 1) https://core.telegram.org/api/push-updates ShowPreviews bool } diff --git a/tg/tl_requested_peer_gen.go b/tg/tl_requested_peer_gen.go index 1542e3c926..5f57f9360f 100644 --- a/tg/tl_requested_peer_gen.go +++ b/tg/tl_requested_peer_gen.go @@ -32,26 +32,37 @@ var ( ) // RequestedPeerUser represents TL type `requestedPeerUser#d62ff46a`. +// Info about a user, shared by a user with the currently logged in bot using messages +// sendBotRequestedPeer¹. +// All fields except the ID are optional, and will be populated if present on the chosen +// user, according to the parameters of the requesting inputKeyboardButtonRequestPeer¹. +// +// Links: +// 1. https://core.telegram.org/method/messages.sendBotRequestedPeer +// 2. https://core.telegram.org/constructor/inputKeyboardButtonRequestPeer // // See https://core.telegram.org/constructor/requestedPeerUser for reference. type RequestedPeerUser struct { - // Flags field of RequestedPeerUser. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // UserID field of RequestedPeerUser. + // User ID. UserID int64 - // FirstName field of RequestedPeerUser. + // First name. // // Use SetFirstName and GetFirstName helpers. FirstName string - // LastName field of RequestedPeerUser. + // Last name. // // Use SetLastName and GetLastName helpers. LastName string - // Username field of RequestedPeerUser. + // Username. // // Use SetUsername and GetUsername helpers. Username string - // Photo field of RequestedPeerUser. + // Profile photo. // // Use SetPhoto and GetPhoto helpers. Photo PhotoClass @@ -381,18 +392,30 @@ func (r *RequestedPeerUser) GetPhoto() (value PhotoClass, ok bool) { } // RequestedPeerChat represents TL type `requestedPeerChat#7307544f`. +// Info about a chat¹, shared by a user with the currently logged in bot using messages +// sendBotRequestedPeer². +// All fields except the ID are optional, and will be populated if present on the chosen +// chat, according to the parameters of the requesting inputKeyboardButtonRequestPeer¹. +// +// Links: +// 1. https://core.telegram.org/api/channel +// 2. https://core.telegram.org/method/messages.sendBotRequestedPeer +// 3. https://core.telegram.org/constructor/inputKeyboardButtonRequestPeer // // See https://core.telegram.org/constructor/requestedPeerChat for reference. type RequestedPeerChat struct { - // Flags field of RequestedPeerChat. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ChatID field of RequestedPeerChat. + // Chat ID. ChatID int64 - // Title field of RequestedPeerChat. + // Chat title. // // Use SetTitle and GetTitle helpers. Title string - // Photo field of RequestedPeerChat. + // Chat photo. // // Use SetPhoto and GetPhoto helpers. Photo PhotoClass @@ -634,22 +657,35 @@ func (r *RequestedPeerChat) GetPhoto() (value PhotoClass, ok bool) { } // RequestedPeerChannel represents TL type `requestedPeerChannel#8ba403e4`. +// Info about a channel/supergroup¹, shared by a user with the currently logged in bot +// using messages.sendBotRequestedPeer². +// All fields except the ID are optional, and will be populated if present on the chosen +// channel/supergroup, according to the parameters of the requesting +// inputKeyboardButtonRequestPeer¹. +// +// Links: +// 1. https://core.telegram.org/api/channel +// 2. https://core.telegram.org/method/messages.sendBotRequestedPeer +// 3. https://core.telegram.org/constructor/inputKeyboardButtonRequestPeer // // See https://core.telegram.org/constructor/requestedPeerChannel for reference. type RequestedPeerChannel struct { - // Flags field of RequestedPeerChannel. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ChannelID field of RequestedPeerChannel. + // Channel/supergroup ID. ChannelID int64 - // Title field of RequestedPeerChannel. + // Channel/supergroup title. // // Use SetTitle and GetTitle helpers. Title string - // Username field of RequestedPeerChannel. + // Channel/supergroup username. // // Use SetUsername and GetUsername helpers. Username string - // Photo field of RequestedPeerChannel. + // Channel/supergroup photo. // // Use SetPhoto and GetPhoto helpers. Photo PhotoClass @@ -971,7 +1007,7 @@ type RequestedPeerClass interface { // Zero returns true if current object has a zero value. Zero() bool - // Photo field of RequestedPeerUser. + // Profile photo. GetPhoto() (value PhotoClass, ok bool) } diff --git a/tg/tl_saved_reaction_tag_gen.go b/tg/tl_saved_reaction_tag_gen.go index 2c0911a780..2e416ade98 100644 --- a/tg/tl_saved_reaction_tag_gen.go +++ b/tg/tl_saved_reaction_tag_gen.go @@ -32,18 +32,28 @@ var ( ) // SavedReactionTag represents TL type `savedReactionTag#cb6ff828`. +// Info about a saved message reaction tag »¹. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages#tags // // See https://core.telegram.org/constructor/savedReactionTag for reference. type SavedReactionTag struct { - // Flags field of SavedReactionTag. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Reaction field of SavedReactionTag. + // Reaction¹ associated to the tag. + // + // Links: + // 1) https://core.telegram.org/api/reactions Reaction ReactionClass - // Title field of SavedReactionTag. + // Custom tag name assigned by the user (max 12 UTF-8 chars). // // Use SetTitle and GetTitle helpers. Title string - // Count field of SavedReactionTag. + // Number of messages tagged with this tag. Count int } diff --git a/tg/tl_sms_job_gen.go b/tg/tl_sms_job_gen.go index a2f5bd3bbe..d6995bffa3 100644 --- a/tg/tl_sms_job_gen.go +++ b/tg/tl_sms_job_gen.go @@ -32,14 +32,15 @@ var ( ) // SMSJob represents TL type `smsJob#e6a1eeb8`. +// Info about an SMS job. // // See https://core.telegram.org/constructor/smsJob for reference. type SMSJob struct { - // JobID field of SMSJob. + // Job ID JobID string - // PhoneNumber field of SMSJob. + // Destination phone number PhoneNumber string - // Text field of SMSJob. + // Text Text string } diff --git a/tg/tl_smsjobs_eligible_to_join_gen.go b/tg/tl_smsjobs_eligible_to_join_gen.go index 3f936b5274..f833b9f73c 100644 --- a/tg/tl_smsjobs_eligible_to_join_gen.go +++ b/tg/tl_smsjobs_eligible_to_join_gen.go @@ -32,12 +32,13 @@ var ( ) // SMSJobsEligibleToJoin represents TL type `smsjobs.eligibleToJoin#dc8b44cf`. +// SMS jobs eligibility // // See https://core.telegram.org/constructor/smsjobs.eligibleToJoin for reference. type SMSJobsEligibleToJoin struct { - // TermsURL field of SMSJobsEligibleToJoin. + // Terms of service URL TermsURL string - // MonthlySentSMS field of SMSJobsEligibleToJoin. + // Monthly sent SMSes MonthlySentSMS int } diff --git a/tg/tl_smsjobs_finish_job_gen.go b/tg/tl_smsjobs_finish_job_gen.go index b998826974..ed6730ccd0 100644 --- a/tg/tl_smsjobs_finish_job_gen.go +++ b/tg/tl_smsjobs_finish_job_gen.go @@ -32,14 +32,18 @@ var ( ) // SMSJobsFinishJobRequest represents TL type `smsjobs.finishJob#4f1ebf24`. +// Finish an SMS job (official clients only). // // See https://core.telegram.org/method/smsjobs.finishJob for reference. type SMSJobsFinishJobRequest struct { - // Flags field of SMSJobsFinishJobRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // JobID field of SMSJobsFinishJobRequest. + // Job ID. JobID string - // Error field of SMSJobsFinishJobRequest. + // If failed, the error. // // Use SetError and GetError helpers. Error string @@ -227,6 +231,11 @@ func (f *SMSJobsFinishJobRequest) GetError() (value string, ok bool) { } // SMSJobsFinishJob invokes method smsjobs.finishJob#4f1ebf24 returning error if any. +// Finish an SMS job (official clients only). +// +// Possible errors: +// +// 400 SMSJOB_ID_INVALID: The specified job ID is invalid. // // See https://core.telegram.org/method/smsjobs.finishJob for reference. func (c *Client) SMSJobsFinishJob(ctx context.Context, request *SMSJobsFinishJobRequest) (bool, error) { diff --git a/tg/tl_smsjobs_get_sms_job_gen.go b/tg/tl_smsjobs_get_sms_job_gen.go index ab0921cab0..e3481b7bb5 100644 --- a/tg/tl_smsjobs_get_sms_job_gen.go +++ b/tg/tl_smsjobs_get_sms_job_gen.go @@ -32,10 +32,11 @@ var ( ) // SMSJobsGetSMSJobRequest represents TL type `smsjobs.getSmsJob#778d902f`. +// Get info about an SMS job (official clients only). // // See https://core.telegram.org/method/smsjobs.getSmsJob for reference. type SMSJobsGetSMSJobRequest struct { - // JobID field of SMSJobsGetSMSJobRequest. + // Job ID JobID string } @@ -161,6 +162,11 @@ func (g *SMSJobsGetSMSJobRequest) GetJobID() (value string) { } // SMSJobsGetSMSJob invokes method smsjobs.getSmsJob#778d902f returning error if any. +// Get info about an SMS job (official clients only). +// +// Possible errors: +// +// 400 SMSJOB_ID_INVALID: The specified job ID is invalid. // // See https://core.telegram.org/method/smsjobs.getSmsJob for reference. func (c *Client) SMSJobsGetSMSJob(ctx context.Context, jobid string) (*SMSJob, error) { diff --git a/tg/tl_smsjobs_get_status_gen.go b/tg/tl_smsjobs_get_status_gen.go index 77470c3886..a9f165d75f 100644 --- a/tg/tl_smsjobs_get_status_gen.go +++ b/tg/tl_smsjobs_get_status_gen.go @@ -32,6 +32,7 @@ var ( ) // SMSJobsGetStatusRequest represents TL type `smsjobs.getStatus#10a698e8`. +// Get SMS jobs status (official clients only). // // See https://core.telegram.org/method/smsjobs.getStatus for reference. type SMSJobsGetStatusRequest struct { @@ -128,6 +129,11 @@ func (g *SMSJobsGetStatusRequest) DecodeBare(b *bin.Buffer) error { } // SMSJobsGetStatus invokes method smsjobs.getStatus#10a698e8 returning error if any. +// Get SMS jobs status (official clients only). +// +// Possible errors: +// +// 400 NOT_JOINED: The current user hasn't joined the Peer-to-Peer Login Program. // // See https://core.telegram.org/method/smsjobs.getStatus for reference. func (c *Client) SMSJobsGetStatus(ctx context.Context) (*SMSJobsStatus, error) { diff --git a/tg/tl_smsjobs_is_eligible_to_join_gen.go b/tg/tl_smsjobs_is_eligible_to_join_gen.go index 10f0873855..8b262c5cb3 100644 --- a/tg/tl_smsjobs_is_eligible_to_join_gen.go +++ b/tg/tl_smsjobs_is_eligible_to_join_gen.go @@ -32,6 +32,7 @@ var ( ) // SMSJobsIsEligibleToJoinRequest represents TL type `smsjobs.isEligibleToJoin#edc39d0`. +// Check if we can process SMS jobs (official clients only). // // See https://core.telegram.org/method/smsjobs.isEligibleToJoin for reference. type SMSJobsIsEligibleToJoinRequest struct { @@ -128,6 +129,11 @@ func (i *SMSJobsIsEligibleToJoinRequest) DecodeBare(b *bin.Buffer) error { } // SMSJobsIsEligibleToJoin invokes method smsjobs.isEligibleToJoin#edc39d0 returning error if any. +// Check if we can process SMS jobs (official clients only). +// +// Possible errors: +// +// 403 NOT_ELIGIBLE: The current user is not eligible to join the Peer-to-Peer Login Program. // // See https://core.telegram.org/method/smsjobs.isEligibleToJoin for reference. func (c *Client) SMSJobsIsEligibleToJoin(ctx context.Context) (*SMSJobsEligibleToJoin, error) { diff --git a/tg/tl_smsjobs_join_gen.go b/tg/tl_smsjobs_join_gen.go index d4636eca3d..e08abc8a73 100644 --- a/tg/tl_smsjobs_join_gen.go +++ b/tg/tl_smsjobs_join_gen.go @@ -32,6 +32,7 @@ var ( ) // SMSJobsJoinRequest represents TL type `smsjobs.join#a74ece2d`. +// Enable SMS jobs (official clients only). // // See https://core.telegram.org/method/smsjobs.join for reference. type SMSJobsJoinRequest struct { @@ -128,6 +129,11 @@ func (j *SMSJobsJoinRequest) DecodeBare(b *bin.Buffer) error { } // SMSJobsJoin invokes method smsjobs.join#a74ece2d returning error if any. +// Enable SMS jobs (official clients only). +// +// Possible errors: +// +// 400 NOT_ELIGIBLE: The current user is not eligible to join the Peer-to-Peer Login Program. // // See https://core.telegram.org/method/smsjobs.join for reference. func (c *Client) SMSJobsJoin(ctx context.Context) (bool, error) { diff --git a/tg/tl_smsjobs_leave_gen.go b/tg/tl_smsjobs_leave_gen.go index 2acec6e14d..4839cf4b8b 100644 --- a/tg/tl_smsjobs_leave_gen.go +++ b/tg/tl_smsjobs_leave_gen.go @@ -32,6 +32,7 @@ var ( ) // SMSJobsLeaveRequest represents TL type `smsjobs.leave#9898ad73`. +// Disable SMS jobs (official clients only). // // See https://core.telegram.org/method/smsjobs.leave for reference. type SMSJobsLeaveRequest struct { @@ -128,6 +129,11 @@ func (l *SMSJobsLeaveRequest) DecodeBare(b *bin.Buffer) error { } // SMSJobsLeave invokes method smsjobs.leave#9898ad73 returning error if any. +// Disable SMS jobs (official clients only). +// +// Possible errors: +// +// 400 NOT_JOINED: The current user hasn't joined the Peer-to-Peer Login Program. // // See https://core.telegram.org/method/smsjobs.leave for reference. func (c *Client) SMSJobsLeave(ctx context.Context) (bool, error) { diff --git a/tg/tl_smsjobs_status_gen.go b/tg/tl_smsjobs_status_gen.go index 744bbd6147..36003c3925 100644 --- a/tg/tl_smsjobs_status_gen.go +++ b/tg/tl_smsjobs_status_gen.go @@ -32,28 +32,32 @@ var ( ) // SMSJobsStatus represents TL type `smsjobs.status#2aee9191`. +// Status // // See https://core.telegram.org/constructor/smsjobs.status for reference. type SMSJobsStatus struct { - // Flags field of SMSJobsStatus. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // AllowInternational field of SMSJobsStatus. + // Allow international numbers AllowInternational bool - // RecentSent field of SMSJobsStatus. + // Recently sent RecentSent int - // RecentSince field of SMSJobsStatus. + // Since RecentSince int - // RecentRemains field of SMSJobsStatus. + // Remaining RecentRemains int - // TotalSent field of SMSJobsStatus. + // Total sent TotalSent int - // TotalSince field of SMSJobsStatus. + // Total since TotalSince int - // LastGiftSlug field of SMSJobsStatus. + // Last gift deep link // // Use SetLastGiftSlug and GetLastGiftSlug helpers. LastGiftSlug string - // TermsURL field of SMSJobsStatus. + // Terms of service URL TermsURL string } diff --git a/tg/tl_smsjobs_update_settings_gen.go b/tg/tl_smsjobs_update_settings_gen.go index f98725226e..87e9a72214 100644 --- a/tg/tl_smsjobs_update_settings_gen.go +++ b/tg/tl_smsjobs_update_settings_gen.go @@ -32,12 +32,16 @@ var ( ) // SMSJobsUpdateSettingsRequest represents TL type `smsjobs.updateSettings#93fa0bf`. +// Update SMS job settings (official clients only). // // See https://core.telegram.org/method/smsjobs.updateSettings for reference. type SMSJobsUpdateSettingsRequest struct { - // Flags field of SMSJobsUpdateSettingsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // AllowInternational field of SMSJobsUpdateSettingsRequest. + // Allow international numbers? AllowInternational bool } @@ -187,6 +191,11 @@ func (u *SMSJobsUpdateSettingsRequest) GetAllowInternational() (value bool) { } // SMSJobsUpdateSettings invokes method smsjobs.updateSettings#93fa0bf returning error if any. +// Update SMS job settings (official clients only). +// +// Possible errors: +// +// 400 NOT_JOINED: The current user hasn't joined the Peer-to-Peer Login Program. // // See https://core.telegram.org/method/smsjobs.updateSettings for reference. func (c *Client) SMSJobsUpdateSettings(ctx context.Context, request *SMSJobsUpdateSettingsRequest) (bool, error) { diff --git a/tg/tl_sponsored_message_gen.go b/tg/tl_sponsored_message_gen.go index 02138c07a9..1e34b75dc3 100644 --- a/tg/tl_sponsored_message_gen.go +++ b/tg/tl_sponsored_message_gen.go @@ -46,24 +46,28 @@ type SponsoredMessage struct { Flags bin.Fields // Whether the message needs to be labeled as "recommended" instead of "sponsored" Recommended bool - // CanReport field of SponsoredMessage. + // Whether this message can be reported as specified here »¹. + // + // Links: + // 1) https://core.telegram.org/api/sponsored-messages#reporting-sponsored-messages CanReport bool // Message ID RandomID []byte - // URL field of SponsoredMessage. + // Contains the URL to open when the user clicks on the sponsored message. URL string - // Title field of SponsoredMessage. + // Contains the title of the sponsored message. Title string // Sponsored message Message string - // Message entities for styled text¹ + // Message entities for styled text¹ in message. // // Links: // 1) https://core.telegram.org/api/entities // // Use SetEntities and GetEntities helpers. Entities []MessageEntityClass - // Photo field of SponsoredMessage. + // If set, contains a custom profile photo bubble that should be displayed for the + // sponsored message, like for messages sent in groups. // // Use SetPhoto and GetPhoto helpers. Photo PhotoClass @@ -71,11 +75,15 @@ type SponsoredMessage struct { // // Use SetMedia and GetMedia helpers. Media MessageMediaClass - // Color field of SponsoredMessage. + // If set, the sponsored message should use the message accent color »¹ specified in + // color. + // + // Links: + // 1) https://core.telegram.org/api/colors // // Use SetColor and GetColor helpers. Color PeerColor - // Text of the sponsored message button. + // Label of the sponsored message button. ButtonText string // If set, contains additional information about the sponsor to be shown along with the // message. diff --git a/tg/tl_sponsored_message_report_option_gen.go b/tg/tl_sponsored_message_report_option_gen.go index 88e229bb5b..19a33e9e68 100644 --- a/tg/tl_sponsored_message_report_option_gen.go +++ b/tg/tl_sponsored_message_report_option_gen.go @@ -32,12 +32,19 @@ var ( ) // SponsoredMessageReportOption represents TL type `sponsoredMessageReportOption#430d3150`. +// A report option for a sponsored message »¹. +// +// Links: +// 1. https://core.telegram.org/api/sponsored-messages#reporting-sponsored-messages // // See https://core.telegram.org/constructor/sponsoredMessageReportOption for reference. type SponsoredMessageReportOption struct { - // Text field of SponsoredMessageReportOption. + // Localized description of the option. Text string - // Option field of SponsoredMessageReportOption. + // Option identifier to pass to channels.reportSponsoredMessage¹. + // + // Links: + // 1) https://core.telegram.org/method/channels.reportSponsoredMessage Option []byte } diff --git a/tg/tl_stars_gift_option_gen.go b/tg/tl_stars_gift_option_gen.go index d01542e893..235b071b35 100644 --- a/tg/tl_stars_gift_option_gen.go +++ b/tg/tl_stars_gift_option_gen.go @@ -32,22 +32,38 @@ var ( ) // StarsGiftOption represents TL type `starsGiftOption#5e0589f1`. +// Telegram Stars gift option¹. +// +// Links: +// 1. https://core.telegram.org/api/stars#buying-or-gifting-stars // // See https://core.telegram.org/constructor/starsGiftOption for reference. type StarsGiftOption struct { - // Flags field of StarsGiftOption. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Extended field of StarsGiftOption. + // If set, the option must only be shown in the full list of topup options. Extended bool - // Stars field of StarsGiftOption. + // Amount of Telegram stars. Stars int64 - // StoreProduct field of StarsGiftOption. + // Identifier of the store product associated with the option, official apps only. // // Use SetStoreProduct and GetStoreProduct helpers. StoreProduct string - // Currency field of StarsGiftOption. + // Three-letter ISO 4217 currency¹ code + // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string - // Amount field of StarsGiftOption. + // Price of the product in the smallest units of the currency (integer, not float/double) + // For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in + // currencies.json¹, it shows the number of digits past the decimal point for each + // currency (2 for the majority of currencies). + // + // Links: + // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 } diff --git a/tg/tl_stars_revenue_status_gen.go b/tg/tl_stars_revenue_status_gen.go index 9e4f31bd9a..8cb4bdd165 100644 --- a/tg/tl_stars_revenue_status_gen.go +++ b/tg/tl_stars_revenue_status_gen.go @@ -32,20 +32,31 @@ var ( ) // StarsRevenueStatus represents TL type `starsRevenueStatus#79342946`. +// Describes Telegram Star revenue balances »¹. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/starsRevenueStatus for reference. type StarsRevenueStatus struct { - // Flags field of StarsRevenueStatus. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // WithdrawalEnabled field of StarsRevenueStatus. + // If set, the user may withdraw¹ up to available_balance stars. + // + // Links: + // 1) https://core.telegram.org/api/stars#withdrawing-revenue WithdrawalEnabled bool - // CurrentBalance field of StarsRevenueStatus. + // Amount of not-yet-withdrawn Telegram Stars. CurrentBalance int64 - // AvailableBalance field of StarsRevenueStatus. + // Amount of withdrawable Telegram Stars. AvailableBalance int64 - // OverallRevenue field of StarsRevenueStatus. + // Total amount of earned Telegram Stars. OverallRevenue int64 - // NextWithdrawalAt field of StarsRevenueStatus. + // Unixtime indicating when will withdrawal be available to the user. If not set, + // withdrawal can be started now. // // Use SetNextWithdrawalAt and GetNextWithdrawalAt helpers. NextWithdrawalAt int diff --git a/tg/tl_stars_topup_option_gen.go b/tg/tl_stars_topup_option_gen.go index f1317373c9..496ac138d2 100644 --- a/tg/tl_stars_topup_option_gen.go +++ b/tg/tl_stars_topup_option_gen.go @@ -32,22 +32,38 @@ var ( ) // StarsTopupOption represents TL type `starsTopupOption#bd915c0`. +// Telegram Stars topup option¹. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/starsTopupOption for reference. type StarsTopupOption struct { - // Flags field of StarsTopupOption. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Extended field of StarsTopupOption. + // If set, the option must only be shown in the full list of topup options. Extended bool - // Stars field of StarsTopupOption. + // Amount of Telegram stars. Stars int64 - // StoreProduct field of StarsTopupOption. + // Identifier of the store product associated with the option, official apps only. // // Use SetStoreProduct and GetStoreProduct helpers. StoreProduct string - // Currency field of StarsTopupOption. + // Three-letter ISO 4217 currency¹ code + // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string - // Amount field of StarsTopupOption. + // Price of the product in the smallest units of the currency (integer, not float/double) + // For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in + // currencies.json¹, it shows the number of digits past the decimal point for each + // currency (2 for the majority of currencies). + // + // Links: + // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 } diff --git a/tg/tl_stars_transaction_gen.go b/tg/tl_stars_transaction_gen.go index 9cefe73375..cce80bfd9a 100644 --- a/tg/tl_stars_transaction_gen.go +++ b/tg/tl_stars_transaction_gen.go @@ -32,58 +32,81 @@ var ( ) // StarsTransaction represents TL type `starsTransaction#ee7522d5`. +// Represents a Telegram Stars transaction »¹. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/starsTransaction for reference. type StarsTransaction struct { - // Flags field of StarsTransaction. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Refund field of StarsTransaction. + // Whether this transaction is a refund. Refund bool - // Pending field of StarsTransaction. + // The transaction is currently pending. Pending bool - // Failed field of StarsTransaction. + // This transaction has failed. Failed bool - // Gift field of StarsTransaction. + // This transaction was a gift from the user in peer.peer. Gift bool // Reaction field of StarsTransaction. Reaction bool - // ID field of StarsTransaction. + // Transaction ID. ID string - // Stars field of StarsTransaction. + // Amount of Stars (negative for outgoing transactions). Stars int64 - // Date field of StarsTransaction. + // Date of the transaction (unixtime). Date int - // Peer field of StarsTransaction. + // Source of the incoming transaction, or its recipient for outgoing transactions. Peer StarsTransactionPeerClass - // Title field of StarsTransaction. + // For transactions with bots, title of the bought product. // // Use SetTitle and GetTitle helpers. Title string - // Description field of StarsTransaction. + // For transactions with bots, description of the bought product. // // Use SetDescription and GetDescription helpers. Description string - // Photo field of StarsTransaction. + // For transactions with bots, photo of the bought product. // // Use SetPhoto and GetPhoto helpers. Photo WebDocumentClass - // TransactionDate field of StarsTransaction. + // If neither pending nor failed are set, the transaction was completed successfully, and + // this field will contain the point in time (Unix timestamp) when the withdrawal was + // completed successfully. // // Use SetTransactionDate and GetTransactionDate helpers. TransactionDate int - // TransactionURL field of StarsTransaction. + // If neither pending nor failed are set, the transaction was completed successfully, and + // this field will contain a URL where the withdrawal transaction can be viewed. // // Use SetTransactionURL and GetTransactionURL helpers. TransactionURL string - // BotPayload field of StarsTransaction. + // Bot specified invoice payload (i.e. the payload passed to inputMediaInvoice¹ when + // creating the invoice²). + // + // Links: + // 1) https://core.telegram.org/constructor/inputMediaInvoice + // 2) https://core.telegram.org/api/payments // // Use SetBotPayload and GetBotPayload helpers. BotPayload []byte - // MsgID field of StarsTransaction. + // For paid media transactions »¹, message ID of the paid media posted to peer.peer + // (can point to a deleted message; either way, extended_media will always contain the + // bought media). + // + // Links: + // 1) https://core.telegram.org/api/paid-media // // Use SetMsgID and GetMsgID helpers. MsgID int - // ExtendedMedia field of StarsTransaction. + // The purchased paid media »¹. + // + // Links: + // 1) https://core.telegram.org/api/paid-media // // Use SetExtendedMedia and GetExtendedMedia helpers. ExtendedMedia []MessageMediaClass diff --git a/tg/tl_stars_transaction_peer_gen.go b/tg/tl_stars_transaction_peer_gen.go index 5d6c102814..980b083022 100644 --- a/tg/tl_stars_transaction_peer_gen.go +++ b/tg/tl_stars_transaction_peer_gen.go @@ -32,6 +32,11 @@ var ( ) // StarsTransactionPeerUnsupported represents TL type `starsTransactionPeerUnsupported#95f2bfe4`. +// Describes a Telegram Star¹ transaction that cannot be described using the current +// layer. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/starsTransactionPeerUnsupported for reference. type StarsTransactionPeerUnsupported struct { @@ -133,6 +138,11 @@ func (s *StarsTransactionPeerUnsupported) DecodeBare(b *bin.Buffer) error { } // StarsTransactionPeerAppStore represents TL type `starsTransactionPeerAppStore#b457b375`. +// Describes a Telegram Star¹ transaction with the App Store, used when purchasing +// Telegram Stars through the App Store. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/starsTransactionPeerAppStore for reference. type StarsTransactionPeerAppStore struct { @@ -234,6 +244,11 @@ func (s *StarsTransactionPeerAppStore) DecodeBare(b *bin.Buffer) error { } // StarsTransactionPeerPlayMarket represents TL type `starsTransactionPeerPlayMarket#7b560a0b`. +// Describes a Telegram Star¹ transaction with the Play Store, used when purchasing +// Telegram Stars through the Play Store. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/starsTransactionPeerPlayMarket for reference. type StarsTransactionPeerPlayMarket struct { @@ -335,6 +350,14 @@ func (s *StarsTransactionPeerPlayMarket) DecodeBare(b *bin.Buffer) error { } // StarsTransactionPeerPremiumBot represents TL type `starsTransactionPeerPremiumBot#250dbaf8`. +// Describes a Telegram Star¹ transaction made using @PremiumBot² (i.e. using the +// inputInvoiceStars³ flow described here »⁴). +// +// Links: +// 1. https://core.telegram.org/api/stars +// 2. https://t.me/premiumbot +// 3. https://core.telegram.org/constructor/inputInvoiceStars +// 4. https://core.telegram.org/api/stars#buying-or-gifting-stars // // See https://core.telegram.org/constructor/starsTransactionPeerPremiumBot for reference. type StarsTransactionPeerPremiumBot struct { @@ -436,6 +459,13 @@ func (s *StarsTransactionPeerPremiumBot) DecodeBare(b *bin.Buffer) error { } // StarsTransactionPeerFragment represents TL type `starsTransactionPeerFragment#e92fd902`. +// Describes a Telegram Star¹ transaction with Fragment², used when purchasing Telegram +// Stars through Fragment³. +// +// Links: +// 1. https://core.telegram.org/api/stars +// 2. https://fragment.com +// 3. https://fragment.com // // See https://core.telegram.org/constructor/starsTransactionPeerFragment for reference. type StarsTransactionPeerFragment struct { @@ -537,10 +567,14 @@ func (s *StarsTransactionPeerFragment) DecodeBare(b *bin.Buffer) error { } // StarsTransactionPeer represents TL type `starsTransactionPeer#d80da15d`. +// Describes a Telegram Star¹ transaction with another peer. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/starsTransactionPeer for reference. type StarsTransactionPeer struct { - // Peer field of StarsTransactionPeer. + // The peer. Peer PeerClass } @@ -676,6 +710,12 @@ func (s *StarsTransactionPeer) GetPeer() (value PeerClass) { } // StarsTransactionPeerAds represents TL type `starsTransactionPeerAds#60682812`. +// Describes a Telegram Star¹ transaction used to pay for Telegram ads as specified here +// »². +// +// Links: +// 1. https://core.telegram.org/api/stars +// 2. https://core.telegram.org/api/stars#paying-for-ads // // See https://core.telegram.org/constructor/starsTransactionPeerAds for reference. type StarsTransactionPeerAds struct { diff --git a/tg/tl_stats_broadcast_revenue_stats_gen.go b/tg/tl_stats_broadcast_revenue_stats_gen.go index 0808a8e3b8..d0364f473c 100644 --- a/tg/tl_stats_broadcast_revenue_stats_gen.go +++ b/tg/tl_stats_broadcast_revenue_stats_gen.go @@ -32,16 +32,25 @@ var ( ) // StatsBroadcastRevenueStats represents TL type `stats.broadcastRevenueStats#5407e297`. +// Channel revenue ad statistics, see here »¹ for more info. +// Note that all balances and currency amounts and graph values are in the smallest unit +// of the chosen cryptocurrency (currently nanotons for TONs, so to obtain a value in USD +// divide the chosen amount by 10^9, and then divide by usd_rate). +// +// Links: +// 1. https://core.telegram.org/api/revenue // // See https://core.telegram.org/constructor/stats.broadcastRevenueStats for reference. type StatsBroadcastRevenueStats struct { - // TopHoursGraph field of StatsBroadcastRevenueStats. + // Ad impressions graph TopHoursGraph StatsGraphClass - // RevenueGraph field of StatsBroadcastRevenueStats. + // Ad revenue graph (in the smallest unit of the cryptocurrency in which revenue is + // calculated) RevenueGraph StatsGraphClass - // Balances field of StatsBroadcastRevenueStats. + // Current balance, current withdrawable balance and overall revenue Balances BroadcastRevenueBalances - // UsdRate field of StatsBroadcastRevenueStats. + // Current conversion rate of the cryptocurrency (not in the smallest unit) in which + // revenue is calculated to USD UsdRate float64 } diff --git a/tg/tl_stats_broadcast_revenue_transactions_gen.go b/tg/tl_stats_broadcast_revenue_transactions_gen.go index c349e29afa..1098352863 100644 --- a/tg/tl_stats_broadcast_revenue_transactions_gen.go +++ b/tg/tl_stats_broadcast_revenue_transactions_gen.go @@ -32,12 +32,16 @@ var ( ) // StatsBroadcastRevenueTransactions represents TL type `stats.broadcastRevenueTransactions#87158466`. +// Channel ad revenue transactions »¹. +// +// Links: +// 1. https://core.telegram.org/api/revenue // // See https://core.telegram.org/constructor/stats.broadcastRevenueTransactions for reference. type StatsBroadcastRevenueTransactions struct { - // Count field of StatsBroadcastRevenueTransactions. + // Total number of transactions. Count int - // Transactions field of StatsBroadcastRevenueTransactions. + // Transactions Transactions []BroadcastRevenueTransactionClass } diff --git a/tg/tl_stats_broadcast_revenue_withdrawal_url_gen.go b/tg/tl_stats_broadcast_revenue_withdrawal_url_gen.go index 8c90977b34..50d107865b 100644 --- a/tg/tl_stats_broadcast_revenue_withdrawal_url_gen.go +++ b/tg/tl_stats_broadcast_revenue_withdrawal_url_gen.go @@ -32,10 +32,15 @@ var ( ) // StatsBroadcastRevenueWithdrawalURL represents TL type `stats.broadcastRevenueWithdrawalUrl#ec659737`. +// Contains the URL to use to withdraw channel ad revenue¹. +// +// Links: +// 1. https://core.telegram.org/api/revenue#withdrawing-revenue // // See https://core.telegram.org/constructor/stats.broadcastRevenueWithdrawalUrl for reference. type StatsBroadcastRevenueWithdrawalURL struct { - // URL field of StatsBroadcastRevenueWithdrawalURL. + // A unique URL to a Fragment page where the user will be able to specify and submit the + // address of the TON wallet where the funds will be sent. URL string } diff --git a/tg/tl_stats_get_broadcast_revenue_stats_gen.go b/tg/tl_stats_get_broadcast_revenue_stats_gen.go index fe2cdfbc5f..9b1c52c9a3 100644 --- a/tg/tl_stats_get_broadcast_revenue_stats_gen.go +++ b/tg/tl_stats_get_broadcast_revenue_stats_gen.go @@ -32,14 +32,21 @@ var ( ) // StatsGetBroadcastRevenueStatsRequest represents TL type `stats.getBroadcastRevenueStats#75dfb671`. +// Get channel ad revenue statistics »¹. +// +// Links: +// 1. https://core.telegram.org/api/revenue // // See https://core.telegram.org/method/stats.getBroadcastRevenueStats for reference. type StatsGetBroadcastRevenueStatsRequest struct { - // Flags field of StatsGetBroadcastRevenueStatsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Dark field of StatsGetBroadcastRevenueStatsRequest. + // Whether to enable dark theme for graph colors Dark bool - // Channel field of StatsGetBroadcastRevenueStatsRequest. + // The channel Channel InputChannelClass } @@ -224,6 +231,15 @@ func (g *StatsGetBroadcastRevenueStatsRequest) GetChannelAsNotEmpty() (NotEmptyI } // StatsGetBroadcastRevenueStats invokes method stats.getBroadcastRevenueStats#75dfb671 returning error if any. +// Get channel ad revenue statistics »¹. +// +// Links: +// 1. https://core.telegram.org/api/revenue +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // // See https://core.telegram.org/method/stats.getBroadcastRevenueStats for reference. func (c *Client) StatsGetBroadcastRevenueStats(ctx context.Context, request *StatsGetBroadcastRevenueStatsRequest) (*StatsBroadcastRevenueStats, error) { diff --git a/tg/tl_stats_get_broadcast_revenue_transactions_gen.go b/tg/tl_stats_get_broadcast_revenue_transactions_gen.go index e368ee65dc..5a58ac3c6b 100644 --- a/tg/tl_stats_get_broadcast_revenue_transactions_gen.go +++ b/tg/tl_stats_get_broadcast_revenue_transactions_gen.go @@ -32,14 +32,24 @@ var ( ) // StatsGetBroadcastRevenueTransactionsRequest represents TL type `stats.getBroadcastRevenueTransactions#69280f`. +// Fetch channel ad revenue transaction history »¹. +// +// Links: +// 1. https://core.telegram.org/api/revenue // // See https://core.telegram.org/method/stats.getBroadcastRevenueTransactions for reference. type StatsGetBroadcastRevenueTransactionsRequest struct { - // Channel field of StatsGetBroadcastRevenueTransactionsRequest. + // The channel Channel InputChannelClass - // Offset field of StatsGetBroadcastRevenueTransactionsRequest. + // Offset for pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Offset int - // Limit field of StatsGetBroadcastRevenueTransactionsRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -225,6 +235,14 @@ func (g *StatsGetBroadcastRevenueTransactionsRequest) GetChannelAsNotEmpty() (No } // StatsGetBroadcastRevenueTransactions invokes method stats.getBroadcastRevenueTransactions#69280f returning error if any. +// Fetch channel ad revenue transaction history »¹. +// +// Links: +// 1. https://core.telegram.org/api/revenue +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. // // See https://core.telegram.org/method/stats.getBroadcastRevenueTransactions for reference. func (c *Client) StatsGetBroadcastRevenueTransactions(ctx context.Context, request *StatsGetBroadcastRevenueTransactionsRequest) (*StatsBroadcastRevenueTransactions, error) { diff --git a/tg/tl_stats_get_broadcast_revenue_withdrawal_url_gen.go b/tg/tl_stats_get_broadcast_revenue_withdrawal_url_gen.go index ba06c5fecc..33247c117c 100644 --- a/tg/tl_stats_get_broadcast_revenue_withdrawal_url_gen.go +++ b/tg/tl_stats_get_broadcast_revenue_withdrawal_url_gen.go @@ -32,12 +32,19 @@ var ( ) // StatsGetBroadcastRevenueWithdrawalURLRequest represents TL type `stats.getBroadcastRevenueWithdrawalUrl#2a65ef73`. +// Withdraw funds from a channel's ad revenue balance »¹. +// +// Links: +// 1. https://core.telegram.org/api/revenue // // See https://core.telegram.org/method/stats.getBroadcastRevenueWithdrawalUrl for reference. type StatsGetBroadcastRevenueWithdrawalURLRequest struct { - // Channel field of StatsGetBroadcastRevenueWithdrawalURLRequest. + // The channel Channel InputChannelClass - // Password field of StatsGetBroadcastRevenueWithdrawalURLRequest. + // 2FA password, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/srp#using-the-2fa-password Password InputCheckPasswordSRPClass } @@ -208,6 +215,16 @@ func (g *StatsGetBroadcastRevenueWithdrawalURLRequest) GetPasswordAsNotEmpty() ( } // StatsGetBroadcastRevenueWithdrawalURL invokes method stats.getBroadcastRevenueWithdrawalUrl#2a65ef73 returning error if any. +// Withdraw funds from a channel's ad revenue balance »¹. +// +// Links: +// 1. https://core.telegram.org/api/revenue +// +// Possible errors: +// +// 400 PASSWORD_HASH_INVALID: The provided password hash is invalid. +// 400 PASSWORD_MISSING: You must enable 2FA before executing this operation. +// 400 PASSWORD_TOO_FRESH_%d: The password was modified less than 24 hours ago, try again in %d seconds. // // See https://core.telegram.org/method/stats.getBroadcastRevenueWithdrawalUrl for reference. func (c *Client) StatsGetBroadcastRevenueWithdrawalURL(ctx context.Context, request *StatsGetBroadcastRevenueWithdrawalURLRequest) (*StatsBroadcastRevenueWithdrawalURL, error) { diff --git a/tg/tl_sticker_set_gen.go b/tg/tl_sticker_set_gen.go index 904af30ea2..2e547bda35 100644 --- a/tg/tl_sticker_set_gen.go +++ b/tg/tl_sticker_set_gen.go @@ -54,12 +54,13 @@ type StickerSet struct { // color when used in messages, the accent color if used as emoji status, white on chat // photos, or another appropriate color based on context. TextColor bool - // If set, this custom emoji stickerset can be used in channel emoji statuses¹. + // If set, this custom emoji stickerset can be used in channel/supergroup emoji + // statuses¹. // // Links: // 1) https://core.telegram.org/api/emoji-status ChannelEmojiStatus bool - // Creator field of StickerSet. + // Whether we created this stickerset Creator bool // When was this stickerset installed // diff --git a/tg/tl_stickers_add_sticker_to_set_gen.go b/tg/tl_stickers_add_sticker_to_set_gen.go index b9207213cc..7bc6744e24 100644 --- a/tg/tl_stickers_add_sticker_to_set_gen.go +++ b/tg/tl_stickers_add_sticker_to_set_gen.go @@ -32,8 +32,8 @@ var ( ) // StickersAddStickerToSetRequest represents TL type `stickers.addStickerToSet#8653febe`. -// Add a sticker to a stickerset, bots only. The sticker set must have been created by -// the bot. +// Add a sticker to a stickerset. The sticker set must have been created by the current +// user/bot. // // See https://core.telegram.org/method/stickers.addStickerToSet for reference. type StickersAddStickerToSetRequest struct { @@ -195,12 +195,11 @@ func (a *StickersAddStickerToSetRequest) GetSticker() (value InputStickerSetItem } // StickersAddStickerToSet invokes method stickers.addStickerToSet#8653febe returning error if any. -// Add a sticker to a stickerset, bots only. The sticker set must have been created by -// the bot. +// Add a sticker to a stickerset. The sticker set must have been created by the current +// user/bot. // // Possible errors: // -// 400 BOT_MISSING: Only bots can call this method, please use @stickers if you're a user. // 400 STICKERPACK_STICKERS_TOO_MUCH: There are too many stickers in this stickerpack, you can't add any more. // 406 STICKERSET_INVALID: The provided sticker set is invalid. // 400 STICKERS_TOO_MUCH: There are too many stickers in this stickerpack, you can't add any more. diff --git a/tg/tl_stickers_change_sticker_gen.go b/tg/tl_stickers_change_sticker_gen.go index f6be7e4230..cf7e58988d 100644 --- a/tg/tl_stickers_change_sticker_gen.go +++ b/tg/tl_stickers_change_sticker_gen.go @@ -32,7 +32,7 @@ var ( ) // StickersChangeStickerRequest represents TL type `stickers.changeSticker#f5537ebc`. -// Update the keywords, emojis or mask coordinates¹ of a sticker, bots only. +// Update the keywords, emojis or mask coordinates¹ of a sticker. // // Links: // 1. https://core.telegram.org/api/stickers#mask-stickers @@ -344,14 +344,13 @@ func (c *StickersChangeStickerRequest) GetStickerAsNotEmpty() (*InputDocument, b } // StickersChangeSticker invokes method stickers.changeSticker#f5537ebc returning error if any. -// Update the keywords, emojis or mask coordinates¹ of a sticker, bots only. +// Update the keywords, emojis or mask coordinates¹ of a sticker. // // Links: // 1. https://core.telegram.org/api/stickers#mask-stickers // // Possible errors: // -// 400 BOT_MISSING: Only bots can call this method, please use @stickers if you're a user. // 400 STICKER_INVALID: The provided sticker is invalid. // // See https://core.telegram.org/method/stickers.changeSticker for reference. diff --git a/tg/tl_stickers_change_sticker_position_gen.go b/tg/tl_stickers_change_sticker_position_gen.go index 7de51b8990..876f8f6610 100644 --- a/tg/tl_stickers_change_sticker_position_gen.go +++ b/tg/tl_stickers_change_sticker_position_gen.go @@ -32,8 +32,8 @@ var ( ) // StickersChangeStickerPositionRequest represents TL type `stickers.changeStickerPosition#ffb6d4ca`. -// Changes the absolute position of a sticker in the set to which it belongs; for bots -// only. The sticker set must have been created by the bot +// Changes the absolute position of a sticker in the set to which it belongs. The sticker +// set must have been created by the current user/bot. // // See https://core.telegram.org/method/stickers.changeStickerPosition for reference. type StickersChangeStickerPositionRequest struct { @@ -200,8 +200,8 @@ func (c *StickersChangeStickerPositionRequest) GetStickerAsNotEmpty() (*InputDoc } // StickersChangeStickerPosition invokes method stickers.changeStickerPosition#ffb6d4ca returning error if any. -// Changes the absolute position of a sticker in the set to which it belongs; for bots -// only. The sticker set must have been created by the bot +// Changes the absolute position of a sticker in the set to which it belongs. The sticker +// set must have been created by the current user/bot. // // Possible errors: // diff --git a/tg/tl_stickers_create_sticker_set_gen.go b/tg/tl_stickers_create_sticker_set_gen.go index 339ce16d08..6d59409670 100644 --- a/tg/tl_stickers_create_sticker_set_gen.go +++ b/tg/tl_stickers_create_sticker_set_gen.go @@ -32,7 +32,7 @@ var ( ) // StickersCreateStickerSetRequest represents TL type `stickers.createStickerSet#9021ab67`. -// Create a stickerset, bots only. +// Create a stickerset. // // See https://core.telegram.org/method/stickers.createStickerSet for reference. type StickersCreateStickerSetRequest struct { @@ -515,7 +515,7 @@ func (c *StickersCreateStickerSetRequest) GetThumbAsNotEmpty() (*InputDocument, } // StickersCreateStickerSet invokes method stickers.createStickerSet#9021ab67 returning error if any. -// Create a stickerset, bots only. +// Create a stickerset. // // Possible errors: // diff --git a/tg/tl_stickers_delete_sticker_set_gen.go b/tg/tl_stickers_delete_sticker_set_gen.go index ba7058740b..aacf3d015b 100644 --- a/tg/tl_stickers_delete_sticker_set_gen.go +++ b/tg/tl_stickers_delete_sticker_set_gen.go @@ -32,7 +32,7 @@ var ( ) // StickersDeleteStickerSetRequest represents TL type `stickers.deleteStickerSet#87704394`. -// Deletes a stickerset we created, bots only. +// Deletes a stickerset we created. // // See https://core.telegram.org/method/stickers.deleteStickerSet for reference. type StickersDeleteStickerSetRequest struct { @@ -167,11 +167,10 @@ func (d *StickersDeleteStickerSetRequest) GetStickerset() (value InputStickerSet } // StickersDeleteStickerSet invokes method stickers.deleteStickerSet#87704394 returning error if any. -// Deletes a stickerset we created, bots only. +// Deletes a stickerset we created. // // Possible errors: // -// 400 BOT_MISSING: Only bots can call this method, please use @stickers if you're a user. // 400 STICKERSET_INVALID: The provided sticker set is invalid. // // See https://core.telegram.org/method/stickers.deleteStickerSet for reference. diff --git a/tg/tl_stickers_remove_sticker_from_set_gen.go b/tg/tl_stickers_remove_sticker_from_set_gen.go index 2784599896..2ceb4d27ef 100644 --- a/tg/tl_stickers_remove_sticker_from_set_gen.go +++ b/tg/tl_stickers_remove_sticker_from_set_gen.go @@ -32,8 +32,8 @@ var ( ) // StickersRemoveStickerFromSetRequest represents TL type `stickers.removeStickerFromSet#f7760f51`. -// Remove a sticker from the set where it belongs, bots only. The sticker set must have -// been created by the bot. +// Remove a sticker from the set where it belongs. The sticker set must have been created +// by the current user/bot. // // See https://core.telegram.org/method/stickers.removeStickerFromSet for reference. type StickersRemoveStickerFromSetRequest struct { @@ -173,12 +173,11 @@ func (r *StickersRemoveStickerFromSetRequest) GetStickerAsNotEmpty() (*InputDocu } // StickersRemoveStickerFromSet invokes method stickers.removeStickerFromSet#f7760f51 returning error if any. -// Remove a sticker from the set where it belongs, bots only. The sticker set must have -// been created by the bot. +// Remove a sticker from the set where it belongs. The sticker set must have been created +// by the current user/bot. // // Possible errors: // -// 400 BOT_MISSING: Only bots can call this method, please use @stickers if you're a user. // 400 STICKER_INVALID: The provided sticker is invalid. // // See https://core.telegram.org/method/stickers.removeStickerFromSet for reference. diff --git a/tg/tl_stickers_rename_sticker_set_gen.go b/tg/tl_stickers_rename_sticker_set_gen.go index 873e413bb3..c5c73e0203 100644 --- a/tg/tl_stickers_rename_sticker_set_gen.go +++ b/tg/tl_stickers_rename_sticker_set_gen.go @@ -32,7 +32,7 @@ var ( ) // StickersRenameStickerSetRequest represents TL type `stickers.renameStickerSet#124b1c00`. -// Renames a stickerset, bots only. +// Renames a stickerset. // // See https://core.telegram.org/method/stickers.renameStickerSet for reference. type StickersRenameStickerSetRequest struct { @@ -194,7 +194,7 @@ func (r *StickersRenameStickerSetRequest) GetTitle() (value string) { } // StickersRenameStickerSet invokes method stickers.renameStickerSet#124b1c00 returning error if any. -// Renames a stickerset, bots only. +// Renames a stickerset. // // Possible errors: // diff --git a/tg/tl_stickers_replace_sticker_gen.go b/tg/tl_stickers_replace_sticker_gen.go index 8a2645ce0d..d3c5c64712 100644 --- a/tg/tl_stickers_replace_sticker_gen.go +++ b/tg/tl_stickers_replace_sticker_gen.go @@ -32,12 +32,16 @@ var ( ) // StickersReplaceStickerRequest represents TL type `stickers.replaceSticker#4696459a`. +// Replace a sticker in a stickerset »¹. +// +// Links: +// 1. https://core.telegram.org/api/stickers // // See https://core.telegram.org/method/stickers.replaceSticker for reference. type StickersReplaceStickerRequest struct { - // Sticker field of StickersReplaceStickerRequest. + // Old sticker document. Sticker InputDocumentClass - // NewSticker field of StickersReplaceStickerRequest. + // New sticker. NewSticker InputStickerSetItem } @@ -198,8 +202,17 @@ func (r *StickersReplaceStickerRequest) GetStickerAsNotEmpty() (*InputDocument, } // StickersReplaceSticker invokes method stickers.replaceSticker#4696459a returning error if any. +// Replace a sticker in a stickerset »¹. +// +// Links: +// 1. https://core.telegram.org/api/stickers +// +// Possible errors: +// +// 400 STICKER_INVALID: The provided sticker is invalid. // // See https://core.telegram.org/method/stickers.replaceSticker for reference. +// Can be used by bots. func (c *Client) StickersReplaceSticker(ctx context.Context, request *StickersReplaceStickerRequest) (MessagesStickerSetClass, error) { var result MessagesStickerSetBox diff --git a/tg/tl_stories_activate_stealth_mode_gen.go b/tg/tl_stories_activate_stealth_mode_gen.go index c2eab5953e..935b1d0c30 100644 --- a/tg/tl_stories_activate_stealth_mode_gen.go +++ b/tg/tl_stories_activate_stealth_mode_gen.go @@ -250,6 +250,10 @@ func (a *StoriesActivateStealthModeRequest) GetFuture() (value bool) { // 2. https://core.telegram.org/api/stories#stealth-mode // 3. https://core.telegram.org/constructor/updateStoriesStealthMode // +// Possible errors: +// +// 400 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. +// // See https://core.telegram.org/method/stories.activateStealthMode for reference. func (c *Client) StoriesActivateStealthMode(ctx context.Context, request *StoriesActivateStealthModeRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_stories_delete_stories_gen.go b/tg/tl_stories_delete_stories_gen.go index 9f457682f3..051a74b897 100644 --- a/tg/tl_stories_delete_stories_gen.go +++ b/tg/tl_stories_delete_stories_gen.go @@ -218,6 +218,7 @@ func (d *StoriesDeleteStoriesRequest) GetID() (value []int) { // Possible errors: // // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 STORY_ID_EMPTY: You specified no story IDs. // // See https://core.telegram.org/method/stories.deleteStories for reference. func (c *Client) StoriesDeleteStories(ctx context.Context, request *StoriesDeleteStoriesRequest) ([]int, error) { diff --git a/tg/tl_stories_found_stories_gen.go b/tg/tl_stories_found_stories_gen.go index 303a7bab51..853ae293a8 100644 --- a/tg/tl_stories_found_stories_gen.go +++ b/tg/tl_stories_found_stories_gen.go @@ -32,22 +32,29 @@ var ( ) // StoriesFoundStories represents TL type `stories.foundStories#e2de7737`. +// Stories found using global story search »¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#searching-stories // // See https://core.telegram.org/constructor/stories.foundStories for reference. type StoriesFoundStories struct { - // Flags field of StoriesFoundStories. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Count field of StoriesFoundStories. + // Total number of results found for the query. Count int - // Stories field of StoriesFoundStories. + // Matching stories. Stories []FoundStory - // NextOffset field of StoriesFoundStories. + // Offset used to fetch the next page, if not set this is the final page. // // Use SetNextOffset and GetNextOffset helpers. NextOffset string - // Chats field of StoriesFoundStories. + // Mentioned chats Chats []ChatClass - // Users field of StoriesFoundStories. + // Mentioned users Users []UserClass } diff --git a/tg/tl_stories_get_stories_by_id_gen.go b/tg/tl_stories_get_stories_by_id_gen.go index 060fed6429..4db29f9c99 100644 --- a/tg/tl_stories_get_stories_by_id_gen.go +++ b/tg/tl_stories_get_stories_by_id_gen.go @@ -218,6 +218,7 @@ func (g *StoriesGetStoriesByIDRequest) GetID() (value []int) { // Possible errors: // // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 STORIES_NEVER_CREATED: This peer hasn't ever posted any stories. // 400 STORY_ID_EMPTY: You specified no story IDs. diff --git a/tg/tl_stories_search_posts_gen.go b/tg/tl_stories_search_posts_gen.go index 9d4fc299e6..acc83b2dec 100644 --- a/tg/tl_stories_search_posts_gen.go +++ b/tg/tl_stories_search_posts_gen.go @@ -32,22 +32,47 @@ var ( ) // StoriesSearchPostsRequest represents TL type `stories.searchPosts#6cea116a`. +// Globally search for stories¹ using a hashtag or a location media area², see here +// »³ for more info on the full flow. +// Either hashtag or area must be set when invoking the method. +// +// Links: +// 1. https://core.telegram.org/api/stories +// 2. https://core.telegram.org/api/stories#location-tags +// 3. https://core.telegram.org/api/stories#searching-stories // // See https://core.telegram.org/method/stories.searchPosts for reference. type StoriesSearchPostsRequest struct { - // Flags field of StoriesSearchPostsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Hashtag field of StoriesSearchPostsRequest. + // Hashtag (without the #) // // Use SetHashtag and GetHashtag helpers. Hashtag string - // Area field of StoriesSearchPostsRequest. + // A mediaAreaGeoPoint¹ or a mediaAreaVenue². Note mediaAreaGeoPoint³ areas may be + // searched only if they have an associated address. + // + // Links: + // 1) https://core.telegram.org/constructor/mediaAreaGeoPoint + // 2) https://core.telegram.org/constructor/mediaAreaVenue + // 3) https://core.telegram.org/constructor/mediaAreaGeoPoint // // Use SetArea and GetArea helpers. Area MediaAreaClass - // Offset field of StoriesSearchPostsRequest. + // Offset for pagination¹: initially an empty string, then the next_offset from the + // previously returned stories.foundStories². + // + // Links: + // 1) https://core.telegram.org/api/offsets + // 2) https://core.telegram.org/constructor/stories.foundStories Offset string - // Limit field of StoriesSearchPostsRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -307,6 +332,18 @@ func (s *StoriesSearchPostsRequest) GetLimit() (value int) { } // StoriesSearchPosts invokes method stories.searchPosts#6cea116a returning error if any. +// Globally search for stories¹ using a hashtag or a location media area², see here +// »³ for more info on the full flow. +// Either hashtag or area must be set when invoking the method. +// +// Links: +// 1. https://core.telegram.org/api/stories +// 2. https://core.telegram.org/api/stories#location-tags +// 3. https://core.telegram.org/api/stories#searching-stories +// +// Possible errors: +// +// 400 HASHTAG_INVALID: The specified hashtag is invalid. // // See https://core.telegram.org/method/stories.searchPosts for reference. func (c *Client) StoriesSearchPosts(ctx context.Context, request *StoriesSearchPostsRequest) (*StoriesFoundStories, error) { diff --git a/tg/tl_stories_send_reaction_gen.go b/tg/tl_stories_send_reaction_gen.go index 875f1eccf1..108db749cc 100644 --- a/tg/tl_stories_send_reaction_gen.go +++ b/tg/tl_stories_send_reaction_gen.go @@ -292,6 +292,7 @@ func (s *StoriesSendReactionRequest) GetReaction() (value ReactionClass) { // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 REACTION_INVALID: The specified reaction is invalid. // 400 STORY_ID_EMPTY: You specified no story IDs. +// 400 STORY_ID_INVALID: The specified story ID is invalid. // // See https://core.telegram.org/method/stories.sendReaction for reference. func (c *Client) StoriesSendReaction(ctx context.Context, request *StoriesSendReactionRequest) (UpdatesClass, error) { diff --git a/tg/tl_stories_send_story_gen.go b/tg/tl_stories_send_story_gen.go index ac088aa207..cee66d9958 100644 --- a/tg/tl_stories_send_story_gen.go +++ b/tg/tl_stories_send_story_gen.go @@ -778,6 +778,7 @@ func (s *StoriesSendStoryRequest) MapPrivacyRules() (value InputPrivacyRuleClass // // Possible errors: // +// 400 BOOSTS_REQUIRED: The specified channel must first be boosted by its users in order to perform this action. // 400 IMAGE_PROCESS_FAILED: Failure while processing image. // 400 MEDIA_EMPTY: The provided media object is invalid. // 400 MEDIA_FILE_INVALID: The specified media file is invalid. diff --git a/tg/tl_stories_stories_gen.go b/tg/tl_stories_stories_gen.go index ff3ce2ebe4..f2fb78e02a 100644 --- a/tg/tl_stories_stories_gen.go +++ b/tg/tl_stories_stories_gen.go @@ -39,13 +39,16 @@ var ( // // See https://core.telegram.org/constructor/stories.stories for reference. type StoriesStories struct { - // Flags field of StoriesStories. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Total number of stories that can be fetched Count int // Stories Stories []StoryItemClass - // PinnedToTop field of StoriesStories. + // IDs of pinned stories. // // Use SetPinnedToTop and GetPinnedToTop helpers. PinnedToTop []int diff --git a/tg/tl_stories_toggle_pinned_to_top_gen.go b/tg/tl_stories_toggle_pinned_to_top_gen.go index 6a3e153ee1..139774c3cf 100644 --- a/tg/tl_stories_toggle_pinned_to_top_gen.go +++ b/tg/tl_stories_toggle_pinned_to_top_gen.go @@ -32,12 +32,19 @@ var ( ) // StoriesTogglePinnedToTopRequest represents TL type `stories.togglePinnedToTop#b297e9b`. +// Pin some stories to the top of the profile, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/stories#pinned-or-archived-stories // // See https://core.telegram.org/method/stories.togglePinnedToTop for reference. type StoriesTogglePinnedToTopRequest struct { - // Peer field of StoriesTogglePinnedToTopRequest. + // Peer where to pin stories. Peer InputPeerClass - // ID field of StoriesTogglePinnedToTopRequest. + // IDs of the stories to pin (max stories_pinned_to_top_count_max¹). + // + // Links: + // 1) https://core.telegram.org/api/config#stories-pinned-to-top-count-max ID []int } @@ -206,6 +213,15 @@ func (t *StoriesTogglePinnedToTopRequest) GetID() (value []int) { } // StoriesTogglePinnedToTop invokes method stories.togglePinnedToTop#b297e9b returning error if any. +// Pin some stories to the top of the profile, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/stories#pinned-or-archived-stories +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 STORY_ID_INVALID: The specified story ID is invalid. // // See https://core.telegram.org/method/stories.togglePinnedToTop for reference. func (c *Client) StoriesTogglePinnedToTop(ctx context.Context, request *StoriesTogglePinnedToTopRequest) (bool, error) { diff --git a/tg/tl_story_item_gen.go b/tg/tl_story_item_gen.go index 072b4bcdfe..5db612a51e 100644 --- a/tg/tl_story_item_gen.go +++ b/tg/tl_story_item_gen.go @@ -468,7 +468,7 @@ type StoryItem struct { ID int // When was the story posted. Date int - // FromID field of StoryItem. + // Sender of the story. // // Use SetFromID and GetFromID helpers. FromID PeerClass diff --git a/tg/tl_timezone_gen.go b/tg/tl_timezone_gen.go index 1a245403a0..c326306f93 100644 --- a/tg/tl_timezone_gen.go +++ b/tg/tl_timezone_gen.go @@ -32,14 +32,16 @@ var ( ) // Timezone represents TL type `timezone#ff9289f5`. +// Timezone information. // // See https://core.telegram.org/constructor/timezone for reference. type Timezone struct { - // ID field of Timezone. + // Unique timezone ID. ID string - // Name field of Timezone. + // Human-readable and localized timezone name. Name string - // UtcOffset field of Timezone. + // UTC offset in seconds, which may be displayed in hh:mm format by the client together + // with the human-readable name (i.e. $name UTC -01:00). UtcOffset int } diff --git a/tg/tl_top_peer_category_gen.go b/tg/tl_top_peer_category_gen.go index 9f4d43cac7..31e31e112e 100644 --- a/tg/tl_top_peer_category_gen.go +++ b/tg/tl_top_peer_category_gen.go @@ -848,6 +848,10 @@ func (t *TopPeerCategoryForwardChats) DecodeBare(b *bin.Buffer) error { } // TopPeerCategoryBotsApp represents TL type `topPeerCategoryBotsApp#fd9e7bec`. +// Most frequently used Main Mini Bot Apps¹. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps#main-mini-apps // // See https://core.telegram.org/constructor/topPeerCategoryBotsApp for reference. type TopPeerCategoryBotsApp struct { diff --git a/tg/tl_update_gen.go b/tg/tl_update_gen.go index 1e83ab5352..10e638ba0a 100644 --- a/tg/tl_update_gen.go +++ b/tg/tl_update_gen.go @@ -1529,7 +1529,7 @@ type UpdateNewAuthorization struct { // Links: // 1) https://core.telegram.org/api/auth#confirming-login Unconfirmed bool - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation @@ -5264,8 +5264,22 @@ func (u *UpdateChannelTooLong) GetPts() (value int, ok bool) { } // UpdateChannel represents TL type `updateChannel#635b4c09`. -// A new channel or supergroup is available, or info about an existing channel has -// changed and must be refeteched. +// Channel/supergroup (channel¹ and/or channelFull²) information was updated. +// This update can only be received through getDifference or in +// updates¹/updatesCombined² constructors, so it will always come bundled with the +// updated channel³, that should be applied as usual »⁴, without re-fetching the info +// manually. +// However, full peer information will not come bundled in updates, so the full peer +// cache (channelFull¹) must be invalidated for channel_id when receiving this update. +// +// Links: +// 1. https://core.telegram.org/constructor/channel +// 2. https://core.telegram.org/constructor/channelFull +// 3. https://core.telegram.org/constructor/updates +// 4. https://core.telegram.org/constructor/updatesCombined +// 5. https://core.telegram.org/constructor/channel +// 6. https://core.telegram.org/api/peers +// 7. https://core.telegram.org/constructor/channelFull // // See https://core.telegram.org/constructor/updateChannel for reference. type UpdateChannel struct { @@ -9627,10 +9641,11 @@ func (u *UpdateRecentStickers) DecodeBare(b *bin.Buffer) error { // UpdateConfig represents TL type `updateConfig#a229dd06`. // The server-side configuration has changed; the client should re-fetch the config using -// help.getConfig¹ +// help.getConfig¹ and help.getAppConfig². // // Links: // 1. https://core.telegram.org/method/help.getConfig +// 2. https://core.telegram.org/method/help.getAppConfig // // See https://core.telegram.org/constructor/updateConfig for reference. type UpdateConfig struct { @@ -11136,10 +11151,11 @@ type UpdateBotPrecheckoutQuery struct { // // Use SetShippingOptionID and GetShippingOptionID helpers. ShippingOptionID string - // Three-letter ISO 4217 currency¹ code + // Three-letter ISO 4217 currency¹ code, or XTR for Telegram Stars². // // Links: // 1) https://core.telegram.org/bots/payments#supported-currencies + // 2) https://core.telegram.org/api/stars Currency string // Total amount in the smallest units of the currency (integer, not float/double). For // example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in @@ -17109,7 +17125,22 @@ func (u *UpdatePinnedChannelMessages) GetPtsCount() (value int) { } // UpdateChat represents TL type `updateChat#f89a6a4e`. -// A new chat is available +// Chat (chat¹ and/or chatFull²) information was updated. +// This update can only be received through getDifference or in +// updates¹/updatesCombined² constructors, so it will always come bundled with the +// updated chat³, that should be applied as usual »⁴, without re-fetching the info +// manually. +// However, full peer information will not come bundled in updates, so the full peer +// cache (chatFull¹) must be invalidated for chat_id when receiving this update. +// +// Links: +// 1. https://core.telegram.org/constructor/chat +// 2. https://core.telegram.org/constructor/chatFull +// 3. https://core.telegram.org/constructor/updates +// 4. https://core.telegram.org/constructor/updatesCombined +// 5. https://core.telegram.org/constructor/chat +// 6. https://core.telegram.org/api/peers +// 7. https://core.telegram.org/constructor/chatFull // // See https://core.telegram.org/constructor/updateChat for reference. type UpdateChat struct { @@ -21653,15 +21684,21 @@ func (u *UpdateMoveStickerSetToTop) GetStickerset() (value int64) { } // UpdateMessageExtendedMedia represents TL type `updateMessageExtendedMedia#d5a41724`. -// Extended media update +// You bought a paid media »¹: this update contains the revealed media. +// +// Links: +// 1. https://core.telegram.org/api/paid-media // // See https://core.telegram.org/constructor/updateMessageExtendedMedia for reference. type UpdateMessageExtendedMedia struct { - // Peer + // Peer where the paid media was posted Peer PeerClass - // Message ID + // ID of the message containing the paid media MsgID int - // Extended media + // Revealed media, contains only messageExtendedMedia¹ constructors. + // + // Links: + // 1) https://core.telegram.org/constructor/messageExtendedMedia ExtendedMedia []MessageExtendedMediaClass } @@ -22311,10 +22348,22 @@ func (u *UpdateChannelPinnedTopics) GetOrder() (value []int, ok bool) { } // UpdateUser represents TL type `updateUser#20529438`. -// User information was updated, it must be refetched using users.getFullUser¹. +// User (user¹ and/or userFull²) information was updated. +// This update can only be received through getDifference or in +// updates¹/updatesCombined² constructors, so it will always come bundled with the +// updated user³, that should be applied as usual »⁴, without re-fetching the info +// manually. +// However, full peer information will not come bundled in updates, so the full peer +// cache (userFull¹) must be invalidated for user_id when receiving this update. // // Links: -// 1. https://core.telegram.org/method/users.getFullUser +// 1. https://core.telegram.org/constructor/user +// 2. https://core.telegram.org/constructor/userFull +// 3. https://core.telegram.org/constructor/updates +// 4. https://core.telegram.org/constructor/updatesCombined +// 5. https://core.telegram.org/constructor/user +// 6. https://core.telegram.org/api/peers +// 7. https://core.telegram.org/constructor/userFull // // See https://core.telegram.org/constructor/updateUser for reference. type UpdateUser struct { @@ -23412,7 +23461,7 @@ func (u *UpdateSentStoryReaction) GetReaction() (value ReactionClass) { } // UpdateBotChatBoost represents TL type `updateBotChatBoost#904dd49c`. -// A channel boost¹ has changed (bots only) +// A channel/supergroup boost¹ has changed (bots only) // // Links: // 1. https://core.telegram.org/api/boost @@ -25070,6 +25119,12 @@ func (u *UpdatePinnedSavedDialogs) MapOrder() (value DialogPeerClassArray, ok bo } // UpdateSavedReactionTags represents TL type `updateSavedReactionTags#39c67432`. +// The list of reaction tag »¹ names assigned by the user has changed and should be +// refetched using messages.getSavedReactionTags »². +// +// Links: +// 1. https://core.telegram.org/api/saved-messages#tags +// 2. https://core.telegram.org/method/messages.getSavedReactionTags // // See https://core.telegram.org/constructor/updateSavedReactionTags for reference. type UpdateSavedReactionTags struct { @@ -25171,10 +25226,11 @@ func (u *UpdateSavedReactionTags) DecodeBare(b *bin.Buffer) error { } // UpdateSMSJob represents TL type `updateSmsJob#f16269d4`. +// A new SMS job was received // // See https://core.telegram.org/constructor/updateSmsJob for reference. type UpdateSMSJob struct { - // JobID field of UpdateSMSJob. + // SMS job ID JobID string } @@ -25305,10 +25361,14 @@ func (u *UpdateSMSJob) GetJobID() (value string) { } // UpdateQuickReplies represents TL type `updateQuickReplies#f9470ab2`. +// Info about or the order of quick reply shortcuts »¹ was changed. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/constructor/updateQuickReplies for reference. type UpdateQuickReplies struct { - // QuickReplies field of UpdateQuickReplies. + // New quick reply shortcut order and information. QuickReplies []QuickReply } @@ -25454,10 +25514,14 @@ func (u *UpdateQuickReplies) GetQuickReplies() (value []QuickReply) { } // UpdateNewQuickReply represents TL type `updateNewQuickReply#f53da717`. +// A new quick reply shortcut »¹ was created. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/constructor/updateNewQuickReply for reference. type UpdateNewQuickReply struct { - // QuickReply field of UpdateNewQuickReply. + // Quick reply shortcut. QuickReply QuickReply } @@ -25588,10 +25652,17 @@ func (u *UpdateNewQuickReply) GetQuickReply() (value QuickReply) { } // UpdateDeleteQuickReply represents TL type `updateDeleteQuickReply#53e6f1ec`. +// A quick reply shortcut »¹ was deleted. This will not emit +// updateDeleteQuickReplyMessages² updates, even if all the messages in the shortcut are +// also deleted by this update. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts +// 2. https://core.telegram.org/constructor/updateDeleteQuickReplyMessages // // See https://core.telegram.org/constructor/updateDeleteQuickReply for reference. type UpdateDeleteQuickReply struct { - // ShortcutID field of UpdateDeleteQuickReply. + // ID of the quick reply shortcut that was deleted. ShortcutID int } @@ -25722,10 +25793,18 @@ func (u *UpdateDeleteQuickReply) GetShortcutID() (value int) { } // UpdateQuickReplyMessage represents TL type `updateQuickReplyMessage#3e050d0f`. +// A new message was added to a quick reply shortcut »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/constructor/updateQuickReplyMessage for reference. type UpdateQuickReplyMessage struct { - // Message field of UpdateQuickReplyMessage. + // The message that was added (the message¹.quick_reply_shortcut_id field will contain + // the shortcut ID). + // + // Links: + // 1) https://core.telegram.org/constructor/message Message MessageClass } @@ -25861,12 +25940,16 @@ func (u *UpdateQuickReplyMessage) GetMessage() (value MessageClass) { } // UpdateDeleteQuickReplyMessages represents TL type `updateDeleteQuickReplyMessages#566fe7cd`. +// One or more messages in a quick reply shortcut »¹ were deleted. +// +// Links: +// 1. https://core.telegram.org/api/business#quick-reply-shortcuts // // See https://core.telegram.org/constructor/updateDeleteQuickReplyMessages for reference. type UpdateDeleteQuickReplyMessages struct { - // ShortcutID field of UpdateDeleteQuickReplyMessages. + // Quick reply shortcut ID. ShortcutID int - // Messages field of UpdateDeleteQuickReplyMessages. + // IDs of the deleted messages. Messages []int } @@ -26035,12 +26118,23 @@ func (u *UpdateDeleteQuickReplyMessages) GetMessages() (value []int) { } // UpdateBotBusinessConnect represents TL type `updateBotBusinessConnect#8ae5c97a`. +// Connecting or disconnecting a business bot¹ or changing the connection settings will +// emit an updateBotBusinessConnect² update to the bot, with the new settings and a +// connection_id that will be used by the bot to handle updates from and send messages as +// the user. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots +// 2. https://core.telegram.org/constructor/updateBotBusinessConnect // // See https://core.telegram.org/constructor/updateBotBusinessConnect for reference. type UpdateBotBusinessConnect struct { - // Connection field of UpdateBotBusinessConnect. + // Business connection settings Connection BotBusinessConnection - // Qts field of UpdateBotBusinessConnect. + // New qts value, see updates »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/updates Qts int } @@ -26196,20 +26290,30 @@ func (u *UpdateBotBusinessConnect) GetQts() (value int) { } // UpdateBotNewBusinessMessage represents TL type `updateBotNewBusinessMessage#9ddb347c`. +// A message was received via a connected business chat »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots // // See https://core.telegram.org/constructor/updateBotNewBusinessMessage for reference. type UpdateBotNewBusinessMessage struct { - // Flags field of UpdateBotNewBusinessMessage. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ConnectionID field of UpdateBotNewBusinessMessage. + // Connection ID. ConnectionID string - // Message field of UpdateBotNewBusinessMessage. + // New message. Message MessageClass - // ReplyToMessage field of UpdateBotNewBusinessMessage. + // The message that message is replying to. // // Use SetReplyToMessage and GetReplyToMessage helpers. ReplyToMessage MessageClass - // Qts field of UpdateBotNewBusinessMessage. + // New qts value, see updates »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/updates Qts int } @@ -26460,20 +26564,30 @@ func (u *UpdateBotNewBusinessMessage) GetQts() (value int) { } // UpdateBotEditBusinessMessage represents TL type `updateBotEditBusinessMessage#7df587c`. +// A message was edited in a connected business chat »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots // // See https://core.telegram.org/constructor/updateBotEditBusinessMessage for reference. type UpdateBotEditBusinessMessage struct { - // Flags field of UpdateBotEditBusinessMessage. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ConnectionID field of UpdateBotEditBusinessMessage. + // Business connection ID ConnectionID string - // Message field of UpdateBotEditBusinessMessage. + // New message. Message MessageClass - // ReplyToMessage field of UpdateBotEditBusinessMessage. + // The message that message is replying to. // // Use SetReplyToMessage and GetReplyToMessage helpers. ReplyToMessage MessageClass - // Qts field of UpdateBotEditBusinessMessage. + // New qts value, see updates »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/updates Qts int } @@ -26724,16 +26838,26 @@ func (u *UpdateBotEditBusinessMessage) GetQts() (value int) { } // UpdateBotDeleteBusinessMessage represents TL type `updateBotDeleteBusinessMessage#a02a982e`. +// A message was deleted in a connected business chat »¹. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots // // See https://core.telegram.org/constructor/updateBotDeleteBusinessMessage for reference. type UpdateBotDeleteBusinessMessage struct { - // ConnectionID field of UpdateBotDeleteBusinessMessage. + // Business connection ID. ConnectionID string - // Peer field of UpdateBotDeleteBusinessMessage. + // Peer¹ where the messages were deleted. + // + // Links: + // 1) https://core.telegram.org/api/peers Peer PeerClass - // Messages field of UpdateBotDeleteBusinessMessage. + // IDs of the messages that were deleted. Messages []int - // Qts field of UpdateBotDeleteBusinessMessage. + // New qts value, see updates »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/updates Qts int } @@ -26957,14 +27081,24 @@ func (u *UpdateBotDeleteBusinessMessage) GetQts() (value int) { } // UpdateNewStoryReaction represents TL type `updateNewStoryReaction#1824e40b`. +// Represents a new reaction to a story¹. +// +// Links: +// 1. https://core.telegram.org/api/reactions#notifications-about-reactions // // See https://core.telegram.org/constructor/updateNewStoryReaction for reference. type UpdateNewStoryReaction struct { - // StoryID field of UpdateNewStoryReaction. + // Story ID¹. + // + // Links: + // 1) https://core.telegram.org/api/stories StoryID int - // Peer field of UpdateNewStoryReaction. + // The peer where the story was posted. Peer PeerClass - // Reaction field of UpdateNewStoryReaction. + // The reaction¹. + // + // Links: + // 1) https://core.telegram.org/api/reactions Reaction ReactionClass } @@ -27155,12 +27289,16 @@ func (u *UpdateNewStoryReaction) GetReaction() (value ReactionClass) { } // UpdateBroadcastRevenueTransactions represents TL type `updateBroadcastRevenueTransactions#dfd961f5`. +// A new channel ad revenue transaction was made, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/revenue#revenue-statistics // // See https://core.telegram.org/constructor/updateBroadcastRevenueTransactions for reference. type UpdateBroadcastRevenueTransactions struct { - // Peer field of UpdateBroadcastRevenueTransactions. + // Channel Peer PeerClass - // Balances field of UpdateBroadcastRevenueTransactions. + // New ad revenue balance. Balances BroadcastRevenueBalances } @@ -27321,10 +27459,14 @@ func (u *UpdateBroadcastRevenueTransactions) GetBalances() (value BroadcastReven } // UpdateStarsBalance represents TL type `updateStarsBalance#fb85198`. +// The current account's Telegram Stars balance »¹ has changed. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/updateStarsBalance for reference. type UpdateStarsBalance struct { - // Balance field of UpdateStarsBalance. + // New balance. Balance int64 } @@ -27455,26 +27597,39 @@ func (u *UpdateStarsBalance) GetBalance() (value int64) { } // UpdateBusinessBotCallbackQuery represents TL type `updateBusinessBotCallbackQuery#1ea2fda7`. +// A callback button sent via a business connection¹ was pressed, and the button data +// was sent to the bot that created the button. +// +// Links: +// 1. https://core.telegram.org/api/business#connected-bots // // See https://core.telegram.org/constructor/updateBusinessBotCallbackQuery for reference. type UpdateBusinessBotCallbackQuery struct { - // Flags field of UpdateBusinessBotCallbackQuery. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // QueryID field of UpdateBusinessBotCallbackQuery. + // Query ID QueryID int64 - // UserID field of UpdateBusinessBotCallbackQuery. + // ID of the user that pressed the button UserID int64 - // ConnectionID field of UpdateBusinessBotCallbackQuery. + // Business connection ID¹ + // + // Links: + // 1) https://core.telegram.org/api/business#connected-bots ConnectionID string - // Message field of UpdateBusinessBotCallbackQuery. + // Message that contains the keyboard (also contains info about the chat where the + // message was sent). Message MessageClass - // ReplyToMessage field of UpdateBusinessBotCallbackQuery. + // The message that message is replying to. // // Use SetReplyToMessage and GetReplyToMessage helpers. ReplyToMessage MessageClass - // ChatInstance field of UpdateBusinessBotCallbackQuery. + // Global identifier, uniquely corresponding to the chat to which the message with the + // callback button was sent. Useful for high scores in games. ChatInstance int64 - // Data field of UpdateBusinessBotCallbackQuery. + // Callback data // // Use SetData and GetData helpers. Data []byte @@ -27821,12 +27976,16 @@ func (u *UpdateBusinessBotCallbackQuery) GetData() (value []byte, ok bool) { } // UpdateStarsRevenueStatus represents TL type `updateStarsRevenueStatus#a584b019`. +// The Telegram Star balance of a channel/bot we own has changed »¹. +// +// Links: +// 1. https://core.telegram.org/api/stars#revenue-statistics // // See https://core.telegram.org/constructor/updateStarsRevenueStatus for reference. type UpdateStarsRevenueStatus struct { - // Peer field of UpdateStarsRevenueStatus. + // Channel/bot Peer PeerClass - // Status field of UpdateStarsRevenueStatus. + // New Telegram Star balance. Status StarsRevenueStatus } diff --git a/tg/tl_updates_channel_difference_gen.go b/tg/tl_updates_channel_difference_gen.go index 8d0f4e2644..892b33aae1 100644 --- a/tg/tl_updates_channel_difference_gen.go +++ b/tg/tl_updates_channel_difference_gen.go @@ -49,7 +49,10 @@ type UpdatesChannelDifferenceEmpty struct { // 1) https://core.telegram.org/api/updates Pts int // Clients are supposed to refetch the channel difference after timeout seconds have - // elapsed + // elapsed, if the user is currently viewing the chat, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/updates#subscribing-to-updates-of-channels-supergroups // // Use SetTimeout and GetTimeout helpers. Timeout int @@ -696,7 +699,10 @@ type UpdatesChannelDifference struct { // 1) https://core.telegram.org/api/updates Pts int // Clients are supposed to refetch the channel difference after timeout seconds have - // elapsed + // elapsed, if the user is currently viewing the chat, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/updates#subscribing-to-updates-of-channels-supergroups // // Use SetTimeout and GetTimeout helpers. Timeout int @@ -1162,7 +1168,10 @@ type UpdatesChannelDifferenceClass interface { GetFinal() (value bool) // Clients are supposed to refetch the channel difference after timeout seconds have - // elapsed + // elapsed, if the user is currently viewing the chat, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/updates#subscribing-to-updates-of-channels-supergroups GetTimeout() (value int, ok bool) // AsNotEmpty tries to map UpdatesChannelDifferenceClass to NotEmptyUpdatesChannelDifference. diff --git a/tg/tl_upload_get_cdn_file_gen.go b/tg/tl_upload_get_cdn_file_gen.go index 8f5a66e036..e58c0408e9 100644 --- a/tg/tl_upload_get_cdn_file_gen.go +++ b/tg/tl_upload_get_cdn_file_gen.go @@ -224,6 +224,10 @@ func (g *UploadGetCDNFileRequest) GetLimit() (value int) { // Links: // 1. https://core.telegram.org/cdn // +// Possible errors: +// +// 400 FILE_TOKEN_INVALID: The master DC did not accept the file_token (e.g., the token has expired). Continue downloading the file from the master DC using upload.getFile. +// // See https://core.telegram.org/method/upload.getCdnFile for reference. func (c *Client) UploadGetCDNFile(ctx context.Context, request *UploadGetCDNFileRequest) (UploadCDNFileClass, error) { var result UploadCDNFileBox diff --git a/tg/tl_upload_get_cdn_file_hashes_gen.go b/tg/tl_upload_get_cdn_file_hashes_gen.go index ae1084d5fc..066b05eb92 100644 --- a/tg/tl_upload_get_cdn_file_hashes_gen.go +++ b/tg/tl_upload_get_cdn_file_hashes_gen.go @@ -200,7 +200,7 @@ func (g *UploadGetCDNFileHashesRequest) GetOffset() (value int64) { // Possible errors: // // 400 CDN_METHOD_INVALID: You can't call this method in a CDN DC. -// 400 FILE_TOKEN_INVALID: The specified file token is invalid. +// 400 FILE_TOKEN_INVALID: The master DC did not accept the file_token (e.g., the token has expired). Continue downloading the file from the master DC using upload.getFile. // 400 RSA_DECRYPT_FAILED: Internal RSA decryption failed. // // See https://core.telegram.org/method/upload.getCdnFileHashes for reference. diff --git a/tg/tl_upload_get_file_gen.go b/tg/tl_upload_get_file_gen.go index dbfcaefcf3..ed87c79e6f 100644 --- a/tg/tl_upload_get_file_gen.go +++ b/tg/tl_upload_get_file_gen.go @@ -325,8 +325,8 @@ func (g *UploadGetFileRequest) GetLimit() (value int) { // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 406 FILEREF_UPGRADE_NEEDED: The client has to be updated in order to support file references. // 400 FILE_ID_INVALID: The provided file id is invalid. -// 400 FILE_REFERENCE_*: The file reference expired, it must be refreshed. // 400 FILE_REFERENCE_EXPIRED: File reference expired, it must be refetched as described in the documentation. +// 420 FLOOD_PREMIUM_WAIT_%d: Please wait %d seconds before repeating the action, or purchase a Telegram Premium subscription to remove this rate limit. // 400 LIMIT_INVALID: The provided limit is invalid. // 400 LOCATION_INVALID: The provided location is invalid. // 400 MSG_ID_INVALID: Invalid message ID provided. diff --git a/tg/tl_upload_reupload_cdn_file_gen.go b/tg/tl_upload_reupload_cdn_file_gen.go index f231119277..0c7528e8d5 100644 --- a/tg/tl_upload_reupload_cdn_file_gen.go +++ b/tg/tl_upload_reupload_cdn_file_gen.go @@ -201,7 +201,9 @@ func (r *UploadReuploadCDNFileRequest) GetRequestToken() (value []byte) { // // 400 CDN_METHOD_INVALID: You can't call this method in a CDN DC. // 500 CDN_UPLOAD_TIMEOUT: A server-side timeout occurred while reuploading the file to the CDN DC. -// 400 FILE_TOKEN_INVALID: The specified file token is invalid. +// 400 FILE_TOKEN_INVALID: The master DC did not accept the file_token (e.g., the token has expired). Continue downloading the file from the master DC using upload.getFile. +// 400 LOCATION_INVALID: The provided location is invalid. +// 400 REQUEST_TOKEN_INVALID: The master DC did not accept the request_token from the CDN DC. Continue downloading the file from the master DC using upload.getFile. // 400 RSA_DECRYPT_FAILED: Internal RSA decryption failed. // // See https://core.telegram.org/method/upload.reuploadCdnFile for reference. diff --git a/tg/tl_user_full_gen.go b/tg/tl_user_full_gen.go index 5543eb17e4..d9ba474be1 100644 --- a/tg/tl_user_full_gen.go +++ b/tg/tl_user_full_gen.go @@ -33,6 +33,12 @@ var ( // UserFull represents TL type `userFull#cc997720`. // Extended user info +// When updating the local peer database »¹, all fields from the newly received +// constructor take priority over the old constructor cached locally (including by +// removing fields that aren't set in the new constructor). +// +// Links: +// 1. https://core.telegram.org/api/peers // // See https://core.telegram.org/constructor/userFull for reference. type UserFull struct { @@ -81,13 +87,37 @@ type UserFull struct { // 1) https://core.telegram.org/method/messages.setChatWallPaper // 2) https://core.telegram.org/api/wallpapers#installing-wallpapers-in-a-specific-chat-or-channel WallpaperOverridden bool - // ContactRequirePremium field of UserFull. + // If set, we cannot write to this user: subscribe to Telegram Premium¹ to get + // permission to write to this user. To set this flag for ourselves invoke account + // setGlobalPrivacySettings², setting the settings.new_noncontact_peers_require_premium + // flag, see here »³ for more info. + // + // Links: + // 1) https://core.telegram.org/api/premium + // 2) https://core.telegram.org/method/account.setGlobalPrivacySettings + // 3) https://core.telegram.org/api/privacy#require-premium-for-new-non-contact-users ContactRequirePremium bool - // ReadDatesPrivate field of UserFull. + // If set, we cannot fetch the exact read date of messages we send to this user using + // messages.getOutboxReadDate¹. The exact read date of messages might still be + // unavailable for other reasons, see here »² for more info. To set this flag for + // ourselves invoke account.setGlobalPrivacySettings³, setting the settings + // hide_read_marks flag. + // + // Links: + // 1) https://core.telegram.org/method/messages.getOutboxReadDate + // 2) https://core.telegram.org/method/messages.getOutboxReadDate + // 3) https://core.telegram.org/method/account.setGlobalPrivacySettings ReadDatesPrivate bool - // Flags2 field of UserFull. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags2 bin.Fields - // SponsoredEnabled field of UserFull. + // Whether ads were re-enabled for the current account (only accessible to the currently + // logged-in user), see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/business#re-enable-ads SponsoredEnabled bool // User ID ID int64 @@ -181,35 +211,62 @@ type UserFull struct { // // Use SetStories and GetStories helpers. Stories PeerStories - // BusinessWorkHours field of UserFull. + // Telegram Business working hours »¹. + // + // Links: + // 1) https://core.telegram.org/api/business#opening-hours // // Use SetBusinessWorkHours and GetBusinessWorkHours helpers. BusinessWorkHours BusinessWorkHours - // BusinessLocation field of UserFull. + // Telegram Business location »¹. + // + // Links: + // 1) https://core.telegram.org/api/business#location // // Use SetBusinessLocation and GetBusinessLocation helpers. BusinessLocation BusinessLocation - // BusinessGreetingMessage field of UserFull. + // Telegram Business greeting message »¹. + // + // Links: + // 1) https://core.telegram.org/api/business#greeting-messages // // Use SetBusinessGreetingMessage and GetBusinessGreetingMessage helpers. BusinessGreetingMessage BusinessGreetingMessage - // BusinessAwayMessage field of UserFull. + // Telegram Business away message »¹. + // + // Links: + // 1) https://core.telegram.org/api/business#away-messages // // Use SetBusinessAwayMessage and GetBusinessAwayMessage helpers. BusinessAwayMessage BusinessAwayMessage - // BusinessIntro field of UserFull. + // Specifies a custom Telegram Business profile introduction »¹. + // + // Links: + // 1) https://core.telegram.org/api/business#business-introduction // // Use SetBusinessIntro and GetBusinessIntro helpers. BusinessIntro BusinessIntro - // Birthday field of UserFull. + // Contains info about the user's birthday »¹. + // + // Links: + // 1) https://core.telegram.org/api/profile#birthday // // Use SetBirthday and GetBirthday helpers. Birthday Birthday - // PersonalChannelID field of UserFull. + // ID of the associated personal channel »¹, that should be shown in the profile page². + // + // Links: + // 1) https://core.telegram.org/api/channel + // 2) https://core.telegram.org/api/profile#personal-channel // // Use SetPersonalChannelID and GetPersonalChannelID helpers. PersonalChannelID int64 - // PersonalChannelMessage field of UserFull. + // ID of the latest message of the associated personal channel »¹, that should be + // previewed in the profile page². + // + // Links: + // 1) https://core.telegram.org/api/channel + // 2) https://core.telegram.org/api/profile#personal-channel // // Use SetPersonalChannelMessage and GetPersonalChannelMessage helpers. PersonalChannelMessage int diff --git a/tg/tl_user_gen.go b/tg/tl_user_gen.go index 7dead706d6..1663524f28 100644 --- a/tg/tl_user_gen.go +++ b/tg/tl_user_gen.go @@ -167,7 +167,17 @@ func (u *UserEmpty) GetID() (value int64) { } // User represents TL type `user#83314fca`. -// Indicates info about a certain user +// Indicates info about a certain user. +// Unless specified otherwise, when updating the local peer database¹, all fields from +// the newly received constructor take priority over the old constructor cached locally +// (including by removing fields that aren't set in the new constructor). +// See here »¹ for an implementation of the logic to use when updating the local user +// peer database². +// +// Links: +// 1. https://core.telegram.org/api/peers +// 2. https://github.com/tdlib/td/blob/cb164927417f22811c74cd8678ed4a5ab7cb80ba/td/telegram/UserManager.cpp#L2267 +// 3. https://core.telegram.org/api/peers // // See https://core.telegram.org/constructor/user for reference. type User struct { @@ -178,13 +188,31 @@ type User struct { Flags bin.Fields // Whether this user indicates the currently logged in user Self bool - // Whether this user is a contact + // Whether this user is a contact When updating the local peer database¹, do not apply + // changes to this field if the min flag is set. + // + // Links: + // 1) https://core.telegram.org/api/peers Contact bool - // Whether this user is a mutual contact + // Whether this user is a mutual contact. When updating the local peer database¹, do not + // apply changes to this field if the min flag is set. + // + // Links: + // 1) https://core.telegram.org/api/peers MutualContact bool - // Whether the account of this user was deleted + // Whether the account of this user was deleted. Changes to this flag should invalidate + // the local userFull¹ cache for this user ID, see here »² for more info. + // + // Links: + // 1) https://core.telegram.org/constructor/userFull + // 2) https://core.telegram.org/api/peers#full-info-database Deleted bool - // Is this user a bot? + // Is this user a bot? Changes to this flag should invalidate the local userFull¹ cache + // for this user ID, see here »² for more info. + // + // Links: + // 1) https://core.telegram.org/constructor/userFull + // 2) https://core.telegram.org/api/peers#full-info-database Bot bool // Can the bot see all messages in groups? BotChatHistory bool @@ -205,7 +233,8 @@ type User struct { Support bool // This may be a scam user Scam bool - // If set, the profile picture for this user should be refetched + // If set and min is set, the value of photo can be used to update the local database, + // see the documentation of that flag for more info. ApplyMinPhoto bool // If set, this user was reported by many users as a fake or scam user: be careful when // interacting with them. @@ -215,12 +244,24 @@ type User struct { // Links: // 1) https://core.telegram.org/api/bots/attach BotAttachMenu bool - // Whether this user is a Telegram Premium user + // Whether this user is a Telegram Premium user Changes to this flag should invalidate + // the local userFull¹ cache for this user ID, see here »² for more info. Changes to + // this flag if the self flag is set should also trigger the following calls, to refresh + // the respective caches: - The help.getConfig³ cache - The messages.getTopReactions⁴ + // cache if the bot flag is not set + // + // Links: + // 1) https://core.telegram.org/constructor/userFull + // 2) https://core.telegram.org/api/peers#full-info-database + // 3) https://core.telegram.org/method/help.getConfig + // 4) https://core.telegram.org/method/messages.getTopReactions Premium bool - // Whether we installed the attachment menu web app¹ offered by this bot + // Whether we installed the attachment menu web app¹ offered by this bot. When updating + // the local peer database², do not apply changes to this field if the min flag is set. // // Links: // 1) https://core.telegram.org/api/bots/attach + // 2) https://core.telegram.org/api/peers AttachMenuEnabled bool // Flags, see TL conditional fields¹ // @@ -228,60 +269,159 @@ type User struct { // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags2 bin.Fields // Whether we can edit the profile picture, name, about text and description of this bot - // because we own it. + // because we own it. When updating the local peer database¹, do not apply changes to + // this field if the min flag is set. Changes to this flag (if min is not set) should + // invalidate the local userFull² cache for this user ID. + // + // Links: + // 1) https://core.telegram.org/api/peers + // 2) https://core.telegram.org/constructor/userFull BotCanEdit bool - // Whether we marked this user as a close friend, see here » for more info¹ + // Whether we marked this user as a close friend, see here » for more info¹. When + // updating the local peer database², do not apply changes to this field if the min flag + // is set. // // Links: // 1) https://core.telegram.org/api/privacy + // 2) https://core.telegram.org/api/peers CloseFriend bool - // Whether we have hidden »¹ all active stories of this user. + // Whether we have hidden »¹ all active stories of this user. When updating the local + // peer database², do not apply changes to this field if the min flag is set. // // Links: // 1) https://core.telegram.org/api/stories#hiding-stories-of-other-users + // 2) https://core.telegram.org/api/peers StoriesHidden bool // No stories from this user are visible. StoriesUnavailable bool - // ContactRequirePremium field of User. + // If set, we can only write to this user if they have already sent some messages to us, + // if we are subscribed to Telegram Premium¹, or if they're a mutual contact (user² + // mutual_contact). All the secondary conditions listed above must be checked separately + // to verify whether we can still write to the user, even if this flag is set (i.e. a + // mutual contact will have this flag set even if we can still write to them, and so on.. + // ); to avoid doing these extra checks if we haven't yet cached all the required + // information (for example while displaying the chat list in the sharing UI) the users + // getIsPremiumRequiredToContact³ method may be invoked instead, passing the list of + // users currently visible in the UI, returning a list of booleans that directly specify + // whether we can or cannot write to each user; alternatively, the userFull⁴ + // contact_require_premium flag contains the same (fully checked, i.e. it's not just a + // copy of this flag) info returned by users.getIsPremiumRequiredToContact⁵. To set + // this flag for ourselves invoke account.setGlobalPrivacySettings⁶, setting the + // settings.new_noncontact_peers_require_premium flag. + // + // Links: + // 1) https://core.telegram.org/api/premium + // 2) https://core.telegram.org/constructor/user + // 3) https://core.telegram.org/method/users.getIsPremiumRequiredToContact + // 4) https://core.telegram.org/constructor/userFull + // 5) https://core.telegram.org/method/users.getIsPremiumRequiredToContact + // 6) https://core.telegram.org/method/account.setGlobalPrivacySettings ContactRequirePremium bool - // BotBusiness field of User. + // Whether this bot can be connected to a user as specified here »¹. + // + // Links: + // 1) https://core.telegram.org/api/business#connected-bots BotBusiness bool - // BotHasMainApp field of User. + // If set, this bot has configured a Main Mini App »¹. + // + // Links: + // 1) https://core.telegram.org/api/bots/webapps#main-mini-apps BotHasMainApp bool - // ID of the user + // ID of the user, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/peers#peer-id ID int64 - // Access hash of the user + // Access hash of the user, see here »¹ for more info. If this flag is set, when + // updating the local peer database², generate a virtual flag called min_access_hash, + // which is: - Set to true if min is set AND - The phone flag is not set OR - The phone + // flag is set and the associated phone number string is non-empty - Set to false + // otherwise. Then, apply both access_hash and min_access_hash to the local database if: + // - min_access_hash is false OR - min_access_hash is true AND - There is no locally + // cached object for this user OR - There is no access_hash in the local cache OR - The + // cached object's min_access_hash is also true If the final merged object stored to the + // database has the min_access_hash field set to true, the related access_hash is only + // suitable to use in inputPeerPhotoFileLocation »³, to directly download the profile + // pictures⁴ of users, everywhere else a inputPeer*FromMessage constructor will have to + // be generated as specified here »⁵. Bots can also use min access hashes in some + // conditions, by passing 0 instead of the min access hash. + // + // Links: + // 1) https://core.telegram.org/api/peers#access-hash + // 2) https://core.telegram.org/api/peers + // 3) https://core.telegram.org/constructor/inputPeerPhotoFileLocation + // 4) https://core.telegram.org/api/files + // 5) https://core.telegram.org/api/min // // Use SetAccessHash and GetAccessHash helpers. AccessHash int64 - // First name + // First name. When updating the local peer database¹, apply changes to this field only + // if: - The min flag is not set OR - The min flag is set AND - The min flag of the + // locally cached user entry is set. + // + // Links: + // 1) https://core.telegram.org/api/peers // // Use SetFirstName and GetFirstName helpers. FirstName string - // Last name + // Last name. When updating the local peer database¹, apply changes to this field only + // if: - The min flag is not set OR - The min flag is set AND - The min flag of the + // locally cached user entry is set. + // + // Links: + // 1) https://core.telegram.org/api/peers // // Use SetLastName and GetLastName helpers. LastName string - // Username + // Main active username. When updating the local peer database¹, apply changes to this + // field only if: - The min flag is not set OR - The min flag is set AND - The min flag + // of the locally cached user entry is set. Changes to this flag should invalidate the + // local userFull² cache for this user ID if the above conditions are respected and the + // bot_can_edit flag is also set. + // + // Links: + // 1) https://core.telegram.org/api/peers + // 2) https://core.telegram.org/constructor/userFull // // Use SetUsername and GetUsername helpers. Username string - // Phone number + // Phone number. When updating the local peer database¹, apply changes to this field + // only if: - The min flag is not set OR - The min flag is set AND - The min flag of the + // locally cached user entry is set. + // + // Links: + // 1) https://core.telegram.org/api/peers // // Use SetPhone and GetPhone helpers. Phone string - // Profile picture of user + // Profile picture of user. When updating the local peer database¹, apply changes to + // this field only if: - The min flag is not set OR - The min flag is set AND - The + // apply_min_photo flag is set OR - The min flag of the locally cached user entry is set. + // + // Links: + // 1) https://core.telegram.org/api/peers // // Use SetPhoto and GetPhoto helpers. Photo UserProfilePhotoClass - // Online status of user + // Online status of user. When updating the local peer database¹, apply changes to this + // field only if: - The min flag is not set OR - The min flag is set AND - The min flag + // of the locally cached user entry is set OR - The locally cached user entry is equal to + // userStatusEmpty². + // + // Links: + // 1) https://core.telegram.org/api/peers + // 2) https://core.telegram.org/constructor/userStatusEmpty // // Use SetStatus and GetStatus helpers. Status UserStatusClass - // Version of the bot_info field in userFull¹, incremented every time it changes + // Version of the bot_info field in userFull¹, incremented every time it changes. + // Changes to this flag should invalidate the local userFull² cache for this user ID, + // see here »³ for more info. // // Links: // 1) https://core.telegram.org/constructor/userFull + // 2) https://core.telegram.org/constructor/userFull + // 3) https://core.telegram.org/api/peers#full-info-database // // Use SetBotInfoVersion and GetBotInfoVersion helpers. BotInfoVersion int @@ -304,14 +444,23 @@ type User struct { // // Use SetEmojiStatus and GetEmojiStatus helpers. EmojiStatus EmojiStatusClass - // Additional usernames + // Additional usernames. When updating the local peer database¹, apply changes to this + // field only if: - The min flag is not set OR - The min flag is set AND - The min flag + // of the locally cached user entry is set. Changes to this flag (if the above conditions + // are respected) should invalidate the local userFull² cache for this user ID. + // + // Links: + // 1) https://core.telegram.org/api/peers + // 2) https://core.telegram.org/constructor/userFull // // Use SetUsernames and GetUsernames helpers. Usernames []Username - // ID of the maximum read story¹. + // ID of the maximum read story¹. When updating the local peer database², do not apply + // changes to this field if the min flag of the incoming constructor is set. // // Links: // 1) https://core.telegram.org/api/stories + // 2) https://core.telegram.org/api/peers // // Use SetStoriesMaxID and GetStoriesMaxID helpers. StoriesMaxID int @@ -329,7 +478,7 @@ type User struct { // // Use SetProfileColor and GetProfileColor helpers. ProfileColor PeerColor - // BotActiveUsers field of User. + // Monthly Active Users (MAU) of this bot (may be absent for small bots). // // Use SetBotActiveUsers and GetBotActiveUsers helpers. BotActiveUsers int diff --git a/tg/tl_user_status_gen.go b/tg/tl_user_status_gen.go index c48cb1ae17..18824102fa 100644 --- a/tg/tl_user_status_gen.go +++ b/tg/tl_user_status_gen.go @@ -408,9 +408,18 @@ func (u *UserStatusOffline) GetWasOnline() (value int) { // // See https://core.telegram.org/constructor/userStatusRecently for reference. type UserStatusRecently struct { - // Flags field of UserStatusRecently. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ByMe field of UserStatusRecently. + // If set, the exact user status of this user is actually available to us, but to view it + // we must first purchase a Premium¹ subscription, or allow this user to see our exact + // last online status. See here »² for more info. + // + // Links: + // 1) https://core.telegram.org/api/premium + // 2) https://core.telegram.org/constructor/privacyKeyStatusTimestamp ByMe bool } @@ -569,9 +578,18 @@ func (u *UserStatusRecently) GetByMe() (value bool) { // // See https://core.telegram.org/constructor/userStatusLastWeek for reference. type UserStatusLastWeek struct { - // Flags field of UserStatusLastWeek. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ByMe field of UserStatusLastWeek. + // If set, the exact user status of this user is actually available to us, but to view it + // we must first purchase a Premium¹ subscription, or allow this user to see our exact + // last online status. See here »² for more info. + // + // Links: + // 1) https://core.telegram.org/api/premium + // 2) https://core.telegram.org/constructor/privacyKeyStatusTimestamp ByMe bool } @@ -730,9 +748,18 @@ func (u *UserStatusLastWeek) GetByMe() (value bool) { // // See https://core.telegram.org/constructor/userStatusLastMonth for reference. type UserStatusLastMonth struct { - // Flags field of UserStatusLastMonth. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ByMe field of UserStatusLastMonth. + // If set, the exact user status of this user is actually available to us, but to view it + // we must first purchase a Premium¹ subscription, or allow this user to see our exact + // last online status. See here »² for more info. + // + // Links: + // 1) https://core.telegram.org/api/premium + // 2) https://core.telegram.org/constructor/privacyKeyStatusTimestamp ByMe bool } diff --git a/tg/tl_users_get_is_premium_required_to_contact_gen.go b/tg/tl_users_get_is_premium_required_to_contact_gen.go index 620701fd15..a1970abfad 100644 --- a/tg/tl_users_get_is_premium_required_to_contact_gen.go +++ b/tg/tl_users_get_is_premium_required_to_contact_gen.go @@ -32,10 +32,16 @@ var ( ) // UsersGetIsPremiumRequiredToContactRequest represents TL type `users.getIsPremiumRequiredToContact#a622aa10`. +// Check whether we can write to the specified user (this method can only be called by +// non-Premium¹ users), see here »² for more info on the full flow. +// +// Links: +// 1. https://core.telegram.org/api/premium +// 2. https://core.telegram.org/api/privacy#require-premium-for-new-non-contact-users // // See https://core.telegram.org/method/users.getIsPremiumRequiredToContact for reference. type UsersGetIsPremiumRequiredToContactRequest struct { - // ID field of UsersGetIsPremiumRequiredToContactRequest. + // Users to fetch info about. ID []InputUserClass } @@ -184,6 +190,12 @@ func (g *UsersGetIsPremiumRequiredToContactRequest) MapID() (value InputUserClas } // UsersGetIsPremiumRequiredToContact invokes method users.getIsPremiumRequiredToContact#a622aa10 returning error if any. +// Check whether we can write to the specified user (this method can only be called by +// non-Premium¹ users), see here »² for more info on the full flow. +// +// Links: +// 1. https://core.telegram.org/api/premium +// 2. https://core.telegram.org/api/privacy#require-premium-for-new-non-contact-users // // See https://core.telegram.org/method/users.getIsPremiumRequiredToContact for reference. func (c *Client) UsersGetIsPremiumRequiredToContact(ctx context.Context, id []InputUserClass) ([]bool, error) { diff --git a/tg/tl_users_get_users_gen.go b/tg/tl_users_get_users_gen.go index 4879d722ec..c03f76c5c9 100644 --- a/tg/tl_users_get_users_gen.go +++ b/tg/tl_users_get_users_gen.go @@ -193,6 +193,7 @@ func (g *UsersGetUsersRequest) MapID() (value InputUserClassArray) { // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 FROM_MESSAGE_BOT_DISABLED: Bots can't use fromMessage min constructors. // 400 MSG_ID_INVALID: Invalid message ID provided. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. // // See https://core.telegram.org/method/users.getUsers for reference. diff --git a/tg/tl_web_page_attribute_gen.go b/tg/tl_web_page_attribute_gen.go index 7ecee2a30c..3117e63956 100644 --- a/tg/tl_web_page_attribute_gen.go +++ b/tg/tl_web_page_attribute_gen.go @@ -531,16 +531,32 @@ func (w *WebPageAttributeStory) GetStory() (value StoryItemClass, ok bool) { } // WebPageAttributeStickerSet represents TL type `webPageAttributeStickerSet#50cc03d3`. +// Contains info about a stickerset »¹, for a webPage² preview of a stickerset deep +// link »³ (the webPage⁴ will have a type of telegram_stickerset). +// +// Links: +// 1. https://core.telegram.org/api/stickers +// 2. https://core.telegram.org/constructor/webPage +// 3. https://core.telegram.org/api/links#stickerset-links +// 4. https://core.telegram.org/constructor/webPage // // See https://core.telegram.org/constructor/webPageAttributeStickerSet for reference. type WebPageAttributeStickerSet struct { - // Flags field of WebPageAttributeStickerSet. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Emojis field of WebPageAttributeStickerSet. + // Whether this i s a custom emoji stickerset¹. + // + // Links: + // 1) https://core.telegram.org/api/custom-emoji Emojis bool - // TextColor field of WebPageAttributeStickerSet. + // Whether the color of this TGS custom emoji stickerset should be changed to the text + // color when used in messages, the accent color if used as emoji status, white on chat + // photos, or another appropriate color based on context. TextColor bool - // Stickers field of WebPageAttributeStickerSet. + // A subset of the stickerset in the stickerset. Stickers []DocumentClass } diff --git a/tg/tl_web_page_gen.go b/tg/tl_web_page_gen.go index 92bbb3f5ab..59a8163b12 100644 --- a/tg/tl_web_page_gen.go +++ b/tg/tl_web_page_gen.go @@ -484,13 +484,16 @@ type WebPage struct { URL string // Webpage URL to be displayed to the user DisplayURL string - // Hash for pagination, for more info click here¹ + // Hash used for caching, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation Hash int // Type of the web page. Can be: article, photo, audio, video, document, profile, app, or - // something else + // something else, see here »¹ for a full list. + // + // Links: + // 1) https://github.com/telegramdesktop/tdesktop/blob/4f7a124f3e85f3f61d862b94fb5a45236976f38f/Telegram/SourceFiles/data/data_web_page.cpp#L127 // // Use SetType and GetType helpers. Type string diff --git a/tg/tl_web_view_result_url_gen.go b/tg/tl_web_view_result_url_gen.go index a57d82ccca..bc11ea9684 100644 --- a/tg/tl_web_view_result_url_gen.go +++ b/tg/tl_web_view_result_url_gen.go @@ -36,11 +36,20 @@ var ( // // See https://core.telegram.org/constructor/webViewResultUrl for reference. type WebViewResultURL struct { - // Flags field of WebViewResultURL. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Fullsize field of WebViewResultURL. + // If set, the app must be opened in fullsize mode instead of compact mode. Fullsize bool - // Webview session ID + // Webview session ID (only returned by inline button mini apps¹, menu button mini + // apps², attachment menu mini apps³). + // + // Links: + // 1) https://core.telegram.org/api/bots/webapps#inline-button-mini-apps + // 2) https://core.telegram.org/api/bots/webapps#menu-button-mini-apps + // 3) https://core.telegram.org/api/bots/webapps#attachment-menu-mini-apps // // Use SetQueryID and GetQueryID helpers. QueryID int64