From fdb7e7d5079d75e6cd7a636caec4e8d51acef962 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 07:37:58 +0000 Subject: [PATCH 1/2] chore(deps): bump github.com/gotd/getdoc from 0.40.0 to 0.41.0 Bumps [github.com/gotd/getdoc](https://github.com/gotd/getdoc) from 0.40.0 to 0.41.0. - [Release notes](https://github.com/gotd/getdoc/releases) - [Commits](https://github.com/gotd/getdoc/compare/v0.40.0...v0.41.0) --- updated-dependencies: - dependency-name: github.com/gotd/getdoc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index bdb683ada2..4ca486ef0f 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/go-faster/jx v1.1.0 github.com/go-faster/xor v1.0.0 github.com/go-openapi/inflect v0.19.0 - github.com/gotd/getdoc v0.40.0 + github.com/gotd/getdoc v0.41.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 0912d0dcba..d1609d6528 100644 --- a/go.sum +++ b/go.sum @@ -21,8 +21,8 @@ github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNP github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/gotd/getdoc v0.40.0 h1:HS2WPzzDHAj121yDbIHiMF5TwrWzkxDaB/4DmPd2QQM= -github.com/gotd/getdoc v0.40.0/go.mod h1:nJwLqv5cBIre9AfVje+ui4hNEXmCt7OMLtl4I/QZjv8= +github.com/gotd/getdoc v0.41.0 h1:+g/NRA7W7I+S348D+WT3cVsb1VH8yHrHZjVNmKZRmjE= +github.com/gotd/getdoc v0.41.0/go.mod h1:nJwLqv5cBIre9AfVje+ui4hNEXmCt7OMLtl4I/QZjv8= 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= From 3e21cc4efa1678330b814053a06d14d2d28ac933 Mon Sep 17 00:00:00 2001 From: Aleksandr Razumov Date: Mon, 12 Feb 2024 10:41:03 +0300 Subject: [PATCH 2/2] chore(gen): upd --- tg/tl_account_accept_authorization_gen.go | 4 +++ tg/tl_app_web_view_result_url_gen.go | 4 +-- tg/tl_bot_app_gen.go | 8 ++--- tg/tl_channels_check_username_gen.go | 2 ++ tg/tl_channels_edit_forum_topic_gen.go | 1 + ..._channels_update_pinned_forum_topic_gen.go | 4 +++ tg/tl_chatlists_delete_exported_invite_gen.go | 1 + tg/tl_chatlists_edit_exported_invite_gen.go | 1 + tg/tl_chatlists_get_chatlist_updates_gen.go | 1 + ...ists_get_leave_chatlist_suggestions_gen.go | 5 ++++ tg/tl_chatlists_hide_chatlist_updates_gen.go | 5 ++++ tg/tl_chatlists_join_chatlist_updates_gen.go | 5 ++++ tg/tl_contacts_block_from_replies_gen.go | 4 +++ tg/tl_contacts_get_statuses_gen.go | 4 +-- tg/tl_errors_gen.go | 30 +++++++++++++++---- tg/tl_input_bot_app_gen.go | 16 +++++----- tg/tl_message_fwd_header_gen.go | 15 +++++----- tg/tl_messages_bot_app_gen.go | 4 +-- ..._messages_delete_scheduled_messages_gen.go | 4 +++ ...ges_edit_chat_default_banned_rights_gen.go | 1 + tg/tl_messages_get_bot_app_gen.go | 12 ++++---- tg/tl_messages_read_encrypted_history_gen.go | 1 + tg/tl_messages_request_app_web_view_gen.go | 24 +++++++-------- tg/tl_messages_request_web_view_gen.go | 3 +- tg/tl_messages_send_message_gen.go | 4 ++- tg/tl_messages_set_default_history_ttl_gen.go | 4 +++ tg/tl_payments_apply_gift_code_gen.go | 3 +- ...photos_upload_contact_profile_photo_gen.go | 1 + tg/tl_stories_export_story_link_gen.go | 1 + tg/tl_stories_get_stories_by_id_gen.go | 2 +- tg/tl_stories_read_stories_gen.go | 2 +- tg/tl_stories_send_story_gen.go | 1 + tg/tl_user_full_gen.go | 2 +- 33 files changed, 123 insertions(+), 56 deletions(-) diff --git a/tg/tl_account_accept_authorization_gen.go b/tg/tl_account_accept_authorization_gen.go index c49f0557d4..74b40c8322 100644 --- a/tg/tl_account_accept_authorization_gen.go +++ b/tg/tl_account_accept_authorization_gen.go @@ -289,6 +289,10 @@ func (a *AccountAcceptAuthorizationRequest) GetCredentials() (value SecureCreden // Sends a Telegram Passport authorization form, effectively sharing data with the // service // +// Possible errors: +// +// 400 PUBLIC_KEY_REQUIRED: A public key is required. +// // See https://core.telegram.org/method/account.acceptAuthorization for reference. func (c *Client) AccountAcceptAuthorization(ctx context.Context, request *AccountAcceptAuthorizationRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_app_web_view_result_url_gen.go b/tg/tl_app_web_view_result_url_gen.go index f9d8ef64c1..e7be6cb616 100644 --- a/tg/tl_app_web_view_result_url_gen.go +++ b/tg/tl_app_web_view_result_url_gen.go @@ -32,10 +32,10 @@ var ( ) // AppWebViewResultURL represents TL type `appWebViewResultUrl#3c1b4f0d`. -// Contains the link that must be used to open a named Mini App¹. +// Contains the link that must be used to open a direct link Mini App¹. // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps +// 1. https://core.telegram.org/api/bots/webapps#direct-link-mini-apps // // See https://core.telegram.org/constructor/appWebViewResultUrl for reference. type AppWebViewResultURL struct { diff --git a/tg/tl_bot_app_gen.go b/tg/tl_bot_app_gen.go index 2d52c385b0..8a1c6fbddb 100644 --- a/tg/tl_bot_app_gen.go +++ b/tg/tl_bot_app_gen.go @@ -134,10 +134,10 @@ func (b *BotAppNotModified) DecodeBare(buf *bin.Buffer) error { } // BotApp represents TL type `botApp#95fcd1d6`. -// Contains information about a named Mini App¹. +// Contains information about a direct link Mini App¹. // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps +// 1. https://core.telegram.org/api/bots/webapps#direct-link-mini-apps // // See https://core.telegram.org/constructor/botApp for reference. type BotApp struct { @@ -150,10 +150,10 @@ type BotApp struct { ID int64 // bot mini app access hash AccessHash int64 - // bot mini app short name, used to generate named Mini App deep links¹. + // bot mini app short name, used to generate Direct Mini App deep links¹. // // Links: - // 1) https://core.telegram.org/api/links#named-mini-app-links + // 1) https://core.telegram.org/api/links#direct-mini-app-links ShortName string // bot mini app title. Title string diff --git a/tg/tl_channels_check_username_gen.go b/tg/tl_channels_check_username_gen.go index 2620960d48..d0dcdf2f66 100644 --- a/tg/tl_channels_check_username_gen.go +++ b/tg/tl_channels_check_username_gen.go @@ -210,6 +210,8 @@ func (c *ChannelsCheckUsernameRequest) GetChannelAsNotEmpty() (NotEmptyInputChan // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ID_INVALID: The provided chat id is invalid. +// 400 MSG_ID_INVALID: Invalid message ID provided. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 USERNAME_INVALID: The provided username is not valid. // 400 USERNAME_OCCUPIED: The provided username is already occupied. // 400 USERNAME_PURCHASE_AVAILABLE: The specified username can be purchased on https://fragment.com. diff --git a/tg/tl_channels_edit_forum_topic_gen.go b/tg/tl_channels_edit_forum_topic_gen.go index 1d10e72bd7..3feccd4e49 100644 --- a/tg/tl_channels_edit_forum_topic_gen.go +++ b/tg/tl_channels_edit_forum_topic_gen.go @@ -433,6 +433,7 @@ func (e *ChannelsEditForumTopicRequest) GetChannelAsNotEmpty() (NotEmptyInputCha // Possible errors: // // 400 CHANNEL_FORUM_MISSING: This supergroup is not a forum. +// 400 CHANNEL_INVALID: The provided channel is invalid. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 DOCUMENT_INVALID: The specified document is invalid. // 400 GENERAL_MODIFY_ICON_FORBIDDEN: You can't modify the icon of the "General" topic. diff --git a/tg/tl_channels_update_pinned_forum_topic_gen.go b/tg/tl_channels_update_pinned_forum_topic_gen.go index 993a5231a1..d34294b685 100644 --- a/tg/tl_channels_update_pinned_forum_topic_gen.go +++ b/tg/tl_channels_update_pinned_forum_topic_gen.go @@ -237,6 +237,10 @@ func (u *ChannelsUpdatePinnedForumTopicRequest) GetChannelAsNotEmpty() (NotEmpty // Links: // 1. https://core.telegram.org/api/forum // +// Possible errors: +// +// 400 TOPIC_ID_INVALID: The specified topic ID is invalid. +// // See https://core.telegram.org/method/channels.updatePinnedForumTopic for reference. // Can be used by bots. func (c *Client) ChannelsUpdatePinnedForumTopic(ctx context.Context, request *ChannelsUpdatePinnedForumTopicRequest) (UpdatesClass, error) { diff --git a/tg/tl_chatlists_delete_exported_invite_gen.go b/tg/tl_chatlists_delete_exported_invite_gen.go index c791c5c2c2..3b135a46f9 100644 --- a/tg/tl_chatlists_delete_exported_invite_gen.go +++ b/tg/tl_chatlists_delete_exported_invite_gen.go @@ -203,6 +203,7 @@ func (d *ChatlistsDeleteExportedInviteRequest) GetSlug() (value string) { // Possible errors: // // 400 FILTER_ID_INVALID: The specified filter ID is invalid. +// 400 FILTER_NOT_SUPPORTED: The specified filter cannot be used in this context. // // See https://core.telegram.org/method/chatlists.deleteExportedInvite for reference. // Can be used by bots. diff --git a/tg/tl_chatlists_edit_exported_invite_gen.go b/tg/tl_chatlists_edit_exported_invite_gen.go index b3265d5b7e..cb8b9fe24c 100644 --- a/tg/tl_chatlists_edit_exported_invite_gen.go +++ b/tg/tl_chatlists_edit_exported_invite_gen.go @@ -346,6 +346,7 @@ func (e *ChatlistsEditExportedInviteRequest) MapPeers() (value InputPeerClassArr // Possible errors: // // 400 FILTER_ID_INVALID: The specified filter ID is invalid. +// 400 FILTER_NOT_SUPPORTED: The specified filter cannot be used in this context. // // See https://core.telegram.org/method/chatlists.editExportedInvite for reference. // Can be used by bots. diff --git a/tg/tl_chatlists_get_chatlist_updates_gen.go b/tg/tl_chatlists_get_chatlist_updates_gen.go index 79074ba6a8..f07491a252 100644 --- a/tg/tl_chatlists_get_chatlist_updates_gen.go +++ b/tg/tl_chatlists_get_chatlist_updates_gen.go @@ -179,6 +179,7 @@ func (g *ChatlistsGetChatlistUpdatesRequest) GetChatlist() (value InputChatlistD // Possible errors: // // 400 FILTER_ID_INVALID: The specified filter ID is invalid. +// 400 FILTER_NOT_SUPPORTED: The specified filter cannot be used in this context. // 400 INPUT_CHATLIST_INVALID: The specified folder is invalid. // // See https://core.telegram.org/method/chatlists.getChatlistUpdates for reference. diff --git a/tg/tl_chatlists_get_leave_chatlist_suggestions_gen.go b/tg/tl_chatlists_get_leave_chatlist_suggestions_gen.go index a6fd23e0af..3fe0159324 100644 --- a/tg/tl_chatlists_get_leave_chatlist_suggestions_gen.go +++ b/tg/tl_chatlists_get_leave_chatlist_suggestions_gen.go @@ -174,6 +174,11 @@ func (g *ChatlistsGetLeaveChatlistSuggestionsRequest) GetChatlist() (value Input // Links: // 1. https://core.telegram.org/api/links#chat-folder-links // +// Possible errors: +// +// 400 FILTER_ID_INVALID: The specified filter ID is invalid. +// 400 FILTER_NOT_SUPPORTED: The specified filter cannot be used in this context. +// // See https://core.telegram.org/method/chatlists.getLeaveChatlistSuggestions for reference. // Can be used by bots. func (c *Client) ChatlistsGetLeaveChatlistSuggestions(ctx context.Context, chatlist InputChatlistDialogFilter) ([]PeerClass, error) { diff --git a/tg/tl_chatlists_hide_chatlist_updates_gen.go b/tg/tl_chatlists_hide_chatlist_updates_gen.go index c0d64e5c0e..96caa47dc8 100644 --- a/tg/tl_chatlists_hide_chatlist_updates_gen.go +++ b/tg/tl_chatlists_hide_chatlist_updates_gen.go @@ -170,6 +170,11 @@ func (h *ChatlistsHideChatlistUpdatesRequest) GetChatlist() (value InputChatlist // Links: // 1. https://core.telegram.org/api/links#chat-folder-links // +// Possible errors: +// +// 400 FILTER_ID_INVALID: The specified filter ID is invalid. +// 400 FILTER_NOT_SUPPORTED: The specified filter cannot be used in this context. +// // See https://core.telegram.org/method/chatlists.hideChatlistUpdates for reference. // Can be used by bots. func (c *Client) ChatlistsHideChatlistUpdates(ctx context.Context, chatlist InputChatlistDialogFilter) (bool, error) { diff --git a/tg/tl_chatlists_join_chatlist_updates_gen.go b/tg/tl_chatlists_join_chatlist_updates_gen.go index 4ec1bab168..2d94dcc540 100644 --- a/tg/tl_chatlists_join_chatlist_updates_gen.go +++ b/tg/tl_chatlists_join_chatlist_updates_gen.go @@ -225,6 +225,11 @@ func (j *ChatlistsJoinChatlistUpdatesRequest) MapPeers() (value InputPeerClassAr // Links: // 1. https://core.telegram.org/api/links#chat-folder-links // +// Possible errors: +// +// 400 FILTER_ID_INVALID: The specified filter ID is invalid. +// 400 FILTER_INCLUDE_EMPTY: The include_peers vector of the filter is empty. +// // See https://core.telegram.org/method/chatlists.joinChatlistUpdates for reference. // Can be used by bots. func (c *Client) ChatlistsJoinChatlistUpdates(ctx context.Context, request *ChatlistsJoinChatlistUpdatesRequest) (UpdatesClass, error) { diff --git a/tg/tl_contacts_block_from_replies_gen.go b/tg/tl_contacts_block_from_replies_gen.go index 22e4f031ad..e6c0a2f4a7 100644 --- a/tg/tl_contacts_block_from_replies_gen.go +++ b/tg/tl_contacts_block_from_replies_gen.go @@ -299,6 +299,10 @@ func (b *ContactsBlockFromRepliesRequest) GetMsgID() (value int) { // Links: // 1. https://core.telegram.org/api/discussion // +// Possible errors: +// +// 400 MSG_ID_INVALID: Invalid message ID provided. +// // See https://core.telegram.org/method/contacts.blockFromReplies for reference. func (c *Client) ContactsBlockFromReplies(ctx context.Context, request *ContactsBlockFromRepliesRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_contacts_get_statuses_gen.go b/tg/tl_contacts_get_statuses_gen.go index 0c51cb7183..ed9d7050c3 100644 --- a/tg/tl_contacts_get_statuses_gen.go +++ b/tg/tl_contacts_get_statuses_gen.go @@ -33,7 +33,7 @@ var ( // ContactsGetStatusesRequest represents TL type `contacts.getStatuses#c4a353ee`. // Use this method to obtain the online statuses of all contacts with an accessible -// associated Telegram account. +// Telegram account. // // See https://core.telegram.org/method/contacts.getStatuses for reference. type ContactsGetStatusesRequest struct { @@ -131,7 +131,7 @@ func (g *ContactsGetStatusesRequest) DecodeBare(b *bin.Buffer) error { // ContactsGetStatuses invokes method contacts.getStatuses#c4a353ee returning error if any. // Use this method to obtain the online statuses of all contacts with an accessible -// associated Telegram account. +// Telegram account. // // See https://core.telegram.org/method/contacts.getStatuses for reference. func (c *Client) ContactsGetStatuses(ctx context.Context) ([]ContactStatus, error) { diff --git a/tg/tl_errors_gen.go b/tg/tl_errors_gen.go index 076df1f625..e9bb2cae9a 100644 --- a/tg/tl_errors_gen.go +++ b/tg/tl_errors_gen.go @@ -87,6 +87,7 @@ const ( ErrButtonTextInvalid = "BUTTON_TEXT_INVALID" ErrButtonTypeInvalid = "BUTTON_TYPE_INVALID" ErrButtonURLInvalid = "BUTTON_URL_INVALID" + ErrButtonUserInvalid = "BUTTON_USER_INVALID" ErrButtonUserPrivacyRestricted = "BUTTON_USER_PRIVACY_RESTRICTED" ErrCallAlreadyAccepted = "CALL_ALREADY_ACCEPTED" ErrCallAlreadyDeclined = "CALL_ALREADY_DECLINED" @@ -149,6 +150,7 @@ const ( ErrConnectionLayerInvalid = "CONNECTION_LAYER_INVALID" ErrContactAddMissing = "CONTACT_ADD_MISSING" ErrContactIDInvalid = "CONTACT_ID_INVALID" + ErrContactMissing = "CONTACT_MISSING" ErrContactNameEmpty = "CONTACT_NAME_EMPTY" ErrContactReqMissing = "CONTACT_REQ_MISSING" ErrCreateCallFailed = "CREATE_CALL_FAILED" @@ -216,7 +218,6 @@ const ( ErrGameBotInvalid = "GAME_BOT_INVALID" ErrGeneralModifyIconForbidden = "GENERAL_MODIFY_ICON_FORBIDDEN" ErrGeoPointInvalid = "GEO_POINT_INVALID" - ErrGiftcodeNotAllowed = "GIFTCODE_NOT_ALLOWED" ErrGiftSlugExpired = "GIFT_SLUG_EXPIRED" ErrGiftSlugInvalid = "GIFT_SLUG_INVALID" ErrGifContentTypeInvalid = "GIF_CONTENT_TYPE_INVALID" @@ -277,6 +278,7 @@ const ( ErrMediaPrevInvalid = "MEDIA_PREV_INVALID" ErrMediaTTLInvalid = "MEDIA_TTL_INVALID" ErrMediaTypeInvalid = "MEDIA_TYPE_INVALID" + ErrMediaVideoStoryMissing = "MEDIA_VIDEO_STORY_MISSING" ErrMegagroupGeoRequired = "MEGAGROUP_GEO_REQUIRED" ErrMegagroupIDInvalid = "MEGAGROUP_ID_INVALID" ErrMegagroupPrehistoryHidden = "MEGAGROUP_PREHISTORY_HIDDEN" @@ -365,6 +367,7 @@ const ( ErrPremiumSubActiveUntil = "PREMIUM_SUB_ACTIVE_UNTIL" ErrPreviousChatImportActiveWaitMin = "PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_MIN" ErrPrivacyKeyInvalid = "PRIVACY_KEY_INVALID" + ErrPrivacyPremiumRequired = "PRIVACY_PREMIUM_REQUIRED" ErrPrivacyTooLong = "PRIVACY_TOO_LONG" ErrPrivacyValueInvalid = "PRIVACY_VALUE_INVALID" ErrPublicChannelMissing = "PUBLIC_CHANNEL_MISSING" @@ -822,6 +825,11 @@ func IsButtonURLInvalid(err error) bool { return tgerr.Is(err, ErrButtonURLInvalid) } +// IsButtonUserInvalid reports whether err is BUTTON_USER_INVALID. +func IsButtonUserInvalid(err error) bool { + return tgerr.Is(err, ErrButtonUserInvalid) +} + // IsButtonUserPrivacyRestricted reports whether err is BUTTON_USER_PRIVACY_RESTRICTED. func IsButtonUserPrivacyRestricted(err error) bool { return tgerr.Is(err, ErrButtonUserPrivacyRestricted) @@ -1132,6 +1140,11 @@ func IsContactIDInvalid(err error) bool { return tgerr.Is(err, ErrContactIDInvalid) } +// IsContactMissing reports whether err is CONTACT_MISSING. +func IsContactMissing(err error) bool { + return tgerr.Is(err, ErrContactMissing) +} + // IsContactNameEmpty reports whether err is CONTACT_NAME_EMPTY. func IsContactNameEmpty(err error) bool { return tgerr.Is(err, ErrContactNameEmpty) @@ -1467,11 +1480,6 @@ func IsGeoPointInvalid(err error) bool { return tgerr.Is(err, ErrGeoPointInvalid) } -// IsGiftcodeNotAllowed reports whether err is GIFTCODE_NOT_ALLOWED. -func IsGiftcodeNotAllowed(err error) bool { - return tgerr.Is(err, ErrGiftcodeNotAllowed) -} - // IsGiftSlugExpired reports whether err is GIFT_SLUG_EXPIRED. func IsGiftSlugExpired(err error) bool { return tgerr.Is(err, ErrGiftSlugExpired) @@ -1772,6 +1780,11 @@ func IsMediaTypeInvalid(err error) bool { return tgerr.Is(err, ErrMediaTypeInvalid) } +// IsMediaVideoStoryMissing reports whether err is MEDIA_VIDEO_STORY_MISSING. +func IsMediaVideoStoryMissing(err error) bool { + return tgerr.Is(err, ErrMediaVideoStoryMissing) +} + // IsMegagroupGeoRequired reports whether err is MEGAGROUP_GEO_REQUIRED. func IsMegagroupGeoRequired(err error) bool { return tgerr.Is(err, ErrMegagroupGeoRequired) @@ -2212,6 +2225,11 @@ func IsPrivacyKeyInvalid(err error) bool { return tgerr.Is(err, ErrPrivacyKeyInvalid) } +// IsPrivacyPremiumRequired reports whether err is PRIVACY_PREMIUM_REQUIRED. +func IsPrivacyPremiumRequired(err error) bool { + return tgerr.Is(err, ErrPrivacyPremiumRequired) +} + // IsPrivacyTooLong reports whether err is PRIVACY_TOO_LONG. func IsPrivacyTooLong(err error) bool { return tgerr.Is(err, ErrPrivacyTooLong) diff --git a/tg/tl_input_bot_app_gen.go b/tg/tl_input_bot_app_gen.go index f684455fa8..f978ce7c8a 100644 --- a/tg/tl_input_bot_app_gen.go +++ b/tg/tl_input_bot_app_gen.go @@ -32,17 +32,17 @@ var ( ) // InputBotAppID represents TL type `inputBotAppID#a920bd7a`. -// Used to fetch information about a named Mini App¹ by its ID +// Used to fetch information about a direct link Mini App¹ by its ID // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps +// 1. https://core.telegram.org/api/bots/webapps#direct-link-mini-apps // // See https://core.telegram.org/constructor/inputBotAppID for reference. type InputBotAppID struct { - // named Mini App¹ ID. + // direct link Mini App¹ ID. // // Links: - // 1) https://core.telegram.org/api/bots/webapps#named-mini-apps + // 1) https://core.telegram.org/api/bots/webapps#direct-link-mini-apps ID int64 // Access hash, obtained from the botApp¹ constructor. // @@ -203,19 +203,19 @@ func (i *InputBotAppID) GetAccessHash() (value int64) { } // InputBotAppShortName represents TL type `inputBotAppShortName#908c0407`. -// Used to fetch information about a named Mini App¹ by its short name +// Used to fetch information about a direct link Mini App¹ by its short name // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps +// 1. https://core.telegram.org/api/bots/webapps#direct-link-mini-apps // // See https://core.telegram.org/constructor/inputBotAppShortName for reference. type InputBotAppShortName struct { // ID of the bot that owns the bot mini app BotID InputUserClass - // Short name, obtained from a named Mini App deep link¹ + // Short name, obtained from a Direct Mini App deep link¹ // // Links: - // 1) https://core.telegram.org/api/links#named-mini-app-links + // 1) https://core.telegram.org/api/links#direct-mini-app-links ShortName string } diff --git a/tg/tl_message_fwd_header_gen.go b/tg/tl_message_fwd_header_gen.go index cf5c7329cf..8b82349e1d 100644 --- a/tg/tl_message_fwd_header_gen.go +++ b/tg/tl_message_fwd_header_gen.go @@ -91,18 +91,19 @@ type MessageFwdHeader struct { // Only for forwarded messages reforwarded to saved messages »¹, contains the sender of // the original message (i.e. if user A sends a message, then user B forwards it // somewhere, then user C saves it to saved messages, this field will contain the ID of - // user A and from_id will contain the ID of user B). + // user B and from_id will contain the ID of user A). // // Links: // 1) https://core.telegram.org/api/saved-messages // // Use SetSavedFromID and GetSavedFromID helpers. SavedFromID PeerClass - // Only for forwarded messages from users with forward privacy enabled reforwarded to - // saved messages »¹, contains the sender of the original message (i.e. if user A (fwd - // privacy enabled) sends a message, then user B forwards it somewhere, then user C saves - // it to saved messages, this field will contain the name of user A and from_id will - // contain the ID of user B). + // Only for forwarded messages from users with forward privacy enabled, sent by users + // with forward privacy enabled, reforwarded to saved messages »¹, contains the sender + // of the original message (i.e. if user A (fwd privacy enabled) sends a message, then + // user B (fwd privacy enabled) forwards it somewhere, then user C saves it to saved + // messages, this field will contain the name of user B and from_name will contain the + // name of user A). // // Links: // 1) https://core.telegram.org/api/saved-messages @@ -112,7 +113,7 @@ type MessageFwdHeader struct { // Only for forwarded messages reforwarded to saved messages »¹, indicates when was the // original message sent (i.e. if user A sends a message @ unixtime 1, then user B // forwards it somewhere @ unixtime 2, then user C saves it to saved messages @ unixtime - // 3, this field will contain 1, date will contain 2 and the date of the containing + // 3, this field will contain 2, date will contain 1 and the date of the containing // message² will contain 3). // // Links: diff --git a/tg/tl_messages_bot_app_gen.go b/tg/tl_messages_bot_app_gen.go index 5990a12f07..57afd1c6c5 100644 --- a/tg/tl_messages_bot_app_gen.go +++ b/tg/tl_messages_bot_app_gen.go @@ -32,10 +32,10 @@ var ( ) // MessagesBotApp represents TL type `messages.botApp#eb50adf5`. -// Contains information about a named Mini App¹ +// Contains information about a direct link Mini App¹ // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps +// 1. https://core.telegram.org/api/bots/webapps#direct-link-mini-apps // // See https://core.telegram.org/constructor/messages.botApp for reference. type MessagesBotApp struct { diff --git a/tg/tl_messages_delete_scheduled_messages_gen.go b/tg/tl_messages_delete_scheduled_messages_gen.go index fe271152eb..b68396ce01 100644 --- a/tg/tl_messages_delete_scheduled_messages_gen.go +++ b/tg/tl_messages_delete_scheduled_messages_gen.go @@ -209,6 +209,10 @@ func (d *MessagesDeleteScheduledMessagesRequest) GetID() (value []int) { // MessagesDeleteScheduledMessages invokes method messages.deleteScheduledMessages#59ae2b16 returning error if any. // Delete scheduled messages // +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// // See https://core.telegram.org/method/messages.deleteScheduledMessages for reference. func (c *Client) MessagesDeleteScheduledMessages(ctx context.Context, request *MessagesDeleteScheduledMessagesRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_edit_chat_default_banned_rights_gen.go b/tg/tl_messages_edit_chat_default_banned_rights_gen.go index 1bad23ed11..2b41eba808 100644 --- a/tg/tl_messages_edit_chat_default_banned_rights_gen.go +++ b/tg/tl_messages_edit_chat_default_banned_rights_gen.go @@ -205,6 +205,7 @@ func (e *MessagesEditChatDefaultBannedRightsRequest) GetBannedRights() (value Ch // Possible errors: // // 400 BANNED_RIGHTS_INVALID: You provided some invalid flags in the banned rights. +// 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_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. diff --git a/tg/tl_messages_get_bot_app_gen.go b/tg/tl_messages_get_bot_app_gen.go index a77d4c0dd4..03fab63399 100644 --- a/tg/tl_messages_get_bot_app_gen.go +++ b/tg/tl_messages_get_bot_app_gen.go @@ -32,17 +32,17 @@ var ( ) // MessagesGetBotAppRequest represents TL type `messages.getBotApp#34fdc5c3`. -// Obtain information about a named Mini App¹ +// Obtain information about a direct link Mini App¹ // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps +// 1. https://core.telegram.org/api/bots/webapps#direct-link-mini-apps // // See https://core.telegram.org/method/messages.getBotApp for reference. type MessagesGetBotAppRequest struct { - // Bot app information obtained from a named Mini App deep link »¹. + // Bot app information obtained from a Direct Mini App deep link »¹. // // Links: - // 1) https://core.telegram.org/api/links#named-mini-app-links + // 1) https://core.telegram.org/api/links#direct-mini-app-links App InputBotAppClass // Hash for pagination, for more info click here¹ // @@ -203,10 +203,10 @@ func (g *MessagesGetBotAppRequest) GetHash() (value int64) { } // MessagesGetBotApp invokes method messages.getBotApp#34fdc5c3 returning error if any. -// Obtain information about a named Mini App¹ +// Obtain information about a direct link Mini App¹ // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps +// 1. https://core.telegram.org/api/bots/webapps#direct-link-mini-apps // // Possible errors: // diff --git a/tg/tl_messages_read_encrypted_history_gen.go b/tg/tl_messages_read_encrypted_history_gen.go index 4409bcff49..b8faf048e5 100644 --- a/tg/tl_messages_read_encrypted_history_gen.go +++ b/tg/tl_messages_read_encrypted_history_gen.go @@ -193,6 +193,7 @@ func (r *MessagesReadEncryptedHistoryRequest) GetMaxDate() (value int) { // // Possible errors: // +// 400 MAX_DATE_INVALID: The specified maximum date is invalid. // 400 MSG_WAIT_FAILED: A waiting call returned an error. // // See https://core.telegram.org/method/messages.readEncryptedHistory for reference. diff --git a/tg/tl_messages_request_app_web_view_gen.go b/tg/tl_messages_request_app_web_view_gen.go index 8f353df6b2..30db8ae5e4 100644 --- a/tg/tl_messages_request_app_web_view_gen.go +++ b/tg/tl_messages_request_app_web_view_gen.go @@ -32,14 +32,14 @@ var ( ) // MessagesRequestAppWebViewRequest represents TL type `messages.requestAppWebView#8c5a3b3c`. -// Open a bot mini app¹ from a named Mini App deep link², sending over user information -// after user confirmation. +// Open a bot mini app¹ from a direct Mini App deep link², sending over user +// information after user confirmation. // After calling this method, until the user closes the webview, messages // prolongWebView¹ must be called every 60 seconds. // // Links: // 1. https://core.telegram.org/bots/webapps -// 2. https://core.telegram.org/api/links#named-mini-app-links +// 2. https://core.telegram.org/api/links#direct-mini-app-links // 3. https://core.telegram.org/method/messages.prolongWebView // // See https://core.telegram.org/method/messages.requestAppWebView for reference. @@ -50,26 +50,26 @@ type MessagesRequestAppWebViewRequest struct { // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Set this flag if the bot is asking permission to send messages to the user as - // specified in the named Mini App deep link¹ docs, and the user agreed. + // specified in the direct Mini App deep link¹ docs, and the user agreed. // // Links: - // 1) https://core.telegram.org/api/links#named-mini-app-links + // 1) https://core.telegram.org/api/links#direct-mini-app-links WriteAllowed 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. Peer InputPeerClass - // The app obtained by invoking messages.getBotApp¹ as specified in the named Mini App + // The app obtained by invoking messages.getBotApp¹ as specified in the direct Mini App // deep link² docs. // // Links: // 1) https://core.telegram.org/method/messages.getBotApp - // 2) https://core.telegram.org/api/links#named-mini-app-links + // 2) https://core.telegram.org/api/links#direct-mini-app-links App InputBotAppClass - // If the startapp query string parameter is present in the named Mini App deep link¹, + // If the startapp query string parameter is present in the direct Mini App deep link¹, // pass it to start_param. // // Links: - // 1) https://core.telegram.org/api/links#named-mini-app-links + // 1) https://core.telegram.org/api/links#direct-mini-app-links // // Use SetStartParam and GetStartParam helpers. StartParam string @@ -403,14 +403,14 @@ func (r *MessagesRequestAppWebViewRequest) GetPlatform() (value string) { } // MessagesRequestAppWebView invokes method messages.requestAppWebView#8c5a3b3c returning error if any. -// Open a bot mini app¹ from a named Mini App deep link², sending over user information -// after user confirmation. +// Open a bot mini app¹ from a direct Mini App deep link², sending over user +// information after user confirmation. // After calling this method, until the user closes the webview, messages // prolongWebView¹ must be called every 60 seconds. // // Links: // 1. https://core.telegram.org/bots/webapps -// 2. https://core.telegram.org/api/links#named-mini-app-links +// 2. https://core.telegram.org/api/links#direct-mini-app-links // 3. https://core.telegram.org/method/messages.prolongWebView // // Possible errors: diff --git a/tg/tl_messages_request_web_view_gen.go b/tg/tl_messages_request_web_view_gen.go index cd122f9e25..0d3179ce28 100644 --- a/tg/tl_messages_request_web_view_gen.go +++ b/tg/tl_messages_request_web_view_gen.go @@ -615,7 +615,8 @@ func (r *MessagesRequestWebViewRequest) GetSendAs() (value InputPeerClass, ok bo // Possible errors: // // 400 BOT_INVALID: This is not a valid bot. -// 400 BOT_WEBVIEW_DISABLED: +// 400 BOT_WEBVIEW_DISABLED: A webview cannot be opened in the specified conditions: emitted for example if from_bot_menu or url are set and peer is not the chat with the bot. +// 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 YOU_BLOCKED_USER: You blocked this user. // diff --git a/tg/tl_messages_send_message_gen.go b/tg/tl_messages_send_message_gen.go index 940b30d99a..982a3e0432 100644 --- a/tg/tl_messages_send_message_gen.go +++ b/tg/tl_messages_send_message_gen.go @@ -787,12 +787,13 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // // Possible errors: // -// 400 ADMIN_RIGHTS_EMPTY: +// 400 ADMIN_RIGHTS_EMPTY: The chatAdminRights constructor passed in keyboardButtonRequestPeer.peer_type.user_admin_rights has no rights set (i.e. flags is 0). // 400 BOT_DOMAIN_INVALID: Bot domain invalid. // 400 BOT_INVALID: This is not a valid bot. // 400 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. +// 400 BUTTON_USER_INVALID: The user_id passed to inputKeyboardButtonUserProfile is invalid! // 400 BUTTON_USER_PRIVACY_RESTRICTED: The privacy setting of the user specified in a inputKeyboardButtonUserProfile button do not allow creating such a button. // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. @@ -817,6 +818,7 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 PINNED_DIALOGS_TOO_MUCH: Too many pinned dialogs. // 400 POLL_OPTION_INVALID: Invalid poll option provided. +// 406 PRIVACY_PREMIUM_REQUIRED: You need a Telegram Premium subscription to send a message to this user. // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. // 400 REPLY_MARKUP_INVALID: The provided reply markup is invalid. // 400 REPLY_MARKUP_TOO_LONG: The specified reply_markup is too long. diff --git a/tg/tl_messages_set_default_history_ttl_gen.go b/tg/tl_messages_set_default_history_ttl_gen.go index 4a1ec5af8c..291ccba95c 100644 --- a/tg/tl_messages_set_default_history_ttl_gen.go +++ b/tg/tl_messages_set_default_history_ttl_gen.go @@ -164,6 +164,10 @@ func (s *MessagesSetDefaultHistoryTTLRequest) GetPeriod() (value int) { // MessagesSetDefaultHistoryTTL invokes method messages.setDefaultHistoryTTL#9eb51445 returning error if any. // Changes the default value of the Time-To-Live setting, applied to all new chats. // +// Possible errors: +// +// 400 TTL_PERIOD_INVALID: The specified TTL period is invalid. +// // See https://core.telegram.org/method/messages.setDefaultHistoryTTL for reference. // Can be used by bots. func (c *Client) MessagesSetDefaultHistoryTTL(ctx context.Context, period int) (bool, error) { diff --git a/tg/tl_payments_apply_gift_code_gen.go b/tg/tl_payments_apply_gift_code_gen.go index 3505f9aedb..a84bd86b23 100644 --- a/tg/tl_payments_apply_gift_code_gen.go +++ b/tg/tl_payments_apply_gift_code_gen.go @@ -172,10 +172,9 @@ func (a *PaymentsApplyGiftCodeRequest) GetSlug() (value string) { // // Possible errors: // -// 406 GIFTCODE_NOT_ALLOWED: // 400 GIFT_SLUG_EXPIRED: The specified gift slug has expired. // 400 GIFT_SLUG_INVALID: The specified slug is invalid. -// 420 PREMIUM_SUB_ACTIVE_UNTIL_%d: You already have an premium subscription active until unxtime %d. +// 420 PREMIUM_SUB_ACTIVE_UNTIL_%d: You already have a premium subscription active until unixtime %d . // // See https://core.telegram.org/method/payments.applyGiftCode for reference. func (c *Client) PaymentsApplyGiftCode(ctx context.Context, slug string) (UpdatesClass, error) { diff --git a/tg/tl_photos_upload_contact_profile_photo_gen.go b/tg/tl_photos_upload_contact_profile_photo_gen.go index cc17c5bd0c..0a2c2e3f28 100644 --- a/tg/tl_photos_upload_contact_profile_photo_gen.go +++ b/tg/tl_photos_upload_contact_profile_photo_gen.go @@ -494,6 +494,7 @@ func (u *PhotosUploadContactProfilePhotoRequest) GetVideoEmojiMarkup() (value Vi // // Possible errors: // +// 400 CONTACT_MISSING: The specified user is not a contact. // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/photos.uploadContactProfilePhoto for reference. diff --git a/tg/tl_stories_export_story_link_gen.go b/tg/tl_stories_export_story_link_gen.go index 5532cd65bf..ab37732e45 100644 --- a/tg/tl_stories_export_story_link_gen.go +++ b/tg/tl_stories_export_story_link_gen.go @@ -205,6 +205,7 @@ func (e *StoriesExportStoryLinkRequest) GetID() (value int) { // Possible errors: // // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 STORY_ID_EMPTY: You specified no story IDs. // 400 USER_PUBLIC_MISSING: Cannot generate a link to stories posted by a peer without a username. // // See https://core.telegram.org/method/stories.exportStoryLink for reference. diff --git a/tg/tl_stories_get_stories_by_id_gen.go b/tg/tl_stories_get_stories_by_id_gen.go index 7dd3a3dfe3..060fed6429 100644 --- a/tg/tl_stories_get_stories_by_id_gen.go +++ b/tg/tl_stories_get_stories_by_id_gen.go @@ -219,7 +219,7 @@ func (g *StoriesGetStoriesByIDRequest) GetID() (value []int) { // // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. -// 400 STORIES_NEVER_CREATED: +// 400 STORIES_NEVER_CREATED: This peer hasn't ever posted any stories. // 400 STORY_ID_EMPTY: You specified no story IDs. // // See https://core.telegram.org/method/stories.getStoriesByID for reference. diff --git a/tg/tl_stories_read_stories_gen.go b/tg/tl_stories_read_stories_gen.go index 4be9148313..c93222aebd 100644 --- a/tg/tl_stories_read_stories_gen.go +++ b/tg/tl_stories_read_stories_gen.go @@ -208,7 +208,7 @@ func (r *StoriesReadStoriesRequest) GetMaxID() (value int) { // // 400 MAX_ID_INVALID: The provided max ID is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. -// 400 STORIES_NEVER_CREATED: +// 400 STORIES_NEVER_CREATED: This peer hasn't ever posted any stories. // // See https://core.telegram.org/method/stories.readStories for reference. func (c *Client) StoriesReadStories(ctx context.Context, request *StoriesReadStoriesRequest) ([]int, error) { diff --git a/tg/tl_stories_send_story_gen.go b/tg/tl_stories_send_story_gen.go index 126a435300..ac088aa207 100644 --- a/tg/tl_stories_send_story_gen.go +++ b/tg/tl_stories_send_story_gen.go @@ -782,6 +782,7 @@ func (s *StoriesSendStoryRequest) MapPrivacyRules() (value InputPrivacyRuleClass // 400 MEDIA_EMPTY: The provided media object is invalid. // 400 MEDIA_FILE_INVALID: The specified media file is invalid. // 400 MEDIA_TYPE_INVALID: The specified media type cannot be used in stories. +// 400 MEDIA_VIDEO_STORY_MISSING: A non-story video cannot be repubblished as a story (emitted when trying to resend a non-story video as a story using inputDocument). // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // 400 STORIES_TOO_MUCH: You have hit the maximum active stories limit as specified by the story_expiring_limit_* client configuration parameters: you should buy a Premium subscription, delete an active story, or wait for the oldest story to expire. diff --git a/tg/tl_user_full_gen.go b/tg/tl_user_full_gen.go index 73be91ab47..bf356eb1df 100644 --- a/tg/tl_user_full_gen.go +++ b/tg/tl_user_full_gen.go @@ -79,7 +79,7 @@ type UserFull struct { // // Links: // 1) https://core.telegram.org/method/messages.setChatWallPaper - // 2) https://core.telegram.org/api/wallpapers#installing-wallpapers-in-a-specific-chator-channel + // 2) https://core.telegram.org/api/wallpapers#installing-wallpapers-in-a-specific-chat-or-channel WallpaperOverridden bool // ContactRequirePremium field of UserFull. ContactRequirePremium bool