From 1033fd793f113b568608aba0ee4d745ba3b0ad3d Mon Sep 17 00:00:00 2001 From: Aleksandr Razumov Date: Fri, 3 Jan 2025 17:27:32 +0300 Subject: [PATCH] feat(docs): update --- go.mod | 2 +- go.sum | 4 +- tg/tl_account_delete_account_gen.go | 1 + tg/tl_account_get_notify_settings_gen.go | 2 + tg/tl_account_get_tmp_password_gen.go | 1 + tg/tl_auth_check_password_gen.go | 1 + tg/tl_auth_send_code_gen.go | 1 + tg/tl_bot_app_settings_gen.go | 22 +- tg/tl_bot_info_gen.go | 5 +- tg/tl_bots_check_download_file_params_gen.go | 31 ++- tg/tl_bots_get_admined_bots_gen.go | 2 + tg/tl_bots_set_bot_info_gen.go | 1 + ...toggle_user_emoji_status_permission_gen.go | 16 +- tg/tl_bots_update_star_ref_program_gen.go | 37 ++- tg/tl_bots_update_user_emoji_status_gen.go | 20 +- tg/tl_channel_admin_log_event_action_gen.go | 4 +- tg/tl_channels_delete_topic_history_gen.go | 1 + tg/tl_channels_edit_photo_gen.go | 1 + tg/tl_channels_invite_to_channel_gen.go | 1 + ...channels_toggle_participants_hidden_gen.go | 1 + tg/tl_chatlists_delete_exported_invite_gen.go | 2 + tg/tl_chatlists_export_chatlist_invite_gen.go | 4 + tg/tl_connected_bot_star_ref_gen.go | 35 ++- tg/tl_contacts_delete_contacts_gen.go | 4 + tg/tl_contacts_resolve_username_gen.go | 10 +- tg/tl_errors_gen.go | 216 ++++++++++++++++++ tg/tl_input_privacy_key_gen.go | 4 + tg/tl_input_privacy_rule_gen.go | 2 + tg/tl_invoice_gen.go | 6 +- tg/tl_message_action_gen.go | 14 +- ...essages_bot_prepared_inline_message_gen.go | 13 +- tg/tl_messages_click_sponsored_message_gen.go | 1 - tg/tl_messages_delete_chat_user_gen.go | 1 + tg/tl_messages_edit_message_gen.go | 2 + tg/tl_messages_export_chat_invite_gen.go | 2 + tg/tl_messages_found_stickers_gen.go | 34 ++- tg/tl_messages_get_dialogs_gen.go | 1 + ..._messages_get_paid_reaction_privacy_gen.go | 1 - tg/tl_messages_get_peer_dialogs_gen.go | 1 + ...essages_get_prepared_inline_message_gen.go | 29 ++- tg/tl_messages_get_sponsored_messages_gen.go | 1 - tg/tl_messages_import_chat_invite_gen.go | 1 + tg/tl_messages_prepared_inline_message_gen.go | 18 +- ...l_messages_report_sponsored_message_gen.go | 1 - tg/tl_messages_request_app_web_view_gen.go | 14 +- tg/tl_messages_request_main_web_view_gen.go | 12 +- tg/tl_messages_request_simple_web_view_gen.go | 2 +- tg/tl_messages_request_web_view_gen.go | 15 +- ...ssages_save_prepared_inline_message_gen.go | 33 ++- tg/tl_messages_search_gen.go | 2 +- tg/tl_messages_search_global_gen.go | 4 +- tg/tl_messages_search_stickers_gen.go | 36 ++- tg/tl_messages_send_bot_requested_peer_gen.go | 1 + tg/tl_messages_send_media_gen.go | 7 + tg/tl_messages_send_message_gen.go | 6 +- tg/tl_messages_send_multi_media_gen.go | 3 + tg/tl_messages_send_paid_reaction_gen.go | 5 +- tg/tl_messages_set_default_history_ttl_gen.go | 2 +- tg/tl_messages_set_inline_bot_results_gen.go | 2 + tg/tl_messages_set_typing_gen.go | 2 + ...ssages_toggle_paid_reaction_privacy_gen.go | 5 +- tg/tl_messages_translate_text_gen.go | 1 + tg/tl_messages_upload_imported_media_gen.go | 1 + tg/tl_messages_upload_media_gen.go | 1 + tg/tl_messages_view_sponsored_message_gen.go | 1 - ...ments_bot_cancel_stars_subscription_gen.go | 34 ++- ..._payments_change_stars_subscription_gen.go | 5 +- tg/tl_payments_connect_star_ref_bot_gen.go | 13 +- tg/tl_payments_connected_star_ref_bots_gen.go | 10 +- tg/tl_payments_convert_star_gift_gen.go | 5 +- ...ayments_edit_connected_star_ref_bot_gen.go | 23 +- tg/tl_payments_export_invoice_gen.go | 3 + ...payments_fulfill_stars_subscription_gen.go | 5 +- ...payments_get_connected_star_ref_bot_gen.go | 16 +- ...ayments_get_connected_star_ref_bots_gen.go | 23 +- tg/tl_payments_get_payment_form_gen.go | 11 +- tg/tl_payments_get_star_gifts_gen.go | 5 +- tg/tl_payments_get_stars_gift_options_gen.go | 5 + ...payments_get_stars_giveaway_options_gen.go | 1 - ...s_get_stars_revenue_ads_account_url_gen.go | 1 + ...ts_get_stars_revenue_withdrawal_url_gen.go | 5 +- tg/tl_payments_get_stars_subscriptions_gen.go | 5 +- ...yments_get_stars_transactions_by_id_gen.go | 1 + ...ayments_get_suggested_star_ref_bots_gen.go | 41 +++- tg/tl_payments_get_user_star_gifts_gen.go | 5 +- tg/tl_payments_save_star_gift_gen.go | 5 +- tg/tl_payments_send_payment_form_gen.go | 1 + tg/tl_payments_send_stars_form_gen.go | 4 + ...yments_stars_revenue_withdrawal_url_gen.go | 4 +- tg/tl_payments_suggested_star_ref_bots_gen.go | 21 +- tg/tl_phone_create_group_call_gen.go | 1 + tg/tl_phone_invite_to_group_call_gen.go | 1 + tg/tl_premium_get_boosts_status_gen.go | 1 + tg/tl_privacy_key_gen.go | 4 + tg/tl_privacy_rule_gen.go | 2 + tg/tl_restriction_reason_gen.go | 12 +- tg/tl_star_gift_gen.go | 2 +- tg/tl_star_ref_program_gen.go | 28 ++- tg/tl_stars_amount_gen.go | 10 +- tg/tl_stars_revenue_status_gen.go | 2 +- tg/tl_stars_subscription_gen.go | 14 +- tg/tl_stars_transaction_gen.go | 20 +- ...l_stats_get_broadcast_revenue_stats_gen.go | 1 + ..._get_broadcast_revenue_transactions_gen.go | 1 + ...et_broadcast_revenue_withdrawal_url_gen.go | 1 + tg/tl_stats_get_story_stats_gen.go | 1 + tg/tl_upload_get_file_gen.go | 1 + tg/tl_upload_save_big_file_part_gen.go | 1 + tg/tl_user_full_gen.go | 10 +- tg/tl_web_page_gen.go | 11 +- tg/tl_web_view_result_url_gen.go | 2 +- 111 files changed, 925 insertions(+), 165 deletions(-) diff --git a/go.mod b/go.mod index 98537a491a..4c72e74736 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/go-faster/xor v1.0.0 github.com/go-openapi/inflect v0.21.0 github.com/google/uuid v1.6.0 - github.com/gotd/getdoc v0.45.0 + github.com/gotd/getdoc v0.46.0 github.com/gotd/ige v0.2.2 github.com/gotd/neo v0.1.5 github.com/gotd/tl v0.4.0 diff --git a/go.sum b/go.sum index af83927101..8e5d3b301e 100644 --- a/go.sum +++ b/go.sum @@ -37,8 +37,8 @@ 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/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gotd/getdoc v0.45.0 h1:TTWG3KghmazcCuO+cD0SeBVabRxJo9RJEvpcXJ/Jd1M= -github.com/gotd/getdoc v0.45.0/go.mod h1:tPqC2xq2IHhcxvmhdRfTA4ZK0YQKtJtbyZgbQcSuAXI= +github.com/gotd/getdoc v0.46.0 h1:HiA3vu5kWzhdhXEcLvQiTg6GYirCUw6y692PryLpzCY= +github.com/gotd/getdoc v0.46.0/go.mod h1:tPqC2xq2IHhcxvmhdRfTA4ZK0YQKtJtbyZgbQcSuAXI= 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_delete_account_gen.go b/tg/tl_account_delete_account_gen.go index e1d109d310..09e32a6747 100644 --- a/tg/tl_account_delete_account_gen.go +++ b/tg/tl_account_delete_account_gen.go @@ -269,6 +269,7 @@ func (d *AccountDeleteAccountRequest) GetPasswordAsNotEmpty() (*InputCheckPasswo // Possible errors: // // 420 2FA_CONFIRM_WAIT_%d: Since this account is active and protected by a 2FA password, we will delete it in 1 week for security purposes. You can cancel this process at any time, you'll be able to reset your account in %d seconds. +// 400 PASSWORD_HASH_INVALID: The provided password hash is invalid. // // See https://core.telegram.org/method/account.deleteAccount for reference. func (c *Client) AccountDeleteAccount(ctx context.Context, request *AccountDeleteAccountRequest) (bool, error) { diff --git a/tg/tl_account_get_notify_settings_gen.go b/tg/tl_account_get_notify_settings_gen.go index 4c6353b1bd..5ff959ad0e 100644 --- a/tg/tl_account_get_notify_settings_gen.go +++ b/tg/tl_account_get_notify_settings_gen.go @@ -171,6 +171,8 @@ func (g *AccountGetNotifySettingsRequest) GetPeer() (value InputNotifyPeerClass) // // 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. // // See https://core.telegram.org/method/account.getNotifySettings for reference. diff --git a/tg/tl_account_get_tmp_password_gen.go b/tg/tl_account_get_tmp_password_gen.go index d10decfaf9..cfb94d1a48 100644 --- a/tg/tl_account_get_tmp_password_gen.go +++ b/tg/tl_account_get_tmp_password_gen.go @@ -205,6 +205,7 @@ func (g *AccountGetTmpPasswordRequest) GetPasswordAsNotEmpty() (*InputCheckPassw // Possible errors: // // 400 PASSWORD_HASH_INVALID: The provided password hash is invalid. +// 400 SRP_A_INVALID: The specified inputCheckPasswordSRP.A value is invalid. // 400 TMP_PASSWORD_DISABLED: The temporary password is disabled. // // See https://core.telegram.org/method/account.getTmpPassword for reference. diff --git a/tg/tl_auth_check_password_gen.go b/tg/tl_auth_check_password_gen.go index d41cb37fc3..c86570dc06 100644 --- a/tg/tl_auth_check_password_gen.go +++ b/tg/tl_auth_check_password_gen.go @@ -185,6 +185,7 @@ func (c *AuthCheckPasswordRequest) GetPasswordAsNotEmpty() (*InputCheckPasswordS // // Possible errors: // +// 500 AUTH_KEY_UNSYNCHRONIZED: Internal error, please repeat the method call. // 400 PASSWORD_HASH_INVALID: The provided password hash is invalid. // 400 SRP_ID_INVALID: Invalid SRP ID provided. // 400 SRP_PASSWORD_CHANGED: Password has changed. diff --git a/tg/tl_auth_send_code_gen.go b/tg/tl_auth_send_code_gen.go index 5e84423c7f..cb0c7bbf24 100644 --- a/tg/tl_auth_send_code_gen.go +++ b/tg/tl_auth_send_code_gen.go @@ -256,6 +256,7 @@ func (s *AuthSendCodeRequest) GetSettings() (value CodeSettings) { // 400 API_ID_INVALID: API ID invalid. // 400 API_ID_PUBLISHED_FLOOD: This API id was published somewhere, you can't use it now. // 500 AUTH_RESTART: Restart the authorization process. +// 500 AUTH_RESTART_%d: Internal error (debug info %d), please repeat the method call. // 400 PHONE_NUMBER_APP_SIGNUP_FORBIDDEN: You can't sign up using this app. // 400 PHONE_NUMBER_BANNED: The provided phone number is banned from telegram. // 400 PHONE_NUMBER_FLOOD: You asked for the code too many times. diff --git a/tg/tl_bot_app_settings_gen.go b/tg/tl_bot_app_settings_gen.go index a103a08aa3..593daf9fe2 100644 --- a/tg/tl_bot_app_settings_gen.go +++ b/tg/tl_bot_app_settings_gen.go @@ -32,28 +32,38 @@ var ( ) // BotAppSettings represents TL type `botAppSettings#c99b1950`. +// Mini app »¹ settings +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps // // See https://core.telegram.org/constructor/botAppSettings for reference. type BotAppSettings struct { - // Flags field of BotAppSettings. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // PlaceholderPath field of BotAppSettings. + // SVG placeholder logo, compressed using the same format used for vector thumbnails »¹. + // + // Links: + // 1) https://core.telegram.org/api/files#vector-thumbnails // // Use SetPlaceholderPath and GetPlaceholderPath helpers. PlaceholderPath []byte - // BackgroundColor field of BotAppSettings. + // Default light mode background color // // Use SetBackgroundColor and GetBackgroundColor helpers. BackgroundColor int - // BackgroundDarkColor field of BotAppSettings. + // Default dark mode background color // // Use SetBackgroundDarkColor and GetBackgroundDarkColor helpers. BackgroundDarkColor int - // HeaderColor field of BotAppSettings. + // Default light mode header color // // Use SetHeaderColor and GetHeaderColor helpers. HeaderColor int - // HeaderDarkColor field of BotAppSettings. + // Default dark mode header color // // Use SetHeaderDarkColor and GetHeaderDarkColor helpers. HeaderDarkColor int diff --git a/tg/tl_bot_info_gen.go b/tg/tl_bot_info_gen.go index b2a32515a1..ac8b66702b 100644 --- a/tg/tl_bot_info_gen.go +++ b/tg/tl_bot_info_gen.go @@ -80,7 +80,10 @@ type BotInfo struct { // // Use SetPrivacyPolicyURL and GetPrivacyPolicyURL helpers. PrivacyPolicyURL string - // AppSettings field of BotInfo. + // Mini app »¹ settings + // + // Links: + // 1) https://core.telegram.org/api/bots/webapps // // Use SetAppSettings and GetAppSettings helpers. AppSettings BotAppSettings diff --git a/tg/tl_bots_check_download_file_params_gen.go b/tg/tl_bots_check_download_file_params_gen.go index f101bbda2d..3bdaef848d 100644 --- a/tg/tl_bots_check_download_file_params_gen.go +++ b/tg/tl_bots_check_download_file_params_gen.go @@ -32,14 +32,29 @@ var ( ) // BotsCheckDownloadFileParamsRequest represents TL type `bots.checkDownloadFileParams#50077589`. +// Check if a mini app¹ can request the download of a specific file: called when +// handling web_app_request_file_download events »² +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps +// 2. https://core.telegram.org/api/web-events#web-app-request-file-download // // See https://core.telegram.org/method/bots.checkDownloadFileParams for reference. type BotsCheckDownloadFileParamsRequest struct { - // Bot field of BotsCheckDownloadFileParamsRequest. + // The bot that owns the mini app¹ that requested the download + // + // Links: + // 1) https://core.telegram.org/api/bots/webapps Bot InputUserClass - // FileName field of BotsCheckDownloadFileParamsRequest. + // The filename from the web_app_request_file_download event »¹ + // + // Links: + // 1) https://core.telegram.org/api/web-events#web-app-request-file-download FileName string - // URL field of BotsCheckDownloadFileParamsRequest. + // The url from the web_app_request_file_download event »¹ + // + // Links: + // 1) https://core.telegram.org/api/web-events#web-app-request-file-download URL string } @@ -220,6 +235,16 @@ func (c *BotsCheckDownloadFileParamsRequest) GetURL() (value string) { } // BotsCheckDownloadFileParams invokes method bots.checkDownloadFileParams#50077589 returning error if any. +// Check if a mini app¹ can request the download of a specific file: called when +// handling web_app_request_file_download events »² +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps +// 2. https://core.telegram.org/api/web-events#web-app-request-file-download +// +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. // // See https://core.telegram.org/method/bots.checkDownloadFileParams for reference. func (c *Client) BotsCheckDownloadFileParams(ctx context.Context, request *BotsCheckDownloadFileParamsRequest) (bool, error) { diff --git a/tg/tl_bots_get_admined_bots_gen.go b/tg/tl_bots_get_admined_bots_gen.go index 4e412d882d..761738155c 100644 --- a/tg/tl_bots_get_admined_bots_gen.go +++ b/tg/tl_bots_get_admined_bots_gen.go @@ -32,6 +32,7 @@ var ( ) // BotsGetAdminedBotsRequest represents TL type `bots.getAdminedBots#b0711d83`. +// Get a list of bots owned by the current user // // See https://core.telegram.org/method/bots.getAdminedBots for reference. type BotsGetAdminedBotsRequest struct { @@ -128,6 +129,7 @@ func (g *BotsGetAdminedBotsRequest) DecodeBare(b *bin.Buffer) error { } // BotsGetAdminedBots invokes method bots.getAdminedBots#b0711d83 returning error if any. +// Get a list of bots owned by the current user // // See https://core.telegram.org/method/bots.getAdminedBots for reference. func (c *Client) BotsGetAdminedBots(ctx context.Context) ([]UserClass, error) { diff --git a/tg/tl_bots_set_bot_info_gen.go b/tg/tl_bots_set_bot_info_gen.go index cc0b467256..c1b6f63c0a 100644 --- a/tg/tl_bots_set_bot_info_gen.go +++ b/tg/tl_bots_set_bot_info_gen.go @@ -386,6 +386,7 @@ func (s *BotsSetBotInfoRequest) GetDescription() (value string, ok bool) { // // Possible errors: // +// 400 BOT_INVALID: This is not a valid bot. // 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. // // See https://core.telegram.org/method/bots.setBotInfo for reference. diff --git a/tg/tl_bots_toggle_user_emoji_status_permission_gen.go b/tg/tl_bots_toggle_user_emoji_status_permission_gen.go index fab1081e0b..d515d4904d 100644 --- a/tg/tl_bots_toggle_user_emoji_status_permission_gen.go +++ b/tg/tl_bots_toggle_user_emoji_status_permission_gen.go @@ -32,12 +32,16 @@ var ( ) // BotsToggleUserEmojiStatusPermissionRequest represents TL type `bots.toggleUserEmojiStatusPermission#6de6392`. +// Allow or prevent a bot from changing our emoji status »¹ +// +// Links: +// 1. https://core.telegram.org/api/emoji-status#setting-an-emoji-status-from-a-bot // // See https://core.telegram.org/method/bots.toggleUserEmojiStatusPermission for reference. type BotsToggleUserEmojiStatusPermissionRequest struct { - // Bot field of BotsToggleUserEmojiStatusPermissionRequest. + // The bot Bot InputUserClass - // Enabled field of BotsToggleUserEmojiStatusPermissionRequest. + // Whether to allow or prevent the bot from changing our emoji status Enabled bool } @@ -193,6 +197,14 @@ func (t *BotsToggleUserEmojiStatusPermissionRequest) GetEnabled() (value bool) { } // BotsToggleUserEmojiStatusPermission invokes method bots.toggleUserEmojiStatusPermission#6de6392 returning error if any. +// Allow or prevent a bot from changing our emoji status »¹ +// +// Links: +// 1. https://core.telegram.org/api/emoji-status#setting-an-emoji-status-from-a-bot +// +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. // // See https://core.telegram.org/method/bots.toggleUserEmojiStatusPermission for reference. func (c *Client) BotsToggleUserEmojiStatusPermission(ctx context.Context, request *BotsToggleUserEmojiStatusPermissionRequest) (bool, error) { diff --git a/tg/tl_bots_update_star_ref_program_gen.go b/tg/tl_bots_update_star_ref_program_gen.go index c0635d2ad5..b48db43f61 100644 --- a/tg/tl_bots_update_star_ref_program_gen.go +++ b/tg/tl_bots_update_star_ref_program_gen.go @@ -32,16 +32,34 @@ var ( ) // BotsUpdateStarRefProgramRequest represents TL type `bots.updateStarRefProgram#778b5ab3`. +// Create, edit or delete the affiliate program¹ of a bot we own +// +// Links: +// 1. https://core.telegram.org/api/bots/referrals // // See https://core.telegram.org/method/bots.updateStarRefProgram for reference. type BotsUpdateStarRefProgramRequest struct { - // Flags field of BotsUpdateStarRefProgramRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Bot field of BotsUpdateStarRefProgramRequest. + // The bot Bot InputUserClass - // CommissionPermille field of BotsUpdateStarRefProgramRequest. + // The permille commission rate: it indicates the share of Telegram Stars received by + // affiliates for every transaction made by users they referred inside of the bot. The + // minimum and maximum values for this parameter are contained in the + // starref_min_commission_permille¹ and starref_max_commission_permille² client + // configuration parameters. Can be 0 to terminate the affiliate program. Both the + // duration and the commission may only be raised after creation of the program: to lower + // them, the program must first be terminated and a new one created. + // + // Links: + // 1) https://core.telegram.org/api/config#starref-min-commission-permille + // 2) https://core.telegram.org/api/config#starref-max-commission-permille CommissionPermille int - // DurationMonths field of BotsUpdateStarRefProgramRequest. + // Indicates the duration of the affiliate program; if not set, there is no expiration + // date. // // Use SetDurationMonths and GetDurationMonths helpers. DurationMonths int @@ -259,6 +277,17 @@ func (u *BotsUpdateStarRefProgramRequest) GetDurationMonths() (value int, ok boo } // BotsUpdateStarRefProgram invokes method bots.updateStarRefProgram#778b5ab3 returning error if any. +// Create, edit or delete the affiliate program¹ of a bot we own +// +// Links: +// 1. https://core.telegram.org/api/bots/referrals +// +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. +// 400 STARREF_AWAITING_END: The previous referral program was terminated less than 24 hours ago: further changes can be made after the date specified in userFull.starref_program.end_date. +// 400 STARREF_PERMILLE_INVALID: The specified commission_permille is invalid: the minimum and maximum values for this parameter are contained in the starref_min_commission_permille and starref_max_commission_permille client configuration parameters. +// 400 STARREF_PERMILLE_TOO_LOW: The specified commission_permille is too low: the minimum and maximum values for this parameter are contained in the starref_min_commission_permille and starref_max_commission_permille client configuration parameters. // // See https://core.telegram.org/method/bots.updateStarRefProgram for reference. func (c *Client) BotsUpdateStarRefProgram(ctx context.Context, request *BotsUpdateStarRefProgramRequest) (*StarRefProgram, error) { diff --git a/tg/tl_bots_update_user_emoji_status_gen.go b/tg/tl_bots_update_user_emoji_status_gen.go index 8169f1578d..6992925daf 100644 --- a/tg/tl_bots_update_user_emoji_status_gen.go +++ b/tg/tl_bots_update_user_emoji_status_gen.go @@ -32,12 +32,17 @@ var ( ) // BotsUpdateUserEmojiStatusRequest represents TL type `bots.updateUserEmojiStatus#ed9f30c5`. +// Change the emoji status of a user (invoked by bots, see here »¹ for more info on the +// full flow) +// +// Links: +// 1. https://core.telegram.org/api/emoji-status#setting-an-emoji-status-from-a-bot // // See https://core.telegram.org/method/bots.updateUserEmojiStatus for reference. type BotsUpdateUserEmojiStatusRequest struct { - // UserID field of BotsUpdateUserEmojiStatusRequest. + // The user whose emoji status should be changed UserID InputUserClass - // EmojiStatus field of BotsUpdateUserEmojiStatusRequest. + // The emoji status EmojiStatus EmojiStatusClass } @@ -203,8 +208,19 @@ func (u *BotsUpdateUserEmojiStatusRequest) GetEmojiStatusAsNotEmpty() (NotEmptyE } // BotsUpdateUserEmojiStatus invokes method bots.updateUserEmojiStatus#ed9f30c5 returning error if any. +// Change the emoji status of a user (invoked by bots, see here »¹ for more info on the +// full flow) +// +// Links: +// 1. https://core.telegram.org/api/emoji-status#setting-an-emoji-status-from-a-bot +// +// Possible errors: +// +// 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/bots.updateUserEmojiStatus for reference. +// Can be used by bots. func (c *Client) BotsUpdateUserEmojiStatus(ctx context.Context, request *BotsUpdateUserEmojiStatusRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_channel_admin_log_event_action_gen.go b/tg/tl_channel_admin_log_event_action_gen.go index f986852a27..c9a59d3357 100644 --- a/tg/tl_channel_admin_log_event_action_gen.go +++ b/tg/tl_channel_admin_log_event_action_gen.go @@ -7717,9 +7717,9 @@ func (c *ChannelAdminLogEventActionToggleSignatureProfiles) GetNewValue() (value // // See https://core.telegram.org/constructor/channelAdminLogEventActionParticipantSubExtend for reference. type ChannelAdminLogEventActionParticipantSubExtend struct { - // PrevParticipant field of ChannelAdminLogEventActionParticipantSubExtend. + // Same as new_participant. PrevParticipant ChannelParticipantClass - // NewParticipant field of ChannelAdminLogEventActionParticipantSubExtend. + // The subscriber that extended the subscription. NewParticipant ChannelParticipantClass } diff --git a/tg/tl_channels_delete_topic_history_gen.go b/tg/tl_channels_delete_topic_history_gen.go index 2f3326912a..f29bc573a1 100644 --- a/tg/tl_channels_delete_topic_history_gen.go +++ b/tg/tl_channels_delete_topic_history_gen.go @@ -209,6 +209,7 @@ func (d *ChannelsDeleteTopicHistoryRequest) GetChannelAsNotEmpty() (NotEmptyInpu // // Possible errors: // +// 400 CHANNEL_FORUM_MISSING: This supergroup is not a forum. // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 TOPIC_ID_INVALID: The specified topic ID is invalid. // diff --git a/tg/tl_channels_edit_photo_gen.go b/tg/tl_channels_edit_photo_gen.go index bd79eab09a..e8872555f7 100644 --- a/tg/tl_channels_edit_photo_gen.go +++ b/tg/tl_channels_edit_photo_gen.go @@ -224,6 +224,7 @@ func (e *ChannelsEditPhotoRequest) GetChannelAsNotEmpty() (NotEmptyInputChannel, // 400 IMAGE_PROCESS_FAILED: Failure while processing image. // 400 PHOTO_CROP_SIZE_SMALL: Photo is too small. // 400 PHOTO_EXT_INVALID: The extension of the photo is invalid. +// 400 PHOTO_FILE_MISSING: Profile photo file missing. // 400 PHOTO_INVALID: Photo invalid. // 400 STICKER_MIME_INVALID: The specified sticker MIME type is invalid. // diff --git a/tg/tl_channels_invite_to_channel_gen.go b/tg/tl_channels_invite_to_channel_gen.go index 17b3702e8a..690cb15fba 100644 --- a/tg/tl_channels_invite_to_channel_gen.go +++ b/tg/tl_channels_invite_to_channel_gen.go @@ -232,6 +232,7 @@ func (i *ChannelsInviteToChannelRequest) MapUsers() (value InputUserClassArray) // 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_INVALID: Invalid chat. +// 400 CHAT_MEMBER_ADD_FAILED: Could not add participants. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 MSG_ID_INVALID: Invalid message ID provided. diff --git a/tg/tl_channels_toggle_participants_hidden_gen.go b/tg/tl_channels_toggle_participants_hidden_gen.go index 9175bf61e2..f816fbba1e 100644 --- a/tg/tl_channels_toggle_participants_hidden_gen.go +++ b/tg/tl_channels_toggle_participants_hidden_gen.go @@ -216,6 +216,7 @@ func (t *ChannelsToggleParticipantsHiddenRequest) GetChannelAsNotEmpty() (NotEmp // 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_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. diff --git a/tg/tl_chatlists_delete_exported_invite_gen.go b/tg/tl_chatlists_delete_exported_invite_gen.go index a68238b9c4..eed9de8e5d 100644 --- a/tg/tl_chatlists_delete_exported_invite_gen.go +++ b/tg/tl_chatlists_delete_exported_invite_gen.go @@ -204,6 +204,8 @@ func (d *ChatlistsDeleteExportedInviteRequest) GetSlug() (value string) { // // 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_EXPIRED: The specified chat folder link has expired. +// 400 INVITE_SLUG_INVALID: The specified invitation slug is invalid. // // See https://core.telegram.org/method/chatlists.deleteExportedInvite for reference. func (c *Client) ChatlistsDeleteExportedInvite(ctx context.Context, request *ChatlistsDeleteExportedInviteRequest) (bool, error) { diff --git a/tg/tl_chatlists_export_chatlist_invite_gen.go b/tg/tl_chatlists_export_chatlist_invite_gen.go index 050e3aa194..00ee65dfd2 100644 --- a/tg/tl_chatlists_export_chatlist_invite_gen.go +++ b/tg/tl_chatlists_export_chatlist_invite_gen.go @@ -255,6 +255,10 @@ func (e *ChatlistsExportChatlistInviteRequest) MapPeers() (value InputPeerClassA // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. +// 400 CHATLISTS_TOO_MUCH: You have created too many folder links, hitting the chatlist_invites_limit_default/chatlist_invites_limit_premium limits ». +// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 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. diff --git a/tg/tl_connected_bot_star_ref_gen.go b/tg/tl_connected_bot_star_ref_gen.go index f805be592e..825902637a 100644 --- a/tg/tl_connected_bot_star_ref_gen.go +++ b/tg/tl_connected_bot_star_ref_gen.go @@ -32,28 +32,45 @@ var ( ) // ConnectedBotStarRef represents TL type `connectedBotStarRef#19a13f71`. +// Info about an active affiliate program we have with a Mini App¹ +// +// Links: +// 1. https://core.telegram.org/api/bots/referrals#becoming-an-affiliate // // See https://core.telegram.org/constructor/connectedBotStarRef for reference. type ConnectedBotStarRef struct { - // Flags field of ConnectedBotStarRef. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Revoked field of ConnectedBotStarRef. + // If set, this affiliation was revoked by the affiliate using payments + // editConnectedStarRefBot¹, or by the affiliation program owner using bots + // updateStarRefProgram² + // + // Links: + // 1) https://core.telegram.org/method/payments.editConnectedStarRefBot + // 2) https://core.telegram.org/method/bots.updateStarRefProgram Revoked bool - // URL field of ConnectedBotStarRef. + // Referral link¹ to be shared + // + // Links: + // 1) https://core.telegram.org/api/links#referral-links URL string - // Date field of ConnectedBotStarRef. + // When did we affiliate with bot_id Date int - // BotID field of ConnectedBotStarRef. + // ID of the mini app that created the affiliate program BotID int64 - // CommissionPermille field of ConnectedBotStarRef. + // The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars + // received by bot_id CommissionPermille int - // DurationMonths field of ConnectedBotStarRef. + // Number of months the program will be active; if not set, there is no expiration date. // // Use SetDurationMonths and GetDurationMonths helpers. DurationMonths int - // Participants field of ConnectedBotStarRef. + // The number of users that used the affiliate program Participants int64 - // Revenue field of ConnectedBotStarRef. + // The number of Telegram Stars that were earned by the affiliate program Revenue int64 } diff --git a/tg/tl_contacts_delete_contacts_gen.go b/tg/tl_contacts_delete_contacts_gen.go index 82cb66f269..ccd0c0cd66 100644 --- a/tg/tl_contacts_delete_contacts_gen.go +++ b/tg/tl_contacts_delete_contacts_gen.go @@ -187,6 +187,10 @@ func (d *ContactsDeleteContactsRequest) MapID() (value InputUserClassArray) { // ContactsDeleteContacts invokes method contacts.deleteContacts#96a0e00 returning error if any. // Deletes several contacts from the list. // +// Possible errors: +// +// 400 MSG_ID_INVALID: Invalid message ID provided. +// // See https://core.telegram.org/method/contacts.deleteContacts for reference. func (c *Client) ContactsDeleteContacts(ctx context.Context, id []InputUserClass) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_contacts_resolve_username_gen.go b/tg/tl_contacts_resolve_username_gen.go index 94db7241ca..6d28cee0af 100644 --- a/tg/tl_contacts_resolve_username_gen.go +++ b/tg/tl_contacts_resolve_username_gen.go @@ -36,11 +36,17 @@ var ( // // See https://core.telegram.org/method/contacts.resolveUsername for reference. type ContactsResolveUsernameRequest struct { - // Flags field of ContactsResolveUsernameRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // @username to resolve Username string - // Referer field of ContactsResolveUsernameRequest. + // Referrer ID from referral links »¹. + // + // Links: + // 1) https://core.telegram.org/api/links#referral-links // // Use SetReferer and GetReferer helpers. Referer string diff --git a/tg/tl_errors_gen.go b/tg/tl_errors_gen.go index 7fa395e316..a2b6c49667 100644 --- a/tg/tl_errors_gen.go +++ b/tg/tl_errors_gen.go @@ -51,6 +51,7 @@ const ( ErrAudioContentURLEmpty = "AUDIO_CONTENT_URL_EMPTY" ErrAudioTitleEmpty = "AUDIO_TITLE_EMPTY" ErrAuthBytesInvalid = "AUTH_BYTES_INVALID" + ErrAuthKeyUnsynchronized = "AUTH_KEY_UNSYNCHRONIZED" ErrAuthRestart = "AUTH_RESTART" ErrAuthTokenAlreadyAccepted = "AUTH_TOKEN_ALREADY_ACCEPTED" ErrAuthTokenException = "AUTH_TOKEN_EXCEPTION" @@ -79,6 +80,7 @@ const ( ErrBotGroupsBlocked = "BOT_GROUPS_BLOCKED" ErrBotInlineDisabled = "BOT_INLINE_DISABLED" ErrBotInvalid = "BOT_INVALID" + ErrBotInvoiceInvalid = "BOT_INVOICE_INVALID" ErrBotNotConnectedYet = "BOT_NOT_CONNECTED_YET" ErrBotOnesideNotAvail = "BOT_ONESIDE_NOT_AVAIL" ErrBotPaymentsDisabled = "BOT_PAYMENTS_DISABLED" @@ -91,10 +93,13 @@ const ( ErrBroadcastRequired = "BROADCAST_REQUIRED" ErrBusinessAddressActive = "BUSINESS_ADDRESS_ACTIVE" ErrBusinessPeerInvalid = "BUSINESS_PEER_INVALID" + ErrBusinessPeerUsageMissing = "BUSINESS_PEER_USAGE_MISSING" ErrBusinessRecipientsEmpty = "BUSINESS_RECIPIENTS_EMPTY" ErrBusinessWorkHoursEmpty = "BUSINESS_WORK_HOURS_EMPTY" ErrBusinessWorkHoursPeriodInvalid = "BUSINESS_WORK_HOURS_PERIOD_INVALID" + ErrButtonCopyTextInvalid = "BUTTON_COPY_TEXT_INVALID" ErrButtonDataInvalid = "BUTTON_DATA_INVALID" + ErrButtonIDInvalid = "BUTTON_ID_INVALID" ErrButtonPosInvalid = "BUTTON_POS_INVALID" ErrButtonTextInvalid = "BUTTON_TEXT_INVALID" ErrButtonTypeInvalid = "BUTTON_TYPE_INVALID" @@ -124,6 +129,7 @@ const ( ErrChatlinksTooMuch = "CHATLINKS_TOO_MUCH" ErrChatlinkSlugEmpty = "CHATLINK_SLUG_EMPTY" ErrChatlinkSlugExpired = "CHATLINK_SLUG_EXPIRED" + ErrChatlistsTooMuch = "CHATLISTS_TOO_MUCH" ErrChatlistExcludeInvalid = "CHATLIST_EXCLUDE_INVALID" ErrChatAboutNotModified = "CHAT_ABOUT_NOT_MODIFIED" ErrChatAboutTooLong = "CHAT_ABOUT_TOO_LONG" @@ -139,6 +145,7 @@ const ( ErrChatInvalid = "CHAT_INVALID" ErrChatInvitePermanent = "CHAT_INVITE_PERMANENT" ErrChatLinkExists = "CHAT_LINK_EXISTS" + ErrChatMemberAddFailed = "CHAT_MEMBER_ADD_FAILED" ErrChatNotModified = "CHAT_NOT_MODIFIED" ErrChatPublicRequired = "CHAT_PUBLIC_REQUIRED" ErrChatRestricted = "CHAT_RESTRICTED" @@ -158,6 +165,7 @@ const ( ErrChatSendVoicesForbidden = "CHAT_SEND_VOICES_FORBIDDEN" ErrChatTitleEmpty = "CHAT_TITLE_EMPTY" ErrChatTooBig = "CHAT_TOO_BIG" + ErrChatTypeInvalid = "CHAT_TYPE_INVALID" ErrChatWriteForbidden = "CHAT_WRITE_FORBIDDEN" ErrCodeEmpty = "CODE_EMPTY" ErrCodeHashInvalid = "CODE_HASH_INVALID" @@ -207,6 +215,7 @@ const ( ErrEntityMentionUserInvalid = "ENTITY_MENTION_USER_INVALID" ErrErrorTextEmpty = "ERROR_TEXT_EMPTY" ErrExpireDateInvalid = "EXPIRE_DATE_INVALID" + ErrExtendedMediaAmountInvalid = "EXTENDED_MEDIA_AMOUNT_INVALID" ErrExternalURLInvalid = "EXTERNAL_URL_INVALID" ErrFilerefUpgradeNeeded = "FILEREF_UPGRADE_NEEDED" ErrFileContentTypeInvalid = "FILE_CONTENT_TYPE_INVALID" @@ -219,6 +228,7 @@ const ( ErrFilePartSizeChanged = "FILE_PART_SIZE_CHANGED" ErrFilePartSizeInvalid = "FILE_PART_SIZE_INVALID" ErrFilePartTooBig = "FILE_PART_TOO_BIG" + ErrFilePartTooSmall = "FILE_PART_TOO_SMALL" ErrFileReferenceEmpty = "FILE_REFERENCE_EMPTY" ErrFileReferenceExpired = "FILE_REFERENCE_EXPIRED" ErrFileReferenceInvalid = "FILE_REFERENCE_INVALID" @@ -232,6 +242,8 @@ const ( ErrFloodPremiumWait = "FLOOD_PREMIUM_WAIT" ErrFolderIDInvalid = "FOLDER_ID_INVALID" ErrFormExpired = "FORM_EXPIRED" + ErrFormIDEmpty = "FORM_ID_EMPTY" + ErrFormUnsupported = "FORM_UNSUPPORTED" ErrForumEnabled = "FORUM_ENABLED" ErrFreshChangeAdminsForbidden = "FRESH_CHANGE_ADMINS_FORBIDDEN" ErrFreshChangePhoneForbidden = "FRESH_CHANGE_PHONE_FORBIDDEN" @@ -259,6 +271,8 @@ const ( ErrHashtagInvalid = "HASHTAG_INVALID" ErrHashInvalid = "HASH_INVALID" ErrHideRequesterMissing = "HIDE_REQUESTER_MISSING" + ErrIDExpired = "ID_EXPIRED" + ErrIDInvalid = "ID_INVALID" ErrImageProcessFailed = "IMAGE_PROCESS_FAILED" ErrImportFileInvalid = "IMPORT_FILE_INVALID" ErrImportFormatDateInvalid = "IMPORT_FORMAT_DATE_INVALID" @@ -270,6 +284,7 @@ const ( ErrInputChatlistInvalid = "INPUT_CHATLIST_INVALID" ErrInputFileInvalid = "INPUT_FILE_INVALID" ErrInputFilterInvalid = "INPUT_FILTER_INVALID" + ErrInputPeersEmpty = "INPUT_PEERS_EMPTY" ErrInputTextEmpty = "INPUT_TEXT_EMPTY" ErrInputTextTooLong = "INPUT_TEXT_TOO_LONG" ErrInputUserDeactivated = "INPUT_USER_DEACTIVATED" @@ -282,6 +297,7 @@ const ( ErrInviteRevokedMissing = "INVITE_REVOKED_MISSING" ErrInviteSlugEmpty = "INVITE_SLUG_EMPTY" ErrInviteSlugExpired = "INVITE_SLUG_EXPIRED" + ErrInviteSlugInvalid = "INVITE_SLUG_INVALID" ErrInvoicePayloadInvalid = "INVOICE_PAYLOAD_INVALID" ErrJoinAsPeerInvalid = "JOIN_AS_PEER_INVALID" ErrLanguageInvalid = "LANGUAGE_INVALID" @@ -358,6 +374,7 @@ const ( ErrPeerHistoryEmpty = "PEER_HISTORY_EMPTY" ErrPeerIDInvalid = "PEER_ID_INVALID" ErrPeerIDNotSupported = "PEER_ID_NOT_SUPPORTED" + ErrPeerTypesInvalid = "PEER_TYPES_INVALID" ErrPersistentTimestampEmpty = "PERSISTENT_TIMESTAMP_EMPTY" ErrPersistentTimestampInvalid = "PERSISTENT_TIMESTAMP_INVALID" ErrPersistentTimestampOutdated = "PERSISTENT_TIMESTAMP_OUTDATED" @@ -398,6 +415,7 @@ const ( ErrPremiumCurrentlyUnavailable = "PREMIUM_CURRENTLY_UNAVAILABLE" ErrPremiumSubActiveUntil = "PREMIUM_SUB_ACTIVE_UNTIL" ErrPreviousChatImportActiveWaitMin = "PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_MIN" + ErrPricingChatInvalid = "PRICING_CHAT_INVALID" ErrPrivacyKeyInvalid = "PRIVACY_KEY_INVALID" ErrPrivacyPremiumRequired = "PRIVACY_PREMIUM_REQUIRED" ErrPrivacyTooLong = "PRIVACY_TOO_LONG" @@ -474,8 +492,17 @@ const ( ErrSlugInvalid = "SLUG_INVALID" ErrSmsjobIDInvalid = "SMSJOB_ID_INVALID" ErrSMSCodeCreateFailed = "SMS_CODE_CREATE_FAILED" + ErrSRPAInvalid = "SRP_A_INVALID" ErrSRPIDInvalid = "SRP_ID_INVALID" ErrSRPPasswordChanged = "SRP_PASSWORD_CHANGED" + ErrStargiftInvalid = "STARGIFT_INVALID" + ErrStargiftUsageLimited = "STARGIFT_USAGE_LIMITED" + ErrStarrefAwaitingEnd = "STARREF_AWAITING_END" + ErrStarrefHashRevoked = "STARREF_HASH_REVOKED" + ErrStarrefPermilleInvalid = "STARREF_PERMILLE_INVALID" + ErrStarrefPermilleTooLow = "STARREF_PERMILLE_TOO_LOW" + ErrStarsInvoiceInvalid = "STARS_INVOICE_INVALID" + ErrStarsPaymentRequired = "STARS_PAYMENT_REQUIRED" ErrStartParamEmpty = "START_PARAM_EMPTY" ErrStartParamInvalid = "START_PARAM_INVALID" ErrStartParamTooLong = "START_PARAM_TOO_LONG" @@ -508,6 +535,8 @@ const ( ErrStoryPeriodInvalid = "STORY_PERIOD_INVALID" ErrStorySendFloodMonthly = "STORY_SEND_FLOOD_MONTHLY" ErrStorySendFloodWeekly = "STORY_SEND_FLOOD_WEEKLY" + ErrSubscriptionExportMissing = "SUBSCRIPTION_EXPORT_MISSING" + ErrSubscriptionPeriodInvalid = "SUBSCRIPTION_PERIOD_INVALID" ErrSwitchPmTextEmpty = "SWITCH_PM_TEXT_EMPTY" ErrSwitchWebviewURLInvalid = "SWITCH_WEBVIEW_URL_INVALID" ErrTakeoutInitDelay = "TAKEOUT_INIT_DELAY" @@ -516,14 +545,17 @@ const ( ErrTaskAlreadyExists = "TASK_ALREADY_EXISTS" ErrTempAuthKeyAlreadyBound = "TEMP_AUTH_KEY_ALREADY_BOUND" ErrTempAuthKeyEmpty = "TEMP_AUTH_KEY_EMPTY" + ErrTermsURLInvalid = "TERMS_URL_INVALID" ErrThemeFileInvalid = "THEME_FILE_INVALID" ErrThemeFormatInvalid = "THEME_FORMAT_INVALID" ErrThemeInvalid = "THEME_INVALID" ErrThemeMimeInvalid = "THEME_MIME_INVALID" + ErrThemeParamsInvalid = "THEME_PARAMS_INVALID" ErrThemeTitleInvalid = "THEME_TITLE_INVALID" ErrTimezoneInvalid = "TIMEZONE_INVALID" ErrTitleInvalid = "TITLE_INVALID" ErrTmpPasswordDisabled = "TMP_PASSWORD_DISABLED" + ErrTmpPasswordInvalid = "TMP_PASSWORD_INVALID" ErrTokenEmpty = "TOKEN_EMPTY" ErrTokenInvalid = "TOKEN_INVALID" ErrTokenTypeInvalid = "TOKEN_TYPE_INVALID" @@ -536,7 +568,9 @@ const ( ErrTopicNotModified = "TOPIC_NOT_MODIFIED" ErrTopicTitleEmpty = "TOPIC_TITLE_EMPTY" ErrToLangInvalid = "TO_LANG_INVALID" + ErrTransactionIDInvalid = "TRANSACTION_ID_INVALID" ErrTranscriptionFailed = "TRANSCRIPTION_FAILED" + ErrTranslateReqFailed = "TRANSLATE_REQ_FAILED" ErrTranslateReqQuotaExceeded = "TRANSLATE_REQ_QUOTA_EXCEEDED" ErrTTLDaysInvalid = "TTL_DAYS_INVALID" ErrTTLMediaInvalid = "TTL_MEDIA_INVALID" @@ -568,6 +602,7 @@ const ( ErrUserChannelsTooMuch = "USER_CHANNELS_TOO_MUCH" ErrUserCreator = "USER_CREATOR" ErrUserDeleted = "USER_DELETED" + ErrUserGiftUnavailable = "USER_GIFT_UNAVAILABLE" ErrUserIDInvalid = "USER_ID_INVALID" ErrUserInvalid = "USER_INVALID" ErrUserIsBlocked = "USER_IS_BLOCKED" @@ -594,6 +629,7 @@ const ( ErrWebdocumentInvalid = "WEBDOCUMENT_INVALID" ErrWebdocumentMimeInvalid = "WEBDOCUMENT_MIME_INVALID" ErrWebdocumentSizeTooBig = "WEBDOCUMENT_SIZE_TOO_BIG" + ErrWebdocumentURLEmpty = "WEBDOCUMENT_URL_EMPTY" ErrWebdocumentURLInvalid = "WEBDOCUMENT_URL_INVALID" ErrWebpageCurlFailed = "WEBPAGE_CURL_FAILED" ErrWebpageMediaEmpty = "WEBPAGE_MEDIA_EMPTY" @@ -696,6 +732,11 @@ func IsAuthBytesInvalid(err error) bool { return tgerr.Is(err, ErrAuthBytesInvalid) } +// IsAuthKeyUnsynchronized reports whether err is AUTH_KEY_UNSYNCHRONIZED. +func IsAuthKeyUnsynchronized(err error) bool { + return tgerr.Is(err, ErrAuthKeyUnsynchronized) +} + // IsAuthRestart reports whether err is AUTH_RESTART. func IsAuthRestart(err error) bool { return tgerr.Is(err, ErrAuthRestart) @@ -836,6 +877,11 @@ func IsBotInvalid(err error) bool { return tgerr.Is(err, ErrBotInvalid) } +// IsBotInvoiceInvalid reports whether err is BOT_INVOICE_INVALID. +func IsBotInvoiceInvalid(err error) bool { + return tgerr.Is(err, ErrBotInvoiceInvalid) +} + // IsBotNotConnectedYet reports whether err is BOT_NOT_CONNECTED_YET. func IsBotNotConnectedYet(err error) bool { return tgerr.Is(err, ErrBotNotConnectedYet) @@ -896,6 +942,11 @@ func IsBusinessPeerInvalid(err error) bool { return tgerr.Is(err, ErrBusinessPeerInvalid) } +// IsBusinessPeerUsageMissing reports whether err is BUSINESS_PEER_USAGE_MISSING. +func IsBusinessPeerUsageMissing(err error) bool { + return tgerr.Is(err, ErrBusinessPeerUsageMissing) +} + // IsBusinessRecipientsEmpty reports whether err is BUSINESS_RECIPIENTS_EMPTY. func IsBusinessRecipientsEmpty(err error) bool { return tgerr.Is(err, ErrBusinessRecipientsEmpty) @@ -911,11 +962,21 @@ func IsBusinessWorkHoursPeriodInvalid(err error) bool { return tgerr.Is(err, ErrBusinessWorkHoursPeriodInvalid) } +// IsButtonCopyTextInvalid reports whether err is BUTTON_COPY_TEXT_INVALID. +func IsButtonCopyTextInvalid(err error) bool { + return tgerr.Is(err, ErrButtonCopyTextInvalid) +} + // IsButtonDataInvalid reports whether err is BUTTON_DATA_INVALID. func IsButtonDataInvalid(err error) bool { return tgerr.Is(err, ErrButtonDataInvalid) } +// IsButtonIDInvalid reports whether err is BUTTON_ID_INVALID. +func IsButtonIDInvalid(err error) bool { + return tgerr.Is(err, ErrButtonIDInvalid) +} + // IsButtonPosInvalid reports whether err is BUTTON_POS_INVALID. func IsButtonPosInvalid(err error) bool { return tgerr.Is(err, ErrButtonPosInvalid) @@ -1061,6 +1122,11 @@ func IsChatlinkSlugExpired(err error) bool { return tgerr.Is(err, ErrChatlinkSlugExpired) } +// IsChatlistsTooMuch reports whether err is CHATLISTS_TOO_MUCH. +func IsChatlistsTooMuch(err error) bool { + return tgerr.Is(err, ErrChatlistsTooMuch) +} + // IsChatlistExcludeInvalid reports whether err is CHATLIST_EXCLUDE_INVALID. func IsChatlistExcludeInvalid(err error) bool { return tgerr.Is(err, ErrChatlistExcludeInvalid) @@ -1136,6 +1202,11 @@ func IsChatLinkExists(err error) bool { return tgerr.Is(err, ErrChatLinkExists) } +// IsChatMemberAddFailed reports whether err is CHAT_MEMBER_ADD_FAILED. +func IsChatMemberAddFailed(err error) bool { + return tgerr.Is(err, ErrChatMemberAddFailed) +} + // IsChatNotModified reports whether err is CHAT_NOT_MODIFIED. func IsChatNotModified(err error) bool { return tgerr.Is(err, ErrChatNotModified) @@ -1231,6 +1302,11 @@ func IsChatTooBig(err error) bool { return tgerr.Is(err, ErrChatTooBig) } +// IsChatTypeInvalid reports whether err is CHAT_TYPE_INVALID. +func IsChatTypeInvalid(err error) bool { + return tgerr.Is(err, ErrChatTypeInvalid) +} + // IsChatWriteForbidden reports whether err is CHAT_WRITE_FORBIDDEN. func IsChatWriteForbidden(err error) bool { return tgerr.Is(err, ErrChatWriteForbidden) @@ -1476,6 +1552,11 @@ func IsExpireDateInvalid(err error) bool { return tgerr.Is(err, ErrExpireDateInvalid) } +// IsExtendedMediaAmountInvalid reports whether err is EXTENDED_MEDIA_AMOUNT_INVALID. +func IsExtendedMediaAmountInvalid(err error) bool { + return tgerr.Is(err, ErrExtendedMediaAmountInvalid) +} + // IsExternalURLInvalid reports whether err is EXTERNAL_URL_INVALID. func IsExternalURLInvalid(err error) bool { return tgerr.Is(err, ErrExternalURLInvalid) @@ -1536,6 +1617,11 @@ func IsFilePartTooBig(err error) bool { return tgerr.Is(err, ErrFilePartTooBig) } +// IsFilePartTooSmall reports whether err is FILE_PART_TOO_SMALL. +func IsFilePartTooSmall(err error) bool { + return tgerr.Is(err, ErrFilePartTooSmall) +} + // IsFileReferenceEmpty reports whether err is FILE_REFERENCE_EMPTY. func IsFileReferenceEmpty(err error) bool { return tgerr.Is(err, ErrFileReferenceEmpty) @@ -1601,6 +1687,16 @@ func IsFormExpired(err error) bool { return tgerr.Is(err, ErrFormExpired) } +// IsFormIDEmpty reports whether err is FORM_ID_EMPTY. +func IsFormIDEmpty(err error) bool { + return tgerr.Is(err, ErrFormIDEmpty) +} + +// IsFormUnsupported reports whether err is FORM_UNSUPPORTED. +func IsFormUnsupported(err error) bool { + return tgerr.Is(err, ErrFormUnsupported) +} + // IsForumEnabled reports whether err is FORUM_ENABLED. func IsForumEnabled(err error) bool { return tgerr.Is(err, ErrForumEnabled) @@ -1736,6 +1832,16 @@ func IsHideRequesterMissing(err error) bool { return tgerr.Is(err, ErrHideRequesterMissing) } +// IsIDExpired reports whether err is ID_EXPIRED. +func IsIDExpired(err error) bool { + return tgerr.Is(err, ErrIDExpired) +} + +// IsIDInvalid reports whether err is ID_INVALID. +func IsIDInvalid(err error) bool { + return tgerr.Is(err, ErrIDInvalid) +} + // IsImageProcessFailed reports whether err is IMAGE_PROCESS_FAILED. func IsImageProcessFailed(err error) bool { return tgerr.Is(err, ErrImageProcessFailed) @@ -1791,6 +1897,11 @@ func IsInputFilterInvalid(err error) bool { return tgerr.Is(err, ErrInputFilterInvalid) } +// IsInputPeersEmpty reports whether err is INPUT_PEERS_EMPTY. +func IsInputPeersEmpty(err error) bool { + return tgerr.Is(err, ErrInputPeersEmpty) +} + // IsInputTextEmpty reports whether err is INPUT_TEXT_EMPTY. func IsInputTextEmpty(err error) bool { return tgerr.Is(err, ErrInputTextEmpty) @@ -1851,6 +1962,11 @@ func IsInviteSlugExpired(err error) bool { return tgerr.Is(err, ErrInviteSlugExpired) } +// IsInviteSlugInvalid reports whether err is INVITE_SLUG_INVALID. +func IsInviteSlugInvalid(err error) bool { + return tgerr.Is(err, ErrInviteSlugInvalid) +} + // IsInvoicePayloadInvalid reports whether err is INVOICE_PAYLOAD_INVALID. func IsInvoicePayloadInvalid(err error) bool { return tgerr.Is(err, ErrInvoicePayloadInvalid) @@ -2231,6 +2347,11 @@ func IsPeerIDNotSupported(err error) bool { return tgerr.Is(err, ErrPeerIDNotSupported) } +// IsPeerTypesInvalid reports whether err is PEER_TYPES_INVALID. +func IsPeerTypesInvalid(err error) bool { + return tgerr.Is(err, ErrPeerTypesInvalid) +} + // IsPersistentTimestampEmpty reports whether err is PERSISTENT_TIMESTAMP_EMPTY. func IsPersistentTimestampEmpty(err error) bool { return tgerr.Is(err, ErrPersistentTimestampEmpty) @@ -2431,6 +2552,11 @@ func IsPreviousChatImportActiveWaitMin(err error) bool { return tgerr.Is(err, ErrPreviousChatImportActiveWaitMin) } +// IsPricingChatInvalid reports whether err is PRICING_CHAT_INVALID. +func IsPricingChatInvalid(err error) bool { + return tgerr.Is(err, ErrPricingChatInvalid) +} + // IsPrivacyKeyInvalid reports whether err is PRIVACY_KEY_INVALID. func IsPrivacyKeyInvalid(err error) bool { return tgerr.Is(err, ErrPrivacyKeyInvalid) @@ -2811,6 +2937,11 @@ func IsSMSCodeCreateFailed(err error) bool { return tgerr.Is(err, ErrSMSCodeCreateFailed) } +// IsSRPAInvalid reports whether err is SRP_A_INVALID. +func IsSRPAInvalid(err error) bool { + return tgerr.Is(err, ErrSRPAInvalid) +} + // IsSRPIDInvalid reports whether err is SRP_ID_INVALID. func IsSRPIDInvalid(err error) bool { return tgerr.Is(err, ErrSRPIDInvalid) @@ -2821,6 +2952,46 @@ func IsSRPPasswordChanged(err error) bool { return tgerr.Is(err, ErrSRPPasswordChanged) } +// IsStargiftInvalid reports whether err is STARGIFT_INVALID. +func IsStargiftInvalid(err error) bool { + return tgerr.Is(err, ErrStargiftInvalid) +} + +// IsStargiftUsageLimited reports whether err is STARGIFT_USAGE_LIMITED. +func IsStargiftUsageLimited(err error) bool { + return tgerr.Is(err, ErrStargiftUsageLimited) +} + +// IsStarrefAwaitingEnd reports whether err is STARREF_AWAITING_END. +func IsStarrefAwaitingEnd(err error) bool { + return tgerr.Is(err, ErrStarrefAwaitingEnd) +} + +// IsStarrefHashRevoked reports whether err is STARREF_HASH_REVOKED. +func IsStarrefHashRevoked(err error) bool { + return tgerr.Is(err, ErrStarrefHashRevoked) +} + +// IsStarrefPermilleInvalid reports whether err is STARREF_PERMILLE_INVALID. +func IsStarrefPermilleInvalid(err error) bool { + return tgerr.Is(err, ErrStarrefPermilleInvalid) +} + +// IsStarrefPermilleTooLow reports whether err is STARREF_PERMILLE_TOO_LOW. +func IsStarrefPermilleTooLow(err error) bool { + return tgerr.Is(err, ErrStarrefPermilleTooLow) +} + +// IsStarsInvoiceInvalid reports whether err is STARS_INVOICE_INVALID. +func IsStarsInvoiceInvalid(err error) bool { + return tgerr.Is(err, ErrStarsInvoiceInvalid) +} + +// IsStarsPaymentRequired reports whether err is STARS_PAYMENT_REQUIRED. +func IsStarsPaymentRequired(err error) bool { + return tgerr.Is(err, ErrStarsPaymentRequired) +} + // IsStartParamEmpty reports whether err is START_PARAM_EMPTY. func IsStartParamEmpty(err error) bool { return tgerr.Is(err, ErrStartParamEmpty) @@ -2981,6 +3152,16 @@ func IsStorySendFloodWeekly(err error) bool { return tgerr.Is(err, ErrStorySendFloodWeekly) } +// IsSubscriptionExportMissing reports whether err is SUBSCRIPTION_EXPORT_MISSING. +func IsSubscriptionExportMissing(err error) bool { + return tgerr.Is(err, ErrSubscriptionExportMissing) +} + +// IsSubscriptionPeriodInvalid reports whether err is SUBSCRIPTION_PERIOD_INVALID. +func IsSubscriptionPeriodInvalid(err error) bool { + return tgerr.Is(err, ErrSubscriptionPeriodInvalid) +} + // IsSwitchPmTextEmpty reports whether err is SWITCH_PM_TEXT_EMPTY. func IsSwitchPmTextEmpty(err error) bool { return tgerr.Is(err, ErrSwitchPmTextEmpty) @@ -3021,6 +3202,11 @@ func IsTempAuthKeyEmpty(err error) bool { return tgerr.Is(err, ErrTempAuthKeyEmpty) } +// IsTermsURLInvalid reports whether err is TERMS_URL_INVALID. +func IsTermsURLInvalid(err error) bool { + return tgerr.Is(err, ErrTermsURLInvalid) +} + // IsThemeFileInvalid reports whether err is THEME_FILE_INVALID. func IsThemeFileInvalid(err error) bool { return tgerr.Is(err, ErrThemeFileInvalid) @@ -3041,6 +3227,11 @@ func IsThemeMimeInvalid(err error) bool { return tgerr.Is(err, ErrThemeMimeInvalid) } +// IsThemeParamsInvalid reports whether err is THEME_PARAMS_INVALID. +func IsThemeParamsInvalid(err error) bool { + return tgerr.Is(err, ErrThemeParamsInvalid) +} + // IsThemeTitleInvalid reports whether err is THEME_TITLE_INVALID. func IsThemeTitleInvalid(err error) bool { return tgerr.Is(err, ErrThemeTitleInvalid) @@ -3061,6 +3252,11 @@ func IsTmpPasswordDisabled(err error) bool { return tgerr.Is(err, ErrTmpPasswordDisabled) } +// IsTmpPasswordInvalid reports whether err is TMP_PASSWORD_INVALID. +func IsTmpPasswordInvalid(err error) bool { + return tgerr.Is(err, ErrTmpPasswordInvalid) +} + // IsTokenEmpty reports whether err is TOKEN_EMPTY. func IsTokenEmpty(err error) bool { return tgerr.Is(err, ErrTokenEmpty) @@ -3121,11 +3317,21 @@ func IsToLangInvalid(err error) bool { return tgerr.Is(err, ErrToLangInvalid) } +// IsTransactionIDInvalid reports whether err is TRANSACTION_ID_INVALID. +func IsTransactionIDInvalid(err error) bool { + return tgerr.Is(err, ErrTransactionIDInvalid) +} + // IsTranscriptionFailed reports whether err is TRANSCRIPTION_FAILED. func IsTranscriptionFailed(err error) bool { return tgerr.Is(err, ErrTranscriptionFailed) } +// IsTranslateReqFailed reports whether err is TRANSLATE_REQ_FAILED. +func IsTranslateReqFailed(err error) bool { + return tgerr.Is(err, ErrTranslateReqFailed) +} + // IsTranslateReqQuotaExceeded reports whether err is TRANSLATE_REQ_QUOTA_EXCEEDED. func IsTranslateReqQuotaExceeded(err error) bool { return tgerr.Is(err, ErrTranslateReqQuotaExceeded) @@ -3281,6 +3487,11 @@ func IsUserDeleted(err error) bool { return tgerr.Is(err, ErrUserDeleted) } +// IsUserGiftUnavailable reports whether err is USER_GIFT_UNAVAILABLE. +func IsUserGiftUnavailable(err error) bool { + return tgerr.Is(err, ErrUserGiftUnavailable) +} + // IsUserIDInvalid reports whether err is USER_ID_INVALID. func IsUserIDInvalid(err error) bool { return tgerr.Is(err, ErrUserIDInvalid) @@ -3411,6 +3622,11 @@ func IsWebdocumentSizeTooBig(err error) bool { return tgerr.Is(err, ErrWebdocumentSizeTooBig) } +// IsWebdocumentURLEmpty reports whether err is WEBDOCUMENT_URL_EMPTY. +func IsWebdocumentURLEmpty(err error) bool { + return tgerr.Is(err, ErrWebdocumentURLEmpty) +} + // IsWebdocumentURLInvalid reports whether err is WEBDOCUMENT_URL_INVALID. func IsWebdocumentURLInvalid(err error) bool { return tgerr.Is(err, ErrWebdocumentURLInvalid) diff --git a/tg/tl_input_privacy_key_gen.go b/tg/tl_input_privacy_key_gen.go index 7b042f976e..80d3e792d8 100644 --- a/tg/tl_input_privacy_key_gen.go +++ b/tg/tl_input_privacy_key_gen.go @@ -1173,6 +1173,10 @@ func (i *InputPrivacyKeyBirthday) DecodeBare(b *bin.Buffer) error { } // InputPrivacyKeyStarGiftsAutoSave represents TL type `inputPrivacyKeyStarGiftsAutoSave#e1732341`. +// Whether received gifts¹ will be automatically displayed on our profile +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/inputPrivacyKeyStarGiftsAutoSave for reference. type InputPrivacyKeyStarGiftsAutoSave struct { diff --git a/tg/tl_input_privacy_rule_gen.go b/tg/tl_input_privacy_rule_gen.go index 67bc189015..b44e645c5d 100644 --- a/tg/tl_input_privacy_rule_gen.go +++ b/tg/tl_input_privacy_rule_gen.go @@ -1264,6 +1264,7 @@ func (i *InputPrivacyValueAllowPremium) DecodeBare(b *bin.Buffer) error { } // InputPrivacyValueAllowBots represents TL type `inputPrivacyValueAllowBots#5a4fcce5`. +// Allow bots and mini apps // // See https://core.telegram.org/constructor/inputPrivacyValueAllowBots for reference. type InputPrivacyValueAllowBots struct { @@ -1365,6 +1366,7 @@ func (i *InputPrivacyValueAllowBots) DecodeBare(b *bin.Buffer) error { } // InputPrivacyValueDisallowBots represents TL type `inputPrivacyValueDisallowBots#c4e57915`. +// Disallow bots and mini apps // // See https://core.telegram.org/constructor/inputPrivacyValueDisallowBots for reference. type InputPrivacyValueDisallowBots struct { diff --git a/tg/tl_invoice_gen.go b/tg/tl_invoice_gen.go index 28e45f8b5b..473363bd87 100644 --- a/tg/tl_invoice_gen.go +++ b/tg/tl_invoice_gen.go @@ -89,7 +89,11 @@ type Invoice struct { // // Use SetTermsURL and GetTermsURL helpers. TermsURL string - // SubscriptionPeriod field of Invoice. + // The number of seconds between consecutive Telegram Star debiting for bot + // subscription¹ invoices + // + // Links: + // 1) https://core.telegram.org/api/subscriptions#bot-subscriptions // // Use SetSubscriptionPeriod and GetSubscriptionPeriod helpers. SubscriptionPeriod int diff --git a/tg/tl_message_action_gen.go b/tg/tl_message_action_gen.go index f097af1de9..0988d322d1 100644 --- a/tg/tl_message_action_gen.go +++ b/tg/tl_message_action_gen.go @@ -1947,7 +1947,10 @@ type MessageActionPaymentSentMe struct { ShippingOptionID string // Provider payment identifier Charge PaymentCharge - // SubscriptionUntilDate field of MessageActionPaymentSentMe. + // Expiration date of the Telegram Star subscription »¹. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions // // Use SetSubscriptionUntilDate and GetSubscriptionUntilDate helpers. SubscriptionUntilDate int @@ -2405,7 +2408,10 @@ type MessageActionPaymentSent struct { // // Use SetInvoiceSlug and GetInvoiceSlug helpers. InvoiceSlug string - // SubscriptionUntilDate field of MessageActionPaymentSent. + // Expiration date of the Telegram Star subscription »¹. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions // // Use SetSubscriptionUntilDate and GetSubscriptionUntilDate helpers. SubscriptionUntilDate int @@ -9035,7 +9041,9 @@ type MessageActionPrizeStars struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Unclaimed field of MessageActionPrizeStars. + // If set, this indicates the reverse transaction that refunds the remaining stars to the + // creator of a giveaway if, when the giveaway ends, the number of members in the channel + // is smaller than the number of winners in the giveaway. Unclaimed bool // The number of Telegram Stars you won Stars int64 diff --git a/tg/tl_messages_bot_prepared_inline_message_gen.go b/tg/tl_messages_bot_prepared_inline_message_gen.go index 9586b02cc4..5649e1a45d 100644 --- a/tg/tl_messages_bot_prepared_inline_message_gen.go +++ b/tg/tl_messages_bot_prepared_inline_message_gen.go @@ -32,12 +32,21 @@ var ( ) // MessagesBotPreparedInlineMessage represents TL type `messages.botPreparedInlineMessage#8ecf0511`. +// Represents a prepared inline message saved by a bot, to be sent to the user via a web +// app »¹ +// +// Links: +// 1. https://core.telegram.org/api/bots/inline#21-using-a-prepared-inline-message // // See https://core.telegram.org/constructor/messages.botPreparedInlineMessage for reference. type MessagesBotPreparedInlineMessage struct { - // ID field of MessagesBotPreparedInlineMessage. + // The ID of the saved message, to be passed to the id field of the + // web_app_send_prepared_message event »¹ + // + // Links: + // 1) https://core.telegram.org/api/web-events#web-app-send-prepared-message ID string - // ExpireDate field of MessagesBotPreparedInlineMessage. + // Expiration date of the message ExpireDate int } diff --git a/tg/tl_messages_click_sponsored_message_gen.go b/tg/tl_messages_click_sponsored_message_gen.go index 0494a92a70..5231281062 100644 --- a/tg/tl_messages_click_sponsored_message_gen.go +++ b/tg/tl_messages_click_sponsored_message_gen.go @@ -296,7 +296,6 @@ func (c *MessagesClickSponsoredMessageRequest) GetRandomID() (value []byte) { // 1. https://core.telegram.org/api/sponsored-messages#clicking-on-sponsored-messages // // See https://core.telegram.org/method/messages.clickSponsoredMessage for reference. -// Can be used by bots. func (c *Client) MessagesClickSponsoredMessage(ctx context.Context, request *MessagesClickSponsoredMessageRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_delete_chat_user_gen.go b/tg/tl_messages_delete_chat_user_gen.go index 54b3d04d24..2ce5611fba 100644 --- a/tg/tl_messages_delete_chat_user_gen.go +++ b/tg/tl_messages_delete_chat_user_gen.go @@ -256,6 +256,7 @@ func (d *MessagesDeleteChatUserRequest) GetUserID() (value InputUserClass) { // // 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 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 USER_ID_INVALID: The provided user ID is invalid. // 400 USER_NOT_PARTICIPANT: You're not a member of this supergroup/channel. diff --git a/tg/tl_messages_edit_message_gen.go b/tg/tl_messages_edit_message_gen.go index c15a6cba42..15695f09e6 100644 --- a/tg/tl_messages_edit_message_gen.go +++ b/tg/tl_messages_edit_message_gen.go @@ -625,6 +625,7 @@ func (e *MessagesEditMessageRequest) MapEntities() (value MessageEntityClassArra // // 400 BOT_DOMAIN_INVALID: Bot domain invalid. // 400 BOT_INVALID: This is not a valid bot. +// 400 BUTTON_COPY_TEXT_INVALID: The specified keyboardButtonCopy.copy_text is invalid. // 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. @@ -657,6 +658,7 @@ func (e *MessagesEditMessageRequest) MapEntities() (value MessageEntityClassArra // 400 MSG_ID_INVALID: Invalid message ID provided. // 500 MSG_WAIT_FAILED: A waiting call returned an error. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 PEER_TYPES_INVALID: The passed keyboardButtonSwitchInline.peer_types field is invalid. // 400 REPLY_MARKUP_INVALID: The provided reply markup is invalid. // 400 REPLY_MARKUP_TOO_LONG: The specified reply_markup is too long. // 400 SCHEDULE_DATE_INVALID: Invalid schedule date provided. diff --git a/tg/tl_messages_export_chat_invite_gen.go b/tg/tl_messages_export_chat_invite_gen.go index b0087acb34..bf0742e007 100644 --- a/tg/tl_messages_export_chat_invite_gen.go +++ b/tg/tl_messages_export_chat_invite_gen.go @@ -469,6 +469,8 @@ func (e *MessagesExportChatInviteRequest) GetSubscriptionPricing() (value StarsS // 400 EXPIRE_DATE_INVALID: The specified expiration date is invalid. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 PRICING_CHAT_INVALID: The pricing for the subscription is invalid, the maximum price is specified in the stars_subscription_amount_max config key ». +// 400 SUBSCRIPTION_PERIOD_INVALID: The specified subscription_pricing.period is invalid. // 400 USAGE_LIMIT_INVALID: The specified usage limit is invalid. // // See https://core.telegram.org/method/messages.exportChatInvite for reference. diff --git a/tg/tl_messages_found_stickers_gen.go b/tg/tl_messages_found_stickers_gen.go index 7c3284133c..063cdc034a 100644 --- a/tg/tl_messages_found_stickers_gen.go +++ b/tg/tl_messages_found_stickers_gen.go @@ -32,12 +32,19 @@ var ( ) // MessagesFoundStickersNotModified represents TL type `messages.foundStickersNotModified#6010c534`. +// No new stickers were found for the specified query // // See https://core.telegram.org/constructor/messages.foundStickersNotModified for reference. type MessagesFoundStickersNotModified struct { - // Flags field of MessagesFoundStickersNotModified. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // NextOffset field of MessagesFoundStickersNotModified. + // Offset for pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets // // Use SetNextOffset and GetNextOffset helpers. NextOffset int @@ -205,18 +212,28 @@ func (f *MessagesFoundStickersNotModified) GetNextOffset() (value int, ok bool) } // MessagesFoundStickers represents TL type `messages.foundStickers#82c9e290`. +// Found stickers // // See https://core.telegram.org/constructor/messages.foundStickers for reference. type MessagesFoundStickers struct { - // Flags field of MessagesFoundStickers. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // NextOffset field of MessagesFoundStickers. + // Offset for pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets // // Use SetNextOffset and GetNextOffset helpers. NextOffset int - // Hash field of MessagesFoundStickers. + // Hash used for caching, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 - // Stickers field of MessagesFoundStickers. + // Found stickers Stickers []DocumentClass } @@ -490,7 +507,10 @@ type MessagesFoundStickersClass interface { // Zero returns true if current object has a zero value. Zero() bool - // NextOffset field of MessagesFoundStickersNotModified. + // Offset for pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets GetNextOffset() (value int, ok bool) // AsModified tries to map MessagesFoundStickersClass to MessagesFoundStickers. diff --git a/tg/tl_messages_get_dialogs_gen.go b/tg/tl_messages_get_dialogs_gen.go index 8f7b944562..2d5fa3b643 100644 --- a/tg/tl_messages_get_dialogs_gen.go +++ b/tg/tl_messages_get_dialogs_gen.go @@ -402,6 +402,7 @@ func (g *MessagesGetDialogsRequest) GetHash() (value int64) { // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 FOLDER_ID_INVALID: Invalid folder ID. // 400 OFFSET_PEER_ID_INVALID: The provided offset peer is invalid. +// 400 TAKEOUT_INVALID: The specified takeout ID is invalid. // // See https://core.telegram.org/method/messages.getDialogs for reference. func (c *Client) MessagesGetDialogs(ctx context.Context, request *MessagesGetDialogsRequest) (MessagesDialogsClass, error) { diff --git a/tg/tl_messages_get_paid_reaction_privacy_gen.go b/tg/tl_messages_get_paid_reaction_privacy_gen.go index 359ed0b016..8ce704249c 100644 --- a/tg/tl_messages_get_paid_reaction_privacy_gen.go +++ b/tg/tl_messages_get_paid_reaction_privacy_gen.go @@ -142,7 +142,6 @@ func (g *MessagesGetPaidReactionPrivacyRequest) DecodeBare(b *bin.Buffer) error // 2. https://core.telegram.org/api/reactions#paid-reactions // // See https://core.telegram.org/method/messages.getPaidReactionPrivacy for reference. -// Can be used by bots. func (c *Client) MessagesGetPaidReactionPrivacy(ctx context.Context) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_get_peer_dialogs_gen.go b/tg/tl_messages_get_peer_dialogs_gen.go index a8509e8f03..1f6f1e65d2 100644 --- a/tg/tl_messages_get_peer_dialogs_gen.go +++ b/tg/tl_messages_get_peer_dialogs_gen.go @@ -191,6 +191,7 @@ func (g *MessagesGetPeerDialogsRequest) MapPeers() (value InputDialogPeerClassAr // // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. +// 400 INPUT_PEERS_EMPTY: The specified peer array is empty. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. // diff --git a/tg/tl_messages_get_prepared_inline_message_gen.go b/tg/tl_messages_get_prepared_inline_message_gen.go index d1eb58dbb8..ff5fbda91f 100644 --- a/tg/tl_messages_get_prepared_inline_message_gen.go +++ b/tg/tl_messages_get_prepared_inline_message_gen.go @@ -32,12 +32,25 @@ var ( ) // MessagesGetPreparedInlineMessageRequest represents TL type `messages.getPreparedInlineMessage#857ebdb8`. +// Obtain a prepared inline message¹ generated by a mini app²: invoked when handling +// web_app_send_prepared_message events³ +// +// Links: +// 1. https://core.telegram.org/api/bots/inline#21-using-a-prepared-inline-message +// 2. https://core.telegram.org/api/bots/webapps +// 3. https://core.telegram.org/api/web-events#web-app-send-prepared-message // // See https://core.telegram.org/method/messages.getPreparedInlineMessage for reference. type MessagesGetPreparedInlineMessageRequest struct { - // Bot field of MessagesGetPreparedInlineMessageRequest. + // The bot that owns the mini app that emitted the web_app_send_prepared_message event¹ + // + // Links: + // 1) https://core.telegram.org/api/web-events#web-app-send-prepared-message Bot InputUserClass - // ID field of MessagesGetPreparedInlineMessageRequest. + // The id from the web_app_send_prepared_message event¹ + // + // Links: + // 1) https://core.telegram.org/api/web-events#web-app-send-prepared-message ID string } @@ -193,6 +206,18 @@ func (g *MessagesGetPreparedInlineMessageRequest) GetID() (value string) { } // MessagesGetPreparedInlineMessage invokes method messages.getPreparedInlineMessage#857ebdb8 returning error if any. +// Obtain a prepared inline message¹ generated by a mini app²: invoked when handling +// web_app_send_prepared_message events³ +// +// Links: +// 1. https://core.telegram.org/api/bots/inline#21-using-a-prepared-inline-message +// 2. https://core.telegram.org/api/bots/webapps +// 3. https://core.telegram.org/api/web-events#web-app-send-prepared-message +// +// Possible errors: +// +// 400 ID_EXPIRED: The passed prepared inline message ID has expired. +// 400 ID_INVALID: The passed ID is invalid. // // See https://core.telegram.org/method/messages.getPreparedInlineMessage for reference. func (c *Client) MessagesGetPreparedInlineMessage(ctx context.Context, request *MessagesGetPreparedInlineMessageRequest) (*MessagesPreparedInlineMessage, error) { diff --git a/tg/tl_messages_get_sponsored_messages_gen.go b/tg/tl_messages_get_sponsored_messages_gen.go index d77438841f..527bd68c17 100644 --- a/tg/tl_messages_get_sponsored_messages_gen.go +++ b/tg/tl_messages_get_sponsored_messages_gen.go @@ -176,7 +176,6 @@ func (g *MessagesGetSponsoredMessagesRequest) GetPeer() (value InputPeerClass) { // 1. https://core.telegram.org/api/sponsored-messages // // See https://core.telegram.org/method/messages.getSponsoredMessages for reference. -// Can be used by bots. func (c *Client) MessagesGetSponsoredMessages(ctx context.Context, peer InputPeerClass) (MessagesSponsoredMessagesClass, error) { var result MessagesSponsoredMessagesBox diff --git a/tg/tl_messages_import_chat_invite_gen.go b/tg/tl_messages_import_chat_invite_gen.go index 24540d24f8..3213f8336d 100644 --- a/tg/tl_messages_import_chat_invite_gen.go +++ b/tg/tl_messages_import_chat_invite_gen.go @@ -179,6 +179,7 @@ func (i *MessagesImportChatInviteRequest) GetHash() (value string) { // 400 INVITE_REQUEST_SENT: You have successfully requested to join this chat or channel. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 STARS_PAYMENT_REQUIRED: To import this chat invite link, you must first pay for the associated Telegram Star subscription ». // 400 USERS_TOO_MUCH: The maximum number of users has been exceeded (to create a chat, for example). // 400 USER_ALREADY_PARTICIPANT: The user is already in the group. // 400 USER_CHANNELS_TOO_MUCH: One of the users you tried to add is already in too many channels/supergroups. diff --git a/tg/tl_messages_prepared_inline_message_gen.go b/tg/tl_messages_prepared_inline_message_gen.go index 32bedeb6d5..77e5900be2 100644 --- a/tg/tl_messages_prepared_inline_message_gen.go +++ b/tg/tl_messages_prepared_inline_message_gen.go @@ -32,18 +32,26 @@ var ( ) // MessagesPreparedInlineMessage represents TL type `messages.preparedInlineMessage#ff57708d`. +// Represents a prepared inline message received via a bot's mini app, that can be sent +// to some chats »¹ +// +// Links: +// 1. https://core.telegram.org/api/bots/inline#21-using-a-prepared-inline-message // // See https://core.telegram.org/constructor/messages.preparedInlineMessage for reference. type MessagesPreparedInlineMessage struct { - // QueryID field of MessagesPreparedInlineMessage. + // The query_id to pass to messages.sendInlineBotResult¹ + // + // Links: + // 1) https://core.telegram.org/method/messages.sendInlineBotResult QueryID int64 - // Result field of MessagesPreparedInlineMessage. + // The contents of the message, to be shown in a preview Result BotInlineResultClass - // PeerTypes field of MessagesPreparedInlineMessage. + // Types of chats where this message can be sent PeerTypes []InlineQueryPeerTypeClass - // CacheTime field of MessagesPreparedInlineMessage. + // Caching validity of the results CacheTime int - // Users field of MessagesPreparedInlineMessage. + // Users mentioned in the results Users []UserClass } diff --git a/tg/tl_messages_report_sponsored_message_gen.go b/tg/tl_messages_report_sponsored_message_gen.go index c44439f493..52c8420f4e 100644 --- a/tg/tl_messages_report_sponsored_message_gen.go +++ b/tg/tl_messages_report_sponsored_message_gen.go @@ -236,7 +236,6 @@ func (r *MessagesReportSponsoredMessageRequest) GetOption() (value []byte) { // 2. https://core.telegram.org/api/sponsored-messages#reporting-sponsored-messages // // See https://core.telegram.org/method/messages.reportSponsoredMessage for reference. -// Can be used by bots. func (c *Client) MessagesReportSponsoredMessage(ctx context.Context, request *MessagesReportSponsoredMessageRequest) (ChannelsSponsoredMessageReportResultClass, error) { var result ChannelsSponsoredMessageReportResultBox diff --git a/tg/tl_messages_request_app_web_view_gen.go b/tg/tl_messages_request_app_web_view_gen.go index b701700e69..8577a7ebc3 100644 --- a/tg/tl_messages_request_app_web_view_gen.go +++ b/tg/tl_messages_request_app_web_view_gen.go @@ -55,14 +55,19 @@ type MessagesRequestAppWebViewRequest struct { // Links: // 1) https://core.telegram.org/api/links#direct-mini-app-links WriteAllowed bool - // 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. + // If set, requests to open the mini app in compact mode (as opposed to normal or + // fullscreen 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 - // Fullscreen field of MessagesRequestAppWebViewRequest. + // If set, requests to open the mini app in fullscreen mode (as opposed to compact or + // normal mode). Must be set if the mode parameter of the direct Mini App deep link¹ is + // equal to fullscreen. + // + // Links: + // 1) https://core.telegram.org/api/links#direct-mini-app-links Fullscreen 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. @@ -490,6 +495,7 @@ func (r *MessagesRequestAppWebViewRequest) GetPlatform() (value string) { // // 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. // diff --git a/tg/tl_messages_request_main_web_view_gen.go b/tg/tl_messages_request_main_web_view_gen.go index d3ebf64b4f..698fb0d176 100644 --- a/tg/tl_messages_request_main_web_view_gen.go +++ b/tg/tl_messages_request_main_web_view_gen.go @@ -44,13 +44,19 @@ type MessagesRequestMainWebViewRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // 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. + // If set, requests to open the mini app in compact mode (as opposed to normal or + // fullscreen 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 - // Fullscreen field of MessagesRequestMainWebViewRequest. + // If set, requests to open the mini app in fullscreen mode (as opposed to compact or + // normal mode). Must be set if the mode parameter of the Main Mini App link¹ is equal + // to fullscreen. + // + // Links: + // 1) https://core.telegram.org/api/links#main-mini-app-links Fullscreen bool // Currently open chat, may be inputPeerEmpty¹ if no chat is currently open. // diff --git a/tg/tl_messages_request_simple_web_view_gen.go b/tg/tl_messages_request_simple_web_view_gen.go index 91e1e60128..c0596a163b 100644 --- a/tg/tl_messages_request_simple_web_view_gen.go +++ b/tg/tl_messages_request_simple_web_view_gen.go @@ -57,7 +57,7 @@ type MessagesRequestSimpleWebViewRequest struct { FromSideMenu bool // Deprecated. Compact bool - // Fullscreen field of MessagesRequestSimpleWebViewRequest. + // Requests to open the app in fullscreen mode. Fullscreen bool // Bot that owns the mini app Bot InputUserClass diff --git a/tg/tl_messages_request_web_view_gen.go b/tg/tl_messages_request_web_view_gen.go index 319970fa71..e6e9e48575 100644 --- a/tg/tl_messages_request_web_view_gen.go +++ b/tg/tl_messages_request_web_view_gen.go @@ -59,14 +59,19 @@ type MessagesRequestWebViewRequest struct { // Links: // 1) https://core.telegram.org/method/messages.sendWebViewResultMessage Silent bool - // 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. + // If set, requests to open the mini app in compact mode (as opposed to normal or + // fullscreen 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 - // Fullscreen field of MessagesRequestWebViewRequest. + // If set, requests to open the mini app in fullscreen mode (as opposed to normal or + // compact mode). Must be set if the mode parameter of the attachment menu deep link¹ is + // equal to fullscreen. + // + // Links: + // 1) https://core.telegram.org/api/links#bot-attachment-or-side-menu-links Fullscreen bool // Dialog where the web app is being opened, and where the resulting message will be sent // (see the docs for more info »¹). @@ -696,6 +701,8 @@ func (r *MessagesRequestWebViewRequest) GetSendAs() (value InputPeerClass, ok bo // 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 THEME_PARAMS_INVALID: The specified theme_params field is invalid. +// 400 URL_INVALID: Invalid URL provided. // 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_prepared_inline_message_gen.go b/tg/tl_messages_save_prepared_inline_message_gen.go index 08cf60376b..4ba0a00a13 100644 --- a/tg/tl_messages_save_prepared_inline_message_gen.go +++ b/tg/tl_messages_save_prepared_inline_message_gen.go @@ -32,16 +32,28 @@ var ( ) // MessagesSavePreparedInlineMessageRequest represents TL type `messages.savePreparedInlineMessage#f21f7f2f`. +// Save a prepared inline message¹, to be shared by the user of the mini app using a +// web_app_send_prepared_message event² +// +// Links: +// 1. https://core.telegram.org/api/bots/inline#21-using-a-prepared-inline-message +// 2. https://core.telegram.org/api/web-events#web-app-send-prepared-message // // See https://core.telegram.org/method/messages.savePreparedInlineMessage for reference. type MessagesSavePreparedInlineMessageRequest struct { - // Flags field of MessagesSavePreparedInlineMessageRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Result field of MessagesSavePreparedInlineMessageRequest. + // The message Result InputBotInlineResultClass - // UserID field of MessagesSavePreparedInlineMessageRequest. + // The user to whom the web_app_send_prepared_message event¹ event will be sent + // + // Links: + // 1) https://core.telegram.org/api/web-events#web-app-send-prepared-message UserID InputUserClass - // PeerTypes field of MessagesSavePreparedInlineMessageRequest. + // Types of chats where this message can be sent // // Use SetPeerTypes and GetPeerTypes helpers. PeerTypes []InlineQueryPeerTypeClass @@ -290,8 +302,21 @@ func (s *MessagesSavePreparedInlineMessageRequest) MapPeerTypes() (value InlineQ } // MessagesSavePreparedInlineMessage invokes method messages.savePreparedInlineMessage#f21f7f2f returning error if any. +// Save a prepared inline message¹, to be shared by the user of the mini app using a +// web_app_send_prepared_message event² +// +// Links: +// 1. https://core.telegram.org/api/bots/inline#21-using-a-prepared-inline-message +// 2. https://core.telegram.org/api/web-events#web-app-send-prepared-message +// +// Possible errors: +// +// 400 RESULT_ID_INVALID: One of the specified result IDs is invalid. +// 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/messages.savePreparedInlineMessage for reference. +// Can be used by bots. func (c *Client) MessagesSavePreparedInlineMessage(ctx context.Context, request *MessagesSavePreparedInlineMessageRequest) (*MessagesBotPreparedInlineMessage, error) { var result MessagesBotPreparedInlineMessage diff --git a/tg/tl_messages_search_gen.go b/tg/tl_messages_search_gen.go index a4efc958a9..a2c260447f 100644 --- a/tg/tl_messages_search_gen.go +++ b/tg/tl_messages_search_gen.go @@ -93,7 +93,7 @@ type MessagesSearchRequest struct { // Links: // 1) https://core.telegram.org/api/offsets AddOffset int - // Number of results to return¹ + // Number of results to return¹, can be 0 to only return the message counter. // // Links: // 1) https://core.telegram.org/api/offsets diff --git a/tg/tl_messages_search_global_gen.go b/tg/tl_messages_search_global_gen.go index 153dfdfb83..1183e7825e 100644 --- a/tg/tl_messages_search_global_gen.go +++ b/tg/tl_messages_search_global_gen.go @@ -47,9 +47,9 @@ type MessagesSearchGlobalRequest struct { // Links: // 1) https://core.telegram.org/api/search#global-search BroadcastsOnly bool - // GroupsOnly field of MessagesSearchGlobalRequest. + // Whether to search only in groups GroupsOnly bool - // UsersOnly field of MessagesSearchGlobalRequest. + // Whether to search only in private chats UsersOnly bool // Peer folder ID, for more info click here¹ // diff --git a/tg/tl_messages_search_stickers_gen.go b/tg/tl_messages_search_stickers_gen.go index 4b453f1ac7..526b46e9ba 100644 --- a/tg/tl_messages_search_stickers_gen.go +++ b/tg/tl_messages_search_stickers_gen.go @@ -32,24 +32,43 @@ var ( ) // MessagesSearchStickersRequest represents TL type `messages.searchStickers#29b1c66a`. +// Search for stickers using AI-powered keyword search // // See https://core.telegram.org/method/messages.searchStickers for reference. type MessagesSearchStickersRequest struct { - // Flags field of MessagesSearchStickersRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Emojis field of MessagesSearchStickersRequest. + // If set, returns custom emoji stickers¹ + // + // Links: + // 1) https://core.telegram.org/api/custom-emoji Emojis bool - // Q field of MessagesSearchStickersRequest. + // The search term Q string - // Emoticon field of MessagesSearchStickersRequest. + // Space-separated list of emojis to search for Emoticon string - // LangCode field of MessagesSearchStickersRequest. + // List of possible IETF language tags of the user's input language; may be empty if + // unknown LangCode []string - // Offset field of MessagesSearchStickersRequest. + // Offset for pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Offset int - // Limit field of MessagesSearchStickersRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int - // Hash field of MessagesSearchStickersRequest. + // Hash used for caching, for more info click here¹. The hash may be generated locally + // by using the ids of the returned or stored sticker document²s. + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation + // 2) https://core.telegram.org/constructor/document Hash int64 } @@ -362,6 +381,7 @@ func (s *MessagesSearchStickersRequest) GetHash() (value int64) { } // MessagesSearchStickers invokes method messages.searchStickers#29b1c66a returning error if any. +// Search for stickers using AI-powered keyword search // // See https://core.telegram.org/method/messages.searchStickers for reference. func (c *Client) MessagesSearchStickers(ctx context.Context, request *MessagesSearchStickersRequest) (MessagesFoundStickersClass, error) { diff --git a/tg/tl_messages_send_bot_requested_peer_gen.go b/tg/tl_messages_send_bot_requested_peer_gen.go index b75ad9cc09..5b64459bc9 100644 --- a/tg/tl_messages_send_bot_requested_peer_gen.go +++ b/tg/tl_messages_send_bot_requested_peer_gen.go @@ -291,6 +291,7 @@ func (s *MessagesSendBotRequestedPeerRequest) MapRequestedPeers() (value InputPe // // 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/messages.sendBotRequestedPeer for reference. diff --git a/tg/tl_messages_send_media_gen.go b/tg/tl_messages_send_media_gen.go index c6f8f576f5..3fc062746b 100644 --- a/tg/tl_messages_send_media_gen.go +++ b/tg/tl_messages_send_media_gen.go @@ -934,6 +934,8 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 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 BUSINESS_PEER_INVALID: Messages can't be set to the specified peer through the current business connection. +// 400 BUTTON_COPY_TEXT_INVALID: The specified keyboardButtonCopy.copy_text is invalid. // 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. @@ -960,6 +962,7 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 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 EXTENDED_MEDIA_AMOUNT_INVALID: The specified stars_amount of the passed inputMediaPaidMedia is invalid. // 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. @@ -969,6 +972,7 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 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 INVOICE_PAYLOAD_INVALID: The specified invoice payload is invalid. // 400 MD5_CHECKSUM_INVALID: The MD5 checksums do not match. // 400 MEDIA_CAPTION_TOO_LONG: The caption is too long. // 400 MEDIA_EMPTY: The provided media object is invalid. @@ -1003,7 +1007,10 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 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 STARS_INVOICE_INVALID: The specified Telegram Star invoice is invalid. // 400 STORY_ID_INVALID: The specified story ID is invalid. +// 400 SUBSCRIPTION_EXPORT_MISSING: You cannot send a bot subscription invoice directly, you may only create invoice links using payments.exportInvoice. +// 400 TERMS_URL_INVALID: The specified invoice.terms_url 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 688c7d83ce..be72e39f07 100644 --- a/tg/tl_messages_send_message_gen.go +++ b/tg/tl_messages_send_message_gen.go @@ -938,7 +938,10 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // 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 BUSINESS_PEER_USAGE_MISSING: You cannot send a message to a user through a business connection if the user hasn't recently contacted us. +// 400 BUTTON_COPY_TEXT_INVALID: The specified keyboardButtonCopy.copy_text is invalid. // 400 BUTTON_DATA_INVALID: The data of one or more of the buttons you provided is invalid. +// 400 BUTTON_ID_INVALID: The specified button ID 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. // 400 BUTTON_USER_INVALID: The user_id passed to inputKeyboardButtonUserProfile is invalid! @@ -963,9 +966,10 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // 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 ». -// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 404 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. +// 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 QUOTE_TEXT_INVALID: The specified reply_to.quote_text field is invalid. diff --git a/tg/tl_messages_send_multi_media_gen.go b/tg/tl_messages_send_multi_media_gen.go index a2eb8744a8..28d0738d40 100644 --- a/tg/tl_messages_send_multi_media_gen.go +++ b/tg/tl_messages_send_multi_media_gen.go @@ -767,6 +767,7 @@ func (s *MessagesSendMultiMediaRequest) GetEffect() (value int64, ok bool) { // // Possible errors: // +// 400 BUSINESS_PEER_INVALID: Messages can't be set to the specified peer through the current business connection. // 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. @@ -781,12 +782,14 @@ func (s *MessagesSendMultiMediaRequest) GetEffect() (value int64, ok bool) { // 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 MSG_ID_INVALID: Invalid message ID provided. // 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 REPLY_TO_INVALID: The specified reply_to field is invalid. // 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_paid_reaction_gen.go b/tg/tl_messages_send_paid_reaction_gen.go index 2ec997f5a1..50d50ba133 100644 --- a/tg/tl_messages_send_paid_reaction_gen.go +++ b/tg/tl_messages_send_paid_reaction_gen.go @@ -346,8 +346,11 @@ func (s *MessagesSendPaidReactionRequest) GetPrivate() (value bool, ok bool) { // 1. https://core.telegram.org/api/reactions#paid-reactions // 2. https://core.telegram.org/api/stars // +// Possible errors: +// +// 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// // See https://core.telegram.org/method/messages.sendPaidReaction for reference. -// Can be used by bots. func (c *Client) MessagesSendPaidReaction(ctx context.Context, request *MessagesSendPaidReactionRequest) (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 1fe8b94795..16eaf12ef6 100644 --- a/tg/tl_messages_set_default_history_ttl_gen.go +++ b/tg/tl_messages_set_default_history_ttl_gen.go @@ -36,7 +36,7 @@ var ( // // See https://core.telegram.org/method/messages.setDefaultHistoryTTL for reference. type MessagesSetDefaultHistoryTTLRequest struct { - // The new default Time-To-Live of all messages sent in new chats. + // The new default Time-To-Live of all messages sent in new chats, in seconds. Period int } diff --git a/tg/tl_messages_set_inline_bot_results_gen.go b/tg/tl_messages_set_inline_bot_results_gen.go index 89bfb96615..db2e2e0bac 100644 --- a/tg/tl_messages_set_inline_bot_results_gen.go +++ b/tg/tl_messages_set_inline_bot_results_gen.go @@ -502,6 +502,7 @@ func (s *MessagesSetInlineBotResultsRequest) MapResults() (value InputBotInlineR // 400 MESSAGE_EMPTY: The provided message is empty. // 400 MESSAGE_TOO_LONG: The provided message is too long. // 400 NEXT_OFFSET_INVALID: The specified offset is longer than 64 bytes. +// 400 PEER_TYPES_INVALID: The passed keyboardButtonSwitchInline.peer_types field is invalid. // 400 PHOTO_CONTENT_TYPE_INVALID: Photo mime-type invalid. // 400 PHOTO_CONTENT_URL_EMPTY: Photo URL invalid. // 400 PHOTO_INVALID: Photo invalid. @@ -522,6 +523,7 @@ func (s *MessagesSetInlineBotResultsRequest) MapResults() (value InputBotInlineR // 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_CONTENT_TYPE_INVALID: The video's content type is invalid. // 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_set_typing_gen.go b/tg/tl_messages_set_typing_gen.go index 37bc2692f1..f69d8a6e7d 100644 --- a/tg/tl_messages_set_typing_gen.go +++ b/tg/tl_messages_set_typing_gen.go @@ -283,6 +283,8 @@ func (s *MessagesSetTypingRequest) GetAction() (value SendMessageActionClass) { // // Possible errors: // +// 400 BUSINESS_PEER_INVALID: Messages can't be set to the specified peer through the current business connection. +// 400 BUSINESS_PEER_USAGE_MISSING: You cannot send a message to a user through a business connection if the user hasn't recently contacted us. // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. diff --git a/tg/tl_messages_toggle_paid_reaction_privacy_gen.go b/tg/tl_messages_toggle_paid_reaction_privacy_gen.go index 6109085505..ec7e81f7c8 100644 --- a/tg/tl_messages_toggle_paid_reaction_privacy_gen.go +++ b/tg/tl_messages_toggle_paid_reaction_privacy_gen.go @@ -230,8 +230,11 @@ func (t *MessagesTogglePaidReactionPrivacyRequest) GetPrivate() (value bool) { // Links: // 1. https://core.telegram.org/api/reactions#paid-reactions // +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// // See https://core.telegram.org/method/messages.togglePaidReactionPrivacy for reference. -// Can be used by bots. func (c *Client) MessagesTogglePaidReactionPrivacy(ctx context.Context, request *MessagesTogglePaidReactionPrivacyRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_translate_text_gen.go b/tg/tl_messages_translate_text_gen.go index 147e8c5641..b0b3f3d9dd 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. +// 500 TRANSLATE_REQ_FAILED: Translation failed, please try again later. // 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. diff --git a/tg/tl_messages_upload_imported_media_gen.go b/tg/tl_messages_upload_imported_media_gen.go index 03e89d2d46..93c163a80d 100644 --- a/tg/tl_messages_upload_imported_media_gen.go +++ b/tg/tl_messages_upload_imported_media_gen.go @@ -269,6 +269,7 @@ func (u *MessagesUploadImportedMediaRequest) GetMedia() (value InputMediaClass) // // 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. +// 400 MEDIA_INVALID: Media 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 ba7a72c165..b09f1e4b23 100644 --- a/tg/tl_messages_upload_media_gen.go +++ b/tg/tl_messages_upload_media_gen.go @@ -300,6 +300,7 @@ func (u *MessagesUploadMediaRequest) GetMedia() (value InputMediaClass) { // 400 PHOTO_INVALID_DIMENSIONS: The photo dimensions are invalid. // 400 PHOTO_SAVE_FILE_INVALID: Internal issues, try again later. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. +// 400 VOICE_MESSAGES_FORBIDDEN: This user's privacy settings forbid you from sending voice messages. // 400 WEBPAGE_CURL_FAILED: Failure while fetching the webpage with cURL. // // See https://core.telegram.org/method/messages.uploadMedia for reference. diff --git a/tg/tl_messages_view_sponsored_message_gen.go b/tg/tl_messages_view_sponsored_message_gen.go index 53b08d40b5..58728a1cfb 100644 --- a/tg/tl_messages_view_sponsored_message_gen.go +++ b/tg/tl_messages_view_sponsored_message_gen.go @@ -203,7 +203,6 @@ func (v *MessagesViewSponsoredMessageRequest) GetRandomID() (value []byte) { // 1. https://core.telegram.org/api/sponsored-messages // // See https://core.telegram.org/method/messages.viewSponsoredMessage for reference. -// Can be used by bots. func (c *Client) MessagesViewSponsoredMessage(ctx context.Context, request *MessagesViewSponsoredMessageRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_bot_cancel_stars_subscription_gen.go b/tg/tl_payments_bot_cancel_stars_subscription_gen.go index 64cdbd6c97..3a77033b88 100644 --- a/tg/tl_payments_bot_cancel_stars_subscription_gen.go +++ b/tg/tl_payments_bot_cancel_stars_subscription_gen.go @@ -32,16 +32,34 @@ var ( ) // PaymentsBotCancelStarsSubscriptionRequest represents TL type `payments.botCancelStarsSubscription#6dfa0622`. +// Cancel a bot subscription¹ +// +// Links: +// 1. https://core.telegram.org/api/subscriptions#bot-subscriptions // // See https://core.telegram.org/method/payments.botCancelStarsSubscription for reference. type PaymentsBotCancelStarsSubscriptionRequest struct { - // Flags field of PaymentsBotCancelStarsSubscriptionRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Restore field of PaymentsBotCancelStarsSubscriptionRequest. + // If not set, disables autorenewal of the subscriptions, and prevents the user from + // reactivating the subscription once the current period expires: a subscription + // cancelled by the bot will have the starsSubscription¹.bot_canceled flag set. The bot + // can can partially undo this operation by setting this flag: this will allow the user + // to reactivate the subscription. + // + // Links: + // 1) https://core.telegram.org/constructor/starsSubscription Restore bool - // UserID field of PaymentsBotCancelStarsSubscriptionRequest. + // The ID of the user whose subscription should be (un)cancelled UserID InputUserClass - // ChargeID field of PaymentsBotCancelStarsSubscriptionRequest. + // The provider_charge_id from the messageActionPaymentSentMe¹ service message sent to + // the bot for the first subscription payment. + // + // Links: + // 1) https://core.telegram.org/constructor/messageActionPaymentSentMe ChargeID string } @@ -246,6 +264,14 @@ func (b *PaymentsBotCancelStarsSubscriptionRequest) GetChargeID() (value string) } // PaymentsBotCancelStarsSubscription invokes method payments.botCancelStarsSubscription#6dfa0622 returning error if any. +// Cancel a bot subscription¹ +// +// Links: +// 1. https://core.telegram.org/api/subscriptions#bot-subscriptions +// +// Possible errors: +// +// 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/payments.botCancelStarsSubscription for reference. func (c *Client) PaymentsBotCancelStarsSubscription(ctx context.Context, request *PaymentsBotCancelStarsSubscriptionRequest) (bool, error) { diff --git a/tg/tl_payments_change_stars_subscription_gen.go b/tg/tl_payments_change_stars_subscription_gen.go index 4614a044ce..006b363a4d 100644 --- a/tg/tl_payments_change_stars_subscription_gen.go +++ b/tg/tl_payments_change_stars_subscription_gen.go @@ -274,8 +274,11 @@ func (c *PaymentsChangeStarsSubscriptionRequest) GetCanceled() (value bool, ok b // Links: // 1. https://core.telegram.org/api/invites#paid-invite-links // +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// // See https://core.telegram.org/method/payments.changeStarsSubscription for reference. -// Can be used by bots. func (c *Client) PaymentsChangeStarsSubscription(ctx context.Context, request *PaymentsChangeStarsSubscriptionRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_connect_star_ref_bot_gen.go b/tg/tl_payments_connect_star_ref_bot_gen.go index 2441e355d6..a3d667ad33 100644 --- a/tg/tl_payments_connect_star_ref_bot_gen.go +++ b/tg/tl_payments_connect_star_ref_bot_gen.go @@ -32,12 +32,17 @@ var ( ) // PaymentsConnectStarRefBotRequest represents TL type `payments.connectStarRefBot#7ed5348a`. +// Join a bot's affiliate program, becoming an affiliate »¹ +// +// Links: +// 1. https://core.telegram.org/api/bots/referrals#becoming-an-affiliate // // See https://core.telegram.org/method/payments.connectStarRefBot for reference. type PaymentsConnectStarRefBotRequest struct { - // Peer field of PaymentsConnectStarRefBotRequest. + // The peer that will become the affiliate: star commissions will be transferred to this + // peer's star balance. Peer InputPeerClass - // Bot field of PaymentsConnectStarRefBotRequest. + // The bot that offers the affiliate program Bot InputUserClass } @@ -198,6 +203,10 @@ func (c *PaymentsConnectStarRefBotRequest) GetBot() (value InputUserClass) { } // PaymentsConnectStarRefBot invokes method payments.connectStarRefBot#7ed5348a returning error if any. +// Join a bot's affiliate program, becoming an affiliate »¹ +// +// Links: +// 1. https://core.telegram.org/api/bots/referrals#becoming-an-affiliate // // See https://core.telegram.org/method/payments.connectStarRefBot for reference. func (c *Client) PaymentsConnectStarRefBot(ctx context.Context, request *PaymentsConnectStarRefBotRequest) (*PaymentsConnectedStarRefBots, error) { diff --git a/tg/tl_payments_connected_star_ref_bots_gen.go b/tg/tl_payments_connected_star_ref_bots_gen.go index d15b699754..d59cebf4af 100644 --- a/tg/tl_payments_connected_star_ref_bots_gen.go +++ b/tg/tl_payments_connected_star_ref_bots_gen.go @@ -32,14 +32,18 @@ var ( ) // PaymentsConnectedStarRefBots represents TL type `payments.connectedStarRefBots#98d5ea1d`. +// Active affiliations¹ +// +// Links: +// 1. https://core.telegram.org/api/bots/referrals#becoming-an-affiliate // // See https://core.telegram.org/constructor/payments.connectedStarRefBots for reference. type PaymentsConnectedStarRefBots struct { - // Count field of PaymentsConnectedStarRefBots. + // Total number of active affiliations Count int - // ConnectedBots field of PaymentsConnectedStarRefBots. + // The affiliations ConnectedBots []ConnectedBotStarRef - // Users field of PaymentsConnectedStarRefBots. + // Peers mentioned in connected_bots Users []UserClass } diff --git a/tg/tl_payments_convert_star_gift_gen.go b/tg/tl_payments_convert_star_gift_gen.go index eac8ca205c..e9c7ed654b 100644 --- a/tg/tl_payments_convert_star_gift_gen.go +++ b/tg/tl_payments_convert_star_gift_gen.go @@ -192,8 +192,11 @@ func (c *PaymentsConvertStarGiftRequest) GetMsgID() (value int) { // 4. https://core.telegram.org/constructor/starGift // 5. https://core.telegram.org/constructor/starGift // +// Possible errors: +// +// 400 USER_ID_INVALID: The provided user ID is invalid. +// // See https://core.telegram.org/method/payments.convertStarGift for reference. -// Can be used by bots. func (c *Client) PaymentsConvertStarGift(ctx context.Context, msgid int) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_edit_connected_star_ref_bot_gen.go b/tg/tl_payments_edit_connected_star_ref_bot_gen.go index fc95a8d97a..ca4bd907f3 100644 --- a/tg/tl_payments_edit_connected_star_ref_bot_gen.go +++ b/tg/tl_payments_edit_connected_star_ref_bot_gen.go @@ -32,16 +32,23 @@ var ( ) // PaymentsEditConnectedStarRefBotRequest represents TL type `payments.editConnectedStarRefBot#e4fca4a3`. +// Leave a bot's affiliate program »¹ +// +// Links: +// 1. https://core.telegram.org/api/bots/referrals#becoming-an-affiliate // // See https://core.telegram.org/method/payments.editConnectedStarRefBot for reference. type PaymentsEditConnectedStarRefBotRequest struct { - // Flags field of PaymentsEditConnectedStarRefBotRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Revoked field of PaymentsEditConnectedStarRefBotRequest. + // If set, leaves the bot's affiliate program Revoked bool - // Peer field of PaymentsEditConnectedStarRefBotRequest. + // The peer that was affiliated Peer InputPeerClass - // Link field of PaymentsEditConnectedStarRefBotRequest. + // The affiliate link to revoke Link string } @@ -246,6 +253,14 @@ func (e *PaymentsEditConnectedStarRefBotRequest) GetLink() (value string) { } // PaymentsEditConnectedStarRefBot invokes method payments.editConnectedStarRefBot#e4fca4a3 returning error if any. +// Leave a bot's affiliate program »¹ +// +// Links: +// 1. https://core.telegram.org/api/bots/referrals#becoming-an-affiliate +// +// Possible errors: +// +// 400 STARREF_HASH_REVOKED: The specified affiliate link was already revoked. // // See https://core.telegram.org/method/payments.editConnectedStarRefBot for reference. func (c *Client) PaymentsEditConnectedStarRefBot(ctx context.Context, request *PaymentsEditConnectedStarRefBotRequest) (*PaymentsConnectedStarRefBots, error) { diff --git a/tg/tl_payments_export_invoice_gen.go b/tg/tl_payments_export_invoice_gen.go index 463a443fb3..8646b11a45 100644 --- a/tg/tl_payments_export_invoice_gen.go +++ b/tg/tl_payments_export_invoice_gen.go @@ -181,6 +181,9 @@ func (e *PaymentsExportInvoiceRequest) GetInvoiceMedia() (value InputMediaClass) // 400 INVOICE_PAYLOAD_INVALID: The specified invoice payload is invalid. // 400 MEDIA_INVALID: Media invalid. // 400 PAYMENT_PROVIDER_INVALID: The specified payment provider is invalid. +// 400 STARS_INVOICE_INVALID: The specified Telegram Star invoice is invalid. +// 400 WEBDOCUMENT_MIME_INVALID: Invalid webdocument mime type provided. +// 400 WEBDOCUMENT_URL_EMPTY: The passed web document URL is empty. // // See https://core.telegram.org/method/payments.exportInvoice for reference. // Can be used by bots. diff --git a/tg/tl_payments_fulfill_stars_subscription_gen.go b/tg/tl_payments_fulfill_stars_subscription_gen.go index df30124824..7b75f4ff7a 100644 --- a/tg/tl_payments_fulfill_stars_subscription_gen.go +++ b/tg/tl_payments_fulfill_stars_subscription_gen.go @@ -205,8 +205,11 @@ func (f *PaymentsFulfillStarsSubscriptionRequest) GetSubscriptionID() (value str // Links: // 1. https://core.telegram.org/api/invites#paid-invite-links // +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// // See https://core.telegram.org/method/payments.fulfillStarsSubscription for reference. -// Can be used by bots. func (c *Client) PaymentsFulfillStarsSubscription(ctx context.Context, request *PaymentsFulfillStarsSubscriptionRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_get_connected_star_ref_bot_gen.go b/tg/tl_payments_get_connected_star_ref_bot_gen.go index 90ded662ca..529cad0bf5 100644 --- a/tg/tl_payments_get_connected_star_ref_bot_gen.go +++ b/tg/tl_payments_get_connected_star_ref_bot_gen.go @@ -32,12 +32,16 @@ var ( ) // PaymentsGetConnectedStarRefBotRequest represents TL type `payments.getConnectedStarRefBot#b7d998f0`. +// Fetch info about a specific bot affiliation »¹ +// +// Links: +// 1. https://core.telegram.org/api/bots/referrals // // See https://core.telegram.org/method/payments.getConnectedStarRefBot for reference. type PaymentsGetConnectedStarRefBotRequest struct { - // Peer field of PaymentsGetConnectedStarRefBotRequest. + // The affiliated peer Peer InputPeerClass - // Bot field of PaymentsGetConnectedStarRefBotRequest. + // The bot that offers the affiliate program Bot InputUserClass } @@ -198,6 +202,14 @@ func (g *PaymentsGetConnectedStarRefBotRequest) GetBot() (value InputUserClass) } // PaymentsGetConnectedStarRefBot invokes method payments.getConnectedStarRefBot#b7d998f0 returning error if any. +// Fetch info about a specific bot affiliation »¹ +// +// Links: +// 1. https://core.telegram.org/api/bots/referrals +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.getConnectedStarRefBot for reference. func (c *Client) PaymentsGetConnectedStarRefBot(ctx context.Context, request *PaymentsGetConnectedStarRefBotRequest) (*PaymentsConnectedStarRefBots, error) { diff --git a/tg/tl_payments_get_connected_star_ref_bots_gen.go b/tg/tl_payments_get_connected_star_ref_bots_gen.go index 1a6b079828..6e02fc4e7e 100644 --- a/tg/tl_payments_get_connected_star_ref_bots_gen.go +++ b/tg/tl_payments_get_connected_star_ref_bots_gen.go @@ -32,22 +32,34 @@ var ( ) // PaymentsGetConnectedStarRefBotsRequest represents TL type `payments.getConnectedStarRefBots#5869a553`. +// Fetch all affiliations we have created for a certain peer // // See https://core.telegram.org/method/payments.getConnectedStarRefBots for reference. type PaymentsGetConnectedStarRefBotsRequest struct { - // Flags field of PaymentsGetConnectedStarRefBotsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Peer field of PaymentsGetConnectedStarRefBotsRequest. + // The affiliated peer Peer InputPeerClass - // OffsetDate field of PaymentsGetConnectedStarRefBotsRequest. + // If set, returns only results older than the specified unixtime // // Use SetOffsetDate and GetOffsetDate helpers. OffsetDate int - // OffsetLink field of PaymentsGetConnectedStarRefBotsRequest. + // Offset for pagination¹, taken from the last returned connectedBotStarRef².url + // (initially empty) + // + // Links: + // 1) https://core.telegram.org/api/offsets + // 2) https://core.telegram.org/constructor/connectedBotStarRef // // Use SetOffsetLink and GetOffsetLink helpers. OffsetLink string - // Limit field of PaymentsGetConnectedStarRefBotsRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -307,6 +319,7 @@ func (g *PaymentsGetConnectedStarRefBotsRequest) GetLimit() (value int) { } // PaymentsGetConnectedStarRefBots invokes method payments.getConnectedStarRefBots#5869a553 returning error if any. +// Fetch all affiliations we have created for a certain peer // // See https://core.telegram.org/method/payments.getConnectedStarRefBots for reference. func (c *Client) PaymentsGetConnectedStarRefBots(ctx context.Context, request *PaymentsGetConnectedStarRefBotsRequest) (*PaymentsConnectedStarRefBots, error) { diff --git a/tg/tl_payments_get_payment_form_gen.go b/tg/tl_payments_get_payment_form_gen.go index 610dd53b7e..922e54db2a 100644 --- a/tg/tl_payments_get_payment_form_gen.go +++ b/tg/tl_payments_get_payment_form_gen.go @@ -43,11 +43,10 @@ type PaymentsGetPaymentFormRequest struct { Flags bin.Fields // Invoice Invoice InputInvoiceClass - // A JSON object with the following keys, containing color theme information (integers, - // RGB24) to pass to the payment provider, to apply in eventual verification pages: - // bg_color - Background color text_color - Text color hint_color - Hint text color - // link_color - Link color button_color - Button color button_text_color - Button text - // color + // Theme parameters »¹ + // + // Links: + // 1) https://core.telegram.org/api/bots/webapps#theme-parameters // // Use SetThemeParams and GetThemeParams helpers. ThemeParams DataJSON @@ -245,9 +244,11 @@ func (g *PaymentsGetPaymentFormRequest) GetThemeParams() (value DataJSON, ok boo // Possible errors: // // 400 BOOST_PEER_INVALID: The specified boost_peer is invalid. +// 400 BOT_INVOICE_INVALID: The specified invoice 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 STARGIFT_INVALID: The passed inputInvoiceStarGift is invalid. // 400 UNTIL_DATE_INVALID: Invalid until date provided. // // See https://core.telegram.org/method/payments.getPaymentForm for reference. diff --git a/tg/tl_payments_get_star_gifts_gen.go b/tg/tl_payments_get_star_gifts_gen.go index d8cd81e73c..1ed10c7104 100644 --- a/tg/tl_payments_get_star_gifts_gen.go +++ b/tg/tl_payments_get_star_gifts_gen.go @@ -39,10 +39,12 @@ var ( // // See https://core.telegram.org/method/payments.getStarGifts for reference. type PaymentsGetStarGiftsRequest struct { - // Hash used for caching, for more info click here¹. + // Hash used for caching, for more info click here¹.The hash may be generated locally by + // using the ids of the returned or stored sticker starGift²s. // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation + // 2) https://core.telegram.org/constructor/starGift Hash int } @@ -174,7 +176,6 @@ func (g *PaymentsGetStarGiftsRequest) GetHash() (value int) { // 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/method/payments.getStarGifts for reference. -// Can be used by bots. func (c *Client) PaymentsGetStarGifts(ctx context.Context, hash int) (PaymentsStarGiftsClass, error) { var result PaymentsStarGiftsBox diff --git a/tg/tl_payments_get_stars_gift_options_gen.go b/tg/tl_payments_get_stars_gift_options_gen.go index eaabf22c4e..daab08ca1b 100644 --- a/tg/tl_payments_get_stars_gift_options_gen.go +++ b/tg/tl_payments_get_stars_gift_options_gen.go @@ -219,6 +219,11 @@ func (g *PaymentsGetStarsGiftOptionsRequest) GetUserID() (value InputUserClass, // 1. https://core.telegram.org/api/stars#buying-or-gifting-stars // 2. https://core.telegram.org/constructor/starsGiftOption // +// Possible errors: +// +// 400 USER_GIFT_UNAVAILABLE: Gifts are not available in the current region (stars_gifts_enabled is equal to false). +// 400 USER_ID_INVALID: The provided user ID is invalid. +// // See https://core.telegram.org/method/payments.getStarsGiftOptions for reference. func (c *Client) PaymentsGetStarsGiftOptions(ctx context.Context, request *PaymentsGetStarsGiftOptionsRequest) ([]StarsGiftOption, error) { var result StarsGiftOptionVector diff --git a/tg/tl_payments_get_stars_giveaway_options_gen.go b/tg/tl_payments_get_stars_giveaway_options_gen.go index e7e037303c..fd0405d533 100644 --- a/tg/tl_payments_get_stars_giveaway_options_gen.go +++ b/tg/tl_payments_get_stars_giveaway_options_gen.go @@ -138,7 +138,6 @@ func (g *PaymentsGetStarsGiveawayOptionsRequest) DecodeBare(b *bin.Buffer) error // 1. https://core.telegram.org/api/giveaways#star-giveaways // // See https://core.telegram.org/method/payments.getStarsGiveawayOptions for reference. -// Can be used by bots. func (c *Client) PaymentsGetStarsGiveawayOptions(ctx context.Context) ([]StarsGiveawayOption, error) { var result StarsGiveawayOptionVector 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 e166cf9c32..ae23a09695 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 @@ -181,6 +181,7 @@ func (g *PaymentsGetStarsRevenueAdsAccountURLRequest) GetPeer() (value InputPeer // // Possible errors: // +// 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.getStarsRevenueAdsAccountUrl for reference. 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 e994d32a88..922569d8a4 100644 --- a/tg/tl_payments_get_stars_revenue_withdrawal_url_gen.go +++ b/tg/tl_payments_get_stars_revenue_withdrawal_url_gen.go @@ -35,7 +35,7 @@ var ( // Withdraw funds from a channel or bot's star balance »¹. // // Links: -// 1. https://core.telegram.org/api/stars#withdrawing-revenue +// 1. https://core.telegram.org/api/stars#withdrawing-stars // // See https://core.telegram.org/method/payments.getStarsRevenueWithdrawalUrl for reference. type PaymentsGetStarsRevenueWithdrawalURLRequest struct { @@ -240,13 +240,14 @@ func (g *PaymentsGetStarsRevenueWithdrawalURLRequest) GetPasswordAsNotEmpty() (* // Withdraw funds from a channel or bot's star balance »¹. // // Links: -// 1. https://core.telegram.org/api/stars#withdrawing-revenue +// 1. https://core.telegram.org/api/stars#withdrawing-stars // // 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. +// 400 SESSION_TOO_FRESH_%d: This session was created 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_subscriptions_gen.go b/tg/tl_payments_get_stars_subscriptions_gen.go index ef88f22452..7f6fd0e37a 100644 --- a/tg/tl_payments_get_stars_subscriptions_gen.go +++ b/tg/tl_payments_get_stars_subscriptions_gen.go @@ -265,8 +265,11 @@ func (g *PaymentsGetStarsSubscriptionsRequest) GetOffset() (value string) { // Links: // 1. https://core.telegram.org/api/invites#paid-invite-links // +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// // See https://core.telegram.org/method/payments.getStarsSubscriptions for reference. -// Can be used by bots. func (c *Client) PaymentsGetStarsSubscriptions(ctx context.Context, request *PaymentsGetStarsSubscriptionsRequest) (*PaymentsStarsStatus, error) { var result PaymentsStarsStatus 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 c6e3e5b1a3..18418d1730 100644 --- a/tg/tl_payments_get_stars_transactions_by_id_gen.go +++ b/tg/tl_payments_get_stars_transactions_by_id_gen.go @@ -220,6 +220,7 @@ func (g *PaymentsGetStarsTransactionsByIDRequest) GetID() (value []InputStarsTra // Possible errors: // // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 TRANSACTION_ID_INVALID: The specified transaction 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_suggested_star_ref_bots_gen.go b/tg/tl_payments_get_suggested_star_ref_bots_gen.go index 1fbfc8ca43..390f7cfcdd 100644 --- a/tg/tl_payments_get_suggested_star_ref_bots_gen.go +++ b/tg/tl_payments_get_suggested_star_ref_bots_gen.go @@ -32,20 +32,38 @@ var ( ) // PaymentsGetSuggestedStarRefBotsRequest represents TL type `payments.getSuggestedStarRefBots#d6b48f7`. +// Obtain a list of suggested mini apps¹ with available affiliate programs² +// order_by_revenue and order_by_date are mutually exclusive: if neither is set, results +// are sorted by profitability. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps +// 2. https://core.telegram.org/api/bots/referrals // // See https://core.telegram.org/method/payments.getSuggestedStarRefBots for reference. type PaymentsGetSuggestedStarRefBotsRequest struct { - // Flags field of PaymentsGetSuggestedStarRefBotsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // OrderByRevenue field of PaymentsGetSuggestedStarRefBotsRequest. + // If set, orders results by the expected revenue OrderByRevenue bool - // OrderByDate field of PaymentsGetSuggestedStarRefBotsRequest. + // If set, orders results by the creation date of the affiliate program OrderByDate bool - // Peer field of PaymentsGetSuggestedStarRefBotsRequest. + // The peer that will become the affiliate: star commissions will be transferred to this + // peer's star balance. Peer InputPeerClass - // Offset field of PaymentsGetSuggestedStarRefBotsRequest. + // Offset for pagination, taken from payments.suggestedStarRefBots¹.next_offset, + // initially empty. + // + // Links: + // 1) https://core.telegram.org/constructor/payments.suggestedStarRefBots Offset string - // Limit field of PaymentsGetSuggestedStarRefBotsRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -308,6 +326,17 @@ func (g *PaymentsGetSuggestedStarRefBotsRequest) GetLimit() (value int) { } // PaymentsGetSuggestedStarRefBots invokes method payments.getSuggestedStarRefBots#d6b48f7 returning error if any. +// Obtain a list of suggested mini apps¹ with available affiliate programs² +// order_by_revenue and order_by_date are mutually exclusive: if neither is set, results +// are sorted by profitability. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps +// 2. https://core.telegram.org/api/bots/referrals +// +// Possible errors: +// +// 403 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.getSuggestedStarRefBots for reference. func (c *Client) PaymentsGetSuggestedStarRefBots(ctx context.Context, request *PaymentsGetSuggestedStarRefBotsRequest) (*PaymentsSuggestedStarRefBots, error) { diff --git a/tg/tl_payments_get_user_star_gifts_gen.go b/tg/tl_payments_get_user_star_gifts_gen.go index 5863acb16c..4077e22e48 100644 --- a/tg/tl_payments_get_user_star_gifts_gen.go +++ b/tg/tl_payments_get_user_star_gifts_gen.go @@ -239,8 +239,11 @@ func (g *PaymentsGetUserStarGiftsRequest) GetLimit() (value int) { // Links: // 1. https://core.telegram.org/api/gifts // +// Possible errors: +// +// 400 USER_ID_INVALID: The provided user ID is invalid. +// // See https://core.telegram.org/method/payments.getUserStarGifts for reference. -// Can be used by bots. func (c *Client) PaymentsGetUserStarGifts(ctx context.Context, request *PaymentsGetUserStarGiftsRequest) (*PaymentsUserStarGifts, error) { var result PaymentsUserStarGifts diff --git a/tg/tl_payments_save_star_gift_gen.go b/tg/tl_payments_save_star_gift_gen.go index 829f66e151..d234b4a556 100644 --- a/tg/tl_payments_save_star_gift_gen.go +++ b/tg/tl_payments_save_star_gift_gen.go @@ -230,8 +230,11 @@ func (s *PaymentsSaveStarGiftRequest) GetMsgID() (value int) { // Links: // 1. https://core.telegram.org/api/gifts // +// Possible errors: +// +// 400 USER_ID_INVALID: The provided user ID is invalid. +// // See https://core.telegram.org/method/payments.saveStarGift for reference. -// Can be used by bots. func (c *Client) PaymentsSaveStarGift(ctx context.Context, request *PaymentsSaveStarGiftRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_send_payment_form_gen.go b/tg/tl_payments_send_payment_form_gen.go index 1d6603f0bb..b3a412f902 100644 --- a/tg/tl_payments_send_payment_form_gen.go +++ b/tg/tl_payments_send_payment_form_gen.go @@ -406,6 +406,7 @@ func (s *PaymentsSendPaymentFormRequest) GetTipAmount() (value int64, ok bool) { // // 400 MESSAGE_ID_INVALID: The provided message id is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 TMP_PASSWORD_INVALID: The passed tmp_password 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 a61e9423c8..37f1dbce7a 100644 --- a/tg/tl_payments_send_stars_form_gen.go +++ b/tg/tl_payments_send_stars_form_gen.go @@ -205,8 +205,12 @@ func (s *PaymentsSendStarsFormRequest) GetInvoice() (value InputInvoiceClass) { // Possible errors: // // 400 BALANCE_TOO_LOW: The transaction cannot be completed because the current Telegram Stars balance is too low. +// 400 BOT_INVOICE_INVALID: The specified invoice is invalid. // 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 FORM_ID_EMPTY: The specified form ID is empty. +// 400 FORM_UNSUPPORTED: Please update your client. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 STARGIFT_USAGE_LIMITED: The gift is sold out. // // 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_withdrawal_url_gen.go b/tg/tl_payments_stars_revenue_withdrawal_url_gen.go index 8e3ec4577c..f3ff0bfbd7 100644 --- a/tg/tl_payments_stars_revenue_withdrawal_url_gen.go +++ b/tg/tl_payments_stars_revenue_withdrawal_url_gen.go @@ -35,14 +35,14 @@ var ( // Contains the URL to use to withdraw Telegram Star revenue¹. // // Links: -// 1. https://core.telegram.org/api/stars#withdrawing-revenue +// 1. https://core.telegram.org/api/stars#withdrawing-stars // // See https://core.telegram.org/constructor/payments.starsRevenueWithdrawalUrl for reference. type PaymentsStarsRevenueWithdrawalURL struct { // Contains the URL to use to withdraw Telegram Star revenue¹. // // Links: - // 1) https://core.telegram.org/api/stars#withdrawing-revenue + // 1) https://core.telegram.org/api/stars#withdrawing-stars URL string } diff --git a/tg/tl_payments_suggested_star_ref_bots_gen.go b/tg/tl_payments_suggested_star_ref_bots_gen.go index cf8bd768e4..723c8e7eed 100644 --- a/tg/tl_payments_suggested_star_ref_bots_gen.go +++ b/tg/tl_payments_suggested_star_ref_bots_gen.go @@ -32,18 +32,29 @@ var ( ) // PaymentsSuggestedStarRefBots represents TL type `payments.suggestedStarRefBots#b4d5d859`. +// A list of suggested mini apps¹ with available affiliate programs² +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps +// 2. https://core.telegram.org/api/bots/referrals // // See https://core.telegram.org/constructor/payments.suggestedStarRefBots for reference. type PaymentsSuggestedStarRefBots struct { - // Flags field of PaymentsSuggestedStarRefBots. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Count field of PaymentsSuggestedStarRefBots. + // Total number of results (for pagination) Count int - // SuggestedBots field of PaymentsSuggestedStarRefBots. + // Suggested affiliate programs (full or partial list to be fetched using pagination) SuggestedBots []StarRefProgram - // Users field of PaymentsSuggestedStarRefBots. + // Peers mentioned in suggested_bots Users []UserClass - // NextOffset field of PaymentsSuggestedStarRefBots. + // Next offset for pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets // // Use SetNextOffset and GetNextOffset helpers. NextOffset string diff --git a/tg/tl_phone_create_group_call_gen.go b/tg/tl_phone_create_group_call_gen.go index 6d63cd39dc..8b677da709 100644 --- a/tg/tl_phone_create_group_call_gen.go +++ b/tg/tl_phone_create_group_call_gen.go @@ -361,6 +361,7 @@ func (c *PhoneCreateGroupCallRequest) GetScheduleDate() (value int, ok bool) { // 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 CREATE_CALL_FAILED: An error occurred while creating the call. +// 400 GROUPCALL_ALREADY_DISCARDED: The group call was already discarded. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 SCHEDULE_DATE_INVALID: Invalid schedule date provided. // diff --git a/tg/tl_phone_invite_to_group_call_gen.go b/tg/tl_phone_invite_to_group_call_gen.go index bbc7c8873b..488d6b8b2a 100644 --- a/tg/tl_phone_invite_to_group_call_gen.go +++ b/tg/tl_phone_invite_to_group_call_gen.go @@ -216,6 +216,7 @@ func (i *PhoneInviteToGroupCallRequest) MapUsers() (value InputUserClassArray) { // // Possible errors: // +// 403 CHAT_TYPE_INVALID: The specified user type is invalid. // 403 GROUPCALL_FORBIDDEN: The group call has already ended. // 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. diff --git a/tg/tl_premium_get_boosts_status_gen.go b/tg/tl_premium_get_boosts_status_gen.go index 6d56234049..6226dc8838 100644 --- a/tg/tl_premium_get_boosts_status_gen.go +++ b/tg/tl_premium_get_boosts_status_gen.go @@ -177,6 +177,7 @@ func (g *PremiumGetBoostsStatusRequest) GetPeer() (value InputPeerClass) { // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/premium.getBoostsStatus for reference. diff --git a/tg/tl_privacy_key_gen.go b/tg/tl_privacy_key_gen.go index 74ca91e8a0..12fcb4fd37 100644 --- a/tg/tl_privacy_key_gen.go +++ b/tg/tl_privacy_key_gen.go @@ -1170,6 +1170,10 @@ func (p *PrivacyKeyBirthday) DecodeBare(b *bin.Buffer) error { } // PrivacyKeyStarGiftsAutoSave represents TL type `privacyKeyStarGiftsAutoSave#2ca4fdf8`. +// Whether received gifts¹ will be automatically displayed on our profile +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/privacyKeyStarGiftsAutoSave for reference. type PrivacyKeyStarGiftsAutoSave struct { diff --git a/tg/tl_privacy_rule_gen.go b/tg/tl_privacy_rule_gen.go index 656de16434..1c0fab9ed1 100644 --- a/tg/tl_privacy_rule_gen.go +++ b/tg/tl_privacy_rule_gen.go @@ -1244,6 +1244,7 @@ func (p *PrivacyValueAllowPremium) DecodeBare(b *bin.Buffer) error { } // PrivacyValueAllowBots represents TL type `privacyValueAllowBots#21461b5d`. +// Allow bots and mini apps // // See https://core.telegram.org/constructor/privacyValueAllowBots for reference. type PrivacyValueAllowBots struct { @@ -1345,6 +1346,7 @@ func (p *PrivacyValueAllowBots) DecodeBare(b *bin.Buffer) error { } // PrivacyValueDisallowBots represents TL type `privacyValueDisallowBots#f6a5f82f`. +// Disallow bots and mini apps // // See https://core.telegram.org/constructor/privacyValueDisallowBots for reference. type PrivacyValueDisallowBots struct { diff --git a/tg/tl_restriction_reason_gen.go b/tg/tl_restriction_reason_gen.go index 0aa18b7411..80c532019c 100644 --- a/tg/tl_restriction_reason_gen.go +++ b/tg/tl_restriction_reason_gen.go @@ -38,13 +38,23 @@ var ( // current platform (ios, android, wp, etc.). Platforms can be concatenated (ios-android, // ios-wp), unknown platforms are to be ignored. The text is the error message that // should be shown to the user. +// The restriction_add_platforms »¹ client configuration parameter contains an array of +// platform identifiers that must also be treated as our own, in additional to the one +// hardcoded in the client. +// +// Links: +// 1. https://core.telegram.org/api/config#restriction-add-platforms // // See https://core.telegram.org/constructor/restrictionReason for reference. type RestrictionReason struct { // Platform identifier (ios, android, wp, all, etc.), can be concatenated with a dash as // separator (android-ios, ios-wp, etc) Platform string - // Restriction reason (porno, terms, etc.) + // Restriction reason (porno, terms, etc.). Ignore this restriction reason if it is + // contained in the ignore_restriction_reasons »¹ client configuration parameter. + // + // Links: + // 1) https://core.telegram.org/api/config#ignore-restriction-reasons Reason string // Error message to be shown to the user Text string diff --git a/tg/tl_star_gift_gen.go b/tg/tl_star_gift_gen.go index e093eb69cd..94f31b4f61 100644 --- a/tg/tl_star_gift_gen.go +++ b/tg/tl_star_gift_gen.go @@ -48,7 +48,7 @@ type StarGift struct { Limited bool // Whether this gift sold out and cannot be bought anymore. SoldOut bool - // Birthday field of StarGift. + // Whether this is a birthday-themed gift Birthday bool // Identifier of the gift ID int64 diff --git a/tg/tl_star_ref_program_gen.go b/tg/tl_star_ref_program_gen.go index a5b31fe946..5a1672ab6e 100644 --- a/tg/tl_star_ref_program_gen.go +++ b/tg/tl_star_ref_program_gen.go @@ -32,24 +32,40 @@ var ( ) // StarRefProgram represents TL type `starRefProgram#dd0c66f2`. +// Indo about an affiliate program offered by a bot¹ +// +// Links: +// 1. https://core.telegram.org/api/bots/referrals // // See https://core.telegram.org/constructor/starRefProgram for reference. type StarRefProgram struct { - // Flags field of StarRefProgram. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // BotID field of StarRefProgram. + // ID of the bot that offers the program BotID int64 - // CommissionPermille field of StarRefProgram. + // An affiliate gets a commission of starRefProgram¹.commission_permille‰ Telegram + // Stars² for every mini app transaction made by users they refer + // + // Links: + // 1) https://core.telegram.org/constructor/starRefProgram + // 2) https://core.telegram.org/api/stars CommissionPermille int - // DurationMonths field of StarRefProgram. + // An affiliate gets a commission for every mini app transaction made by users they refer + // for duration_months months after a referral link is imported, starting the bot for + // the first time // // Use SetDurationMonths and GetDurationMonths helpers. DurationMonths int - // EndDate field of StarRefProgram. + // Point in time (Unix timestamp) when the affiliate program will be closed (optional, if + // not set the affiliate program isn't scheduled to be closed) // // Use SetEndDate and GetEndDate helpers. EndDate int - // DailyRevenuePerUser field of StarRefProgram. + // The amount of daily revenue per user in Telegram Stars of the bot that created the + // affiliate program // // Use SetDailyRevenuePerUser and GetDailyRevenuePerUser helpers. DailyRevenuePerUser StarsAmount diff --git a/tg/tl_stars_amount_gen.go b/tg/tl_stars_amount_gen.go index e28aa9ca6f..f58ca854da 100644 --- a/tg/tl_stars_amount_gen.go +++ b/tg/tl_stars_amount_gen.go @@ -32,12 +32,18 @@ var ( ) // StarsAmount represents TL type `starsAmount#bbb6b4a3`. +// Describes a real (i.e. possibly decimal) amount of Telegram Stars¹. +// +// Links: +// 1. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/starsAmount for reference. type StarsAmount struct { - // Amount field of StarsAmount. + // The integer amount of Telegram Stars. Amount int64 - // Nanos field of StarsAmount. + // The decimal amount of Telegram Stars, expressed as nanostars (i.e. 1 nanostar is equal + // to 1/1'000'000'000th of a Telegram Star). This field may also be negative (the allowed + // range is -999999999 to 999999999). Nanos int } diff --git a/tg/tl_stars_revenue_status_gen.go b/tg/tl_stars_revenue_status_gen.go index fc615574b5..360a89a22c 100644 --- a/tg/tl_stars_revenue_status_gen.go +++ b/tg/tl_stars_revenue_status_gen.go @@ -47,7 +47,7 @@ type StarsRevenueStatus struct { // If set, the user may withdraw¹ up to available_balance stars. // // Links: - // 1) https://core.telegram.org/api/stars#withdrawing-revenue + // 1) https://core.telegram.org/api/stars#withdrawing-stars WithdrawalEnabled bool // Amount of not-yet-withdrawn Telegram Stars. CurrentBalance StarsAmount diff --git a/tg/tl_stars_subscription_gen.go b/tg/tl_stars_subscription_gen.go index d4194ba699..181efcd611 100644 --- a/tg/tl_stars_subscription_gen.go +++ b/tg/tl_stars_subscription_gen.go @@ -56,7 +56,10 @@ type StarsSubscription struct { // Whether this subscription has expired because there are not enough stars on the user's // balance to extend it. MissingBalance bool - // BotCanceled field of StarsSubscription. + // Set if this bot subscription¹ was cancelled by the bot + // + // Links: + // 1) https://core.telegram.org/api/subscriptions#bot-subscriptions BotCanceled bool // Subscription ID. ID string @@ -70,15 +73,18 @@ type StarsSubscription struct { // // Use SetChatInviteHash and GetChatInviteHash helpers. ChatInviteHash string - // Title field of StarsSubscription. + // For bot subscriptions, the title of the subscription invoice // // Use SetTitle and GetTitle helpers. Title string - // Photo field of StarsSubscription. + // For bot subscriptions, the photo from the subscription invoice // // Use SetPhoto and GetPhoto helpers. Photo WebDocumentClass - // InvoiceSlug field of StarsSubscription. + // For bot subscriptions, the identifier¹ of the subscription invoice + // + // Links: + // 1) https://core.telegram.org/api/links#invoice-links // // Use SetInvoiceSlug and GetInvoiceSlug helpers. InvoiceSlug string diff --git a/tg/tl_stars_transaction_gen.go b/tg/tl_stars_transaction_gen.go index 9c195fbce8..5e243e4f1f 100644 --- a/tg/tl_stars_transaction_gen.go +++ b/tg/tl_stars_transaction_gen.go @@ -152,15 +152,29 @@ type StarsTransaction struct { // // Use SetFloodskipNumber and GetFloodskipNumber helpers. FloodskipNumber int - // StarrefCommissionPermille field of StarsTransaction. + // This transaction is the receival (or refund) of an affiliate commission¹ (i.e. this + // is the transaction received by the peer that created the referral link², flag 17 is + // for transactions made by users that imported the referral link). + // + // Links: + // 1) https://core.telegram.org/api/bots/referrals + // 2) https://core.telegram.org/api/links#referral-links // // Use SetStarrefCommissionPermille and GetStarrefCommissionPermille helpers. StarrefCommissionPermille int - // StarrefPeer field of StarsTransaction. + // For transactions made by referred users¹, the peer that received the affiliate + // commission. + // + // Links: + // 1) https://core.telegram.org/api/bots/referrals // // Use SetStarrefPeer and GetStarrefPeer helpers. StarrefPeer PeerClass - // StarrefAmount field of StarsTransaction. + // For transactions made by referred users¹, the amount of Telegram Stars received by + // the affiliate, can be negative for refunds. + // + // Links: + // 1) https://core.telegram.org/api/bots/referrals // // Use SetStarrefAmount and GetStarrefAmount helpers. StarrefAmount StarsAmount diff --git a/tg/tl_stats_get_broadcast_revenue_stats_gen.go b/tg/tl_stats_get_broadcast_revenue_stats_gen.go index 3bc6ab9a61..a215f4c0e8 100644 --- a/tg/tl_stats_get_broadcast_revenue_stats_gen.go +++ b/tg/tl_stats_get_broadcast_revenue_stats_gen.go @@ -235,6 +235,7 @@ func (g *StatsGetBroadcastRevenueStatsRequest) GetPeer() (value InputPeerClass) // // 400 CHANNEL_INVALID: The provided channel is invalid. // 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/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 acdac22975..0d4eaa0758 100644 --- a/tg/tl_stats_get_broadcast_revenue_transactions_gen.go +++ b/tg/tl_stats_get_broadcast_revenue_transactions_gen.go @@ -238,6 +238,7 @@ func (g *StatsGetBroadcastRevenueTransactionsRequest) GetLimit() (value int) { // Possible errors: // // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 PEER_ID_INVALID: The provided peer id 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 3dbc5c927f..aa6e118e6d 100644 --- a/tg/tl_stats_get_broadcast_revenue_withdrawal_url_gen.go +++ b/tg/tl_stats_get_broadcast_revenue_withdrawal_url_gen.go @@ -220,6 +220,7 @@ func (g *StatsGetBroadcastRevenueWithdrawalURLRequest) GetPasswordAsNotEmpty() ( // 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. +// 400 SESSION_TOO_FRESH_%d: This session was created 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_stats_get_story_stats_gen.go b/tg/tl_stats_get_story_stats_gen.go index 588b8e4328..837344728a 100644 --- a/tg/tl_stats_get_story_stats_gen.go +++ b/tg/tl_stats_get_story_stats_gen.go @@ -263,6 +263,7 @@ func (g *StatsGetStoryStatsRequest) GetID() (value int) { // Possible errors: // // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 STORIES_NEVER_CREATED: This peer hasn't ever posted any stories. // // See https://core.telegram.org/method/stats.getStoryStats for reference. func (c *Client) StatsGetStoryStats(ctx context.Context, request *StatsGetStoryStatsRequest) (*StatsStoryStats, error) { diff --git a/tg/tl_upload_get_file_gen.go b/tg/tl_upload_get_file_gen.go index ed87c79e6f..a0353a16d3 100644 --- a/tg/tl_upload_get_file_gen.go +++ b/tg/tl_upload_get_file_gen.go @@ -325,6 +325,7 @@ 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_EMPTY: An empty file reference was specified. // 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. diff --git a/tg/tl_upload_save_big_file_part_gen.go b/tg/tl_upload_save_big_file_part_gen.go index 125c1273a1..14e9bb5200 100644 --- a/tg/tl_upload_save_big_file_part_gen.go +++ b/tg/tl_upload_save_big_file_part_gen.go @@ -255,6 +255,7 @@ func (s *UploadSaveBigFilePartRequest) GetBytes() (value []byte) { // 400 FILE_PART_SIZE_CHANGED: Provided file part size has changed. // 400 FILE_PART_SIZE_INVALID: The provided file part size is invalid. // 400 FILE_PART_TOO_BIG: The uploaded file part is too big. +// 400 FILE_PART_TOO_SMALL: The size of the uploaded file part is too small, please see the documentation for the allowed sizes. // // See https://core.telegram.org/method/upload.saveBigFilePart for reference. // Can be used by bots. diff --git a/tg/tl_user_full_gen.go b/tg/tl_user_full_gen.go index 0dcbafe592..f07e17dbbe 100644 --- a/tg/tl_user_full_gen.go +++ b/tg/tl_user_full_gen.go @@ -124,7 +124,10 @@ type UserFull struct { // Links: // 1) https://core.telegram.org/api/revenue#revenue-statistics CanViewRevenue bool - // BotCanManageEmojiStatus field of UserFull. + // If set, this is a bot that can change our emoji status »¹ + // + // Links: + // 1) https://core.telegram.org/api/emoji-status#setting-an-emoji-status-from-a-bot BotCanManageEmojiStatus bool // User ID ID int64 @@ -284,7 +287,10 @@ type UserFull struct { // // Use SetStargiftsCount and GetStargiftsCount helpers. StargiftsCount int - // StarrefProgram field of UserFull. + // This bot has an active referral program »¹ + // + // Links: + // 1) https://core.telegram.org/api/bots/referrals // // Use SetStarrefProgram and GetStarrefProgram helpers. StarrefProgram StarRefProgram diff --git a/tg/tl_web_page_gen.go b/tg/tl_web_page_gen.go index 59a8163b12..b3eb6d4522 100644 --- a/tg/tl_web_page_gen.go +++ b/tg/tl_web_page_gen.go @@ -489,11 +489,12 @@ type WebPage struct { // 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, see here »¹ for a full list. - // - // Links: - // 1) https://github.com/telegramdesktop/tdesktop/blob/4f7a124f3e85f3f61d862b94fb5a45236976f38f/Telegram/SourceFiles/data/data_web_page.cpp#L127 + // Type of the web page. One of the following: - video- gif- photo- document- profile- + // telegram_background- telegram_theme- telegram_story- telegram_channel- + // telegram_channel_request- telegram_megagroup- telegram_chat- + // telegram_megagroup_request- telegram_chat_request- telegram_album- telegram_message- + // telegram_bot- telegram_voicechat- telegram_livestream- telegram_user- telegram_botapp- + // telegram_channel_boost- telegram_group_boost- telegram_giftcode- telegram_stickerset // // 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 8d04f8db01..b34470bebf 100644 --- a/tg/tl_web_view_result_url_gen.go +++ b/tg/tl_web_view_result_url_gen.go @@ -43,7 +43,7 @@ type WebViewResultURL struct { Flags bin.Fields // If set, the app must be opened in fullsize mode instead of compact mode. Fullsize bool - // Fullscreen field of WebViewResultURL. + // If set, the app must be opened in fullscreen Fullscreen bool // Webview session ID (only returned by inline button mini apps¹, menu button mini // apps², attachment menu mini apps³).