diff --git a/go.mod b/go.mod index ff2cc5d090..930a8d8eb2 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.39.1 + github.com/gotd/getdoc v0.40.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 0f04b0180d..3ab8987792 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.39.1 h1:IDddS24LRt8hdo2zcN/UCdd23buA0DUFc39/6/h+uv4= -github.com/gotd/getdoc v0.39.1/go.mod h1:nJwLqv5cBIre9AfVje+ui4hNEXmCt7OMLtl4I/QZjv8= +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/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_get_channel_default_emoji_statuses_gen.go b/tg/tl_account_get_channel_default_emoji_statuses_gen.go index bbb035b2b0..5764d45d23 100644 --- a/tg/tl_account_get_channel_default_emoji_statuses_gen.go +++ b/tg/tl_account_get_channel_default_emoji_statuses_gen.go @@ -174,7 +174,6 @@ func (g *AccountGetChannelDefaultEmojiStatusesRequest) GetHash() (value int64) { // 1. https://core.telegram.org/api/emoji-status // // See https://core.telegram.org/method/account.getChannelDefaultEmojiStatuses for reference. -// Can be used by bots. func (c *Client) AccountGetChannelDefaultEmojiStatuses(ctx context.Context, hash int64) (AccountEmojiStatusesClass, error) { var result AccountEmojiStatusesBox diff --git a/tg/tl_account_get_channel_restricted_status_emojis_gen.go b/tg/tl_account_get_channel_restricted_status_emojis_gen.go index e177ab8465..d5e3dcae8b 100644 --- a/tg/tl_account_get_channel_restricted_status_emojis_gen.go +++ b/tg/tl_account_get_channel_restricted_status_emojis_gen.go @@ -178,7 +178,6 @@ func (g *AccountGetChannelRestrictedStatusEmojisRequest) GetHash() (value int64) // 2. https://core.telegram.org/api/emoji-status // // See https://core.telegram.org/method/account.getChannelRestrictedStatusEmojis for reference. -// Can be used by bots. func (c *Client) AccountGetChannelRestrictedStatusEmojis(ctx context.Context, hash int64) (EmojiListClass, error) { var result EmojiListBox diff --git a/tg/tl_auth_import_login_token_gen.go b/tg/tl_auth_import_login_token_gen.go index 951d010a2f..ca286e646e 100644 --- a/tg/tl_auth_import_login_token_gen.go +++ b/tg/tl_auth_import_login_token_gen.go @@ -182,7 +182,6 @@ func (i *AuthImportLoginTokenRequest) GetToken() (value []byte) { // 400 AUTH_TOKEN_EXPIRED: The authorization token has expired. // 400 AUTH_TOKEN_INVALID: The specified auth token is invalid. // 400 AUTH_TOKEN_INVALIDX: The specified auth token is invalid. -// 500 MEMBER_NOT_FOUND: // // See https://core.telegram.org/method/auth.importLoginToken for reference. func (c *Client) AuthImportLoginToken(ctx context.Context, token []byte) (AuthLoginTokenClass, error) { diff --git a/tg/tl_channels_edit_photo_gen.go b/tg/tl_channels_edit_photo_gen.go index 12d448062b..bd79eab09a 100644 --- a/tg/tl_channels_edit_photo_gen.go +++ b/tg/tl_channels_edit_photo_gen.go @@ -221,6 +221,7 @@ func (e *ChannelsEditPhotoRequest) GetChannelAsNotEmpty() (NotEmptyInputChannel, // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 FILE_PARTS_INVALID: The number of file parts is invalid. // 400 FILE_REFERENCE_INVALID: The specified file reference is invalid. +// 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_INVALID: Photo invalid. diff --git a/tg/tl_channels_set_stickers_gen.go b/tg/tl_channels_set_stickers_gen.go index 9487b10e8a..03ee4900aa 100644 --- a/tg/tl_channels_set_stickers_gen.go +++ b/tg/tl_channels_set_stickers_gen.go @@ -209,6 +209,7 @@ func (s *ChannelsSetStickersRequest) GetChannelAsNotEmpty() (NotEmptyInputChanne // Possible errors: // // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 PARTICIPANTS_TOO_FEW: Not enough participants. // 406 STICKERSET_OWNER_ANONYMOUS: Provided stickerset can't be installed as group stickerset to prevent admin deanonymization. // diff --git a/tg/tl_channels_toggle_join_request_gen.go b/tg/tl_channels_toggle_join_request_gen.go index 907272fa6d..a8a6f9be88 100644 --- a/tg/tl_channels_toggle_join_request_gen.go +++ b/tg/tl_channels_toggle_join_request_gen.go @@ -210,6 +210,7 @@ func (t *ChannelsToggleJoinRequestRequest) GetChannelAsNotEmpty() (NotEmptyInput // 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 CHAT_PUBLIC_REQUIRED: You can only enable join requests in public groups. diff --git a/tg/tl_channels_toggle_participants_hidden_gen.go b/tg/tl_channels_toggle_participants_hidden_gen.go index c9bc0f333b..f85d1a986a 100644 --- a/tg/tl_channels_toggle_participants_hidden_gen.go +++ b/tg/tl_channels_toggle_participants_hidden_gen.go @@ -215,6 +215,7 @@ func (t *ChannelsToggleParticipantsHiddenRequest) GetChannelAsNotEmpty() (NotEmp // // Possible errors: // +// 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_channels_toggle_slow_mode_gen.go b/tg/tl_channels_toggle_slow_mode_gen.go index e67a6bda70..0b789d2047 100644 --- a/tg/tl_channels_toggle_slow_mode_gen.go +++ b/tg/tl_channels_toggle_slow_mode_gen.go @@ -211,6 +211,7 @@ func (t *ChannelsToggleSlowModeRequest) GetChannelAsNotEmpty() (NotEmptyInputCha // // 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 SECONDS_INVALID: Invalid duration provided. // diff --git a/tg/tl_channels_update_emoji_status_gen.go b/tg/tl_channels_update_emoji_status_gen.go index c999f0fad9..68e6d7cedc 100644 --- a/tg/tl_channels_update_emoji_status_gen.go +++ b/tg/tl_channels_update_emoji_status_gen.go @@ -223,8 +223,11 @@ func (u *ChannelsUpdateEmojiStatusRequest) GetEmojiStatusAsNotEmpty() (NotEmptyE // Links: // 1. https://core.telegram.org/api/emoji-status // +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. +// // See https://core.telegram.org/method/channels.updateEmojiStatus for reference. -// Can be used by bots. func (c *Client) ChannelsUpdateEmojiStatus(ctx context.Context, request *ChannelsUpdateEmojiStatusRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_errors_gen.go b/tg/tl_errors_gen.go index 2357773ff7..076df1f625 100644 --- a/tg/tl_errors_gen.go +++ b/tg/tl_errors_gen.go @@ -65,6 +65,7 @@ const ( ErrBoostPeerInvalid = "BOOST_PEER_INVALID" ErrBotsTooMuch = "BOTS_TOO_MUCH" ErrBotAppInvalid = "BOT_APP_INVALID" + ErrBotAppShortnameInvalid = "BOT_APP_SHORTNAME_INVALID" ErrBotChannelsNa = "BOT_CHANNELS_NA" ErrBotCommandDescriptionInvalid = "BOT_COMMAND_DESCRIPTION_INVALID" ErrBotCommandInvalid = "BOT_COMMAND_INVALID" @@ -77,6 +78,7 @@ const ( ErrBotPaymentsDisabled = "BOT_PAYMENTS_DISABLED" ErrBotResponseTimeout = "BOT_RESPONSE_TIMEOUT" ErrBotScoreNotModified = "BOT_SCORE_NOT_MODIFIED" + ErrBotWebviewDisabled = "BOT_WEBVIEW_DISABLED" ErrBroadcastForbidden = "BROADCAST_FORBIDDEN" ErrBroadcastIDInvalid = "BROADCAST_ID_INVALID" ErrBroadcastPublicVotersForbidden = "BROADCAST_PUBLIC_VOTERS_FORBIDDEN" @@ -215,13 +217,13 @@ const ( 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" ErrGifIDInvalid = "GIF_ID_INVALID" ErrGraphExpiredReload = "GRAPH_EXPIRED_RELOAD" ErrGraphInvalidReload = "GRAPH_INVALID_RELOAD" ErrGraphOutdatedReload = "GRAPH_OUTDATED_RELOAD" - ErrGroupcallAddParticipantsFailed = "GROUPCALL_ADD_PARTICIPANTS_FAILED" ErrGroupcallAlreadyDiscarded = "GROUPCALL_ALREADY_DISCARDED" ErrGroupcallAlreadyStarted = "GROUPCALL_ALREADY_STARTED" ErrGroupcallForbidden = "GROUPCALL_FORBIDDEN" @@ -242,6 +244,7 @@ const ( ErrInputChatlistInvalid = "INPUT_CHATLIST_INVALID" ErrInputFilterInvalid = "INPUT_FILTER_INVALID" ErrInputTextEmpty = "INPUT_TEXT_EMPTY" + ErrInputTextTooLong = "INPUT_TEXT_TOO_LONG" ErrInputUserDeactivated = "INPUT_USER_DEACTIVATED" ErrInvitesTooMuch = "INVITES_TOO_MUCH" ErrInviteForbiddenWithJoinas = "INVITE_FORBIDDEN_WITH_JOINAS" @@ -274,12 +277,10 @@ 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" ErrMegagroupRequired = "MEGAGROUP_REQUIRED" - ErrMemberNotFound = "MEMBER_NOT_FOUND" ErrMessageAuthorRequired = "MESSAGE_AUTHOR_REQUIRED" ErrMessageDeleteForbidden = "MESSAGE_DELETE_FORBIDDEN" ErrMessageEditTimeExpired = "MESSAGE_EDIT_TIME_EXPIRED" @@ -361,6 +362,7 @@ const ( ErrPollQuestionInvalid = "POLL_QUESTION_INVALID" ErrPollVoteRequired = "POLL_VOTE_REQUIRED" ErrPremiumAccountRequired = "PREMIUM_ACCOUNT_REQUIRED" + ErrPremiumSubActiveUntil = "PREMIUM_SUB_ACTIVE_UNTIL" ErrPreviousChatImportActiveWaitMin = "PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_MIN" ErrPrivacyKeyInvalid = "PRIVACY_KEY_INVALID" ErrPrivacyTooLong = "PRIVACY_TOO_LONG" @@ -386,6 +388,7 @@ const ( ErrReplyMarkupBuyEmpty = "REPLY_MARKUP_BUY_EMPTY" ErrReplyMarkupInvalid = "REPLY_MARKUP_INVALID" ErrReplyMarkupTooLong = "REPLY_MARKUP_TOO_LONG" + ErrReplyMessageIDInvalid = "REPLY_MESSAGE_ID_INVALID" ErrReplyToInvalid = "REPLY_TO_INVALID" ErrReplyToUserInvalid = "REPLY_TO_USER_INVALID" ErrResetRequestMissing = "RESET_REQUEST_MISSING" @@ -460,6 +463,7 @@ const ( ErrStorySendFloodWeekly = "STORY_SEND_FLOOD_WEEKLY" ErrSwitchPmTextEmpty = "SWITCH_PM_TEXT_EMPTY" ErrTakeoutInitDelay = "TAKEOUT_INIT_DELAY" + ErrTakeoutInvalid = "TAKEOUT_INVALID" ErrTakeoutRequired = "TAKEOUT_REQUIRED" ErrTaskAlreadyExists = "TASK_ALREADY_EXISTS" ErrTempAuthKeyAlreadyBound = "TEMP_AUTH_KEY_ALREADY_BOUND" @@ -708,6 +712,11 @@ func IsBotAppInvalid(err error) bool { return tgerr.Is(err, ErrBotAppInvalid) } +// IsBotAppShortnameInvalid reports whether err is BOT_APP_SHORTNAME_INVALID. +func IsBotAppShortnameInvalid(err error) bool { + return tgerr.Is(err, ErrBotAppShortnameInvalid) +} + // IsBotChannelsNa reports whether err is BOT_CHANNELS_NA. func IsBotChannelsNa(err error) bool { return tgerr.Is(err, ErrBotChannelsNa) @@ -768,6 +777,11 @@ func IsBotScoreNotModified(err error) bool { return tgerr.Is(err, ErrBotScoreNotModified) } +// IsBotWebviewDisabled reports whether err is BOT_WEBVIEW_DISABLED. +func IsBotWebviewDisabled(err error) bool { + return tgerr.Is(err, ErrBotWebviewDisabled) +} + // IsBroadcastForbidden reports whether err is BROADCAST_FORBIDDEN. func IsBroadcastForbidden(err error) bool { return tgerr.Is(err, ErrBroadcastForbidden) @@ -1458,6 +1472,11 @@ 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) +} + // IsGiftSlugInvalid reports whether err is GIFT_SLUG_INVALID. func IsGiftSlugInvalid(err error) bool { return tgerr.Is(err, ErrGiftSlugInvalid) @@ -1488,11 +1507,6 @@ func IsGraphOutdatedReload(err error) bool { return tgerr.Is(err, ErrGraphOutdatedReload) } -// IsGroupcallAddParticipantsFailed reports whether err is GROUPCALL_ADD_PARTICIPANTS_FAILED. -func IsGroupcallAddParticipantsFailed(err error) bool { - return tgerr.Is(err, ErrGroupcallAddParticipantsFailed) -} - // IsGroupcallAlreadyDiscarded reports whether err is GROUPCALL_ALREADY_DISCARDED. func IsGroupcallAlreadyDiscarded(err error) bool { return tgerr.Is(err, ErrGroupcallAlreadyDiscarded) @@ -1593,6 +1607,11 @@ func IsInputTextEmpty(err error) bool { return tgerr.Is(err, ErrInputTextEmpty) } +// IsInputTextTooLong reports whether err is INPUT_TEXT_TOO_LONG. +func IsInputTextTooLong(err error) bool { + return tgerr.Is(err, ErrInputTextTooLong) +} + // IsInputUserDeactivated reports whether err is INPUT_USER_DEACTIVATED. func IsInputUserDeactivated(err error) bool { return tgerr.Is(err, ErrInputUserDeactivated) @@ -1753,11 +1772,6 @@ 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) @@ -1778,11 +1792,6 @@ func IsMegagroupRequired(err error) bool { return tgerr.Is(err, ErrMegagroupRequired) } -// IsMemberNotFound reports whether err is MEMBER_NOT_FOUND. -func IsMemberNotFound(err error) bool { - return tgerr.Is(err, ErrMemberNotFound) -} - // IsMessageAuthorRequired reports whether err is MESSAGE_AUTHOR_REQUIRED. func IsMessageAuthorRequired(err error) bool { return tgerr.Is(err, ErrMessageAuthorRequired) @@ -2188,6 +2197,11 @@ func IsPremiumAccountRequired(err error) bool { return tgerr.Is(err, ErrPremiumAccountRequired) } +// IsPremiumSubActiveUntil reports whether err is PREMIUM_SUB_ACTIVE_UNTIL. +func IsPremiumSubActiveUntil(err error) bool { + return tgerr.Is(err, ErrPremiumSubActiveUntil) +} + // IsPreviousChatImportActiveWaitMin reports whether err is PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_MIN. func IsPreviousChatImportActiveWaitMin(err error) bool { return tgerr.Is(err, ErrPreviousChatImportActiveWaitMin) @@ -2313,6 +2327,11 @@ func IsReplyMarkupTooLong(err error) bool { return tgerr.Is(err, ErrReplyMarkupTooLong) } +// IsReplyMessageIDInvalid reports whether err is REPLY_MESSAGE_ID_INVALID. +func IsReplyMessageIDInvalid(err error) bool { + return tgerr.Is(err, ErrReplyMessageIDInvalid) +} + // IsReplyToInvalid reports whether err is REPLY_TO_INVALID. func IsReplyToInvalid(err error) bool { return tgerr.Is(err, ErrReplyToInvalid) @@ -2683,6 +2702,11 @@ func IsTakeoutInitDelay(err error) bool { return tgerr.Is(err, ErrTakeoutInitDelay) } +// IsTakeoutInvalid reports whether err is TAKEOUT_INVALID. +func IsTakeoutInvalid(err error) bool { + return tgerr.Is(err, ErrTakeoutInvalid) +} + // IsTakeoutRequired reports whether err is TAKEOUT_REQUIRED. func IsTakeoutRequired(err error) bool { return tgerr.Is(err, ErrTakeoutRequired) diff --git a/tg/tl_message_fwd_header_gen.go b/tg/tl_message_fwd_header_gen.go index 268fcd53e6..cf5c7329cf 100644 --- a/tg/tl_message_fwd_header_gen.go +++ b/tg/tl_message_fwd_header_gen.go @@ -47,7 +47,12 @@ type MessageFwdHeader struct { // Links: // 1) https://core.telegram.org/api/import Imported bool - // SavedOut field of MessageFwdHeader. + // Only for messages forwarded to saved messages »¹, set if the original message was + // outgoing (though the message may have been originally outgoing even if this flag is + // not set, if from_id points to the current user). + // + // Links: + // 1) https://core.telegram.org/api/saved-messages SavedOut bool // The ID of the user that originally sent the message // @@ -67,25 +72,52 @@ type MessageFwdHeader struct { // // Use SetPostAuthor and GetPostAuthor helpers. PostAuthor string - // Only for messages forwarded to the current user (inputPeerSelf), full info about the - // user/channel that originally sent the message + // Only for messages forwarded to saved messages »¹, contains the dialog where the + // message was originally sent. + // + // Links: + // 1) https://core.telegram.org/api/saved-messages // // Use SetSavedFromPeer and GetSavedFromPeer helpers. SavedFromPeer PeerClass - // Only for messages forwarded to the current user (inputPeerSelf), ID of the message - // that was forwarded from the original user/channel + // Only for messages forwarded to saved messages »¹, contains the original ID of the + // message in saved_from_peer. + // + // Links: + // 1) https://core.telegram.org/api/saved-messages // // Use SetSavedFromMsgID and GetSavedFromMsgID helpers. SavedFromMsgID int - // SavedFromID field of MessageFwdHeader. + // 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). + // + // Links: + // 1) https://core.telegram.org/api/saved-messages // // Use SetSavedFromID and GetSavedFromID helpers. SavedFromID PeerClass - // SavedFromName field of MessageFwdHeader. + // 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). + // + // Links: + // 1) https://core.telegram.org/api/saved-messages // // Use SetSavedFromName and GetSavedFromName helpers. SavedFromName string - // SavedDate field of MessageFwdHeader. + // 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 + // message² will contain 3). + // + // Links: + // 1) https://core.telegram.org/api/saved-messages + // 2) https://core.telegram.org/constructor/message // // Use SetSavedDate and GetSavedDate helpers. SavedDate int diff --git a/tg/tl_message_gen.go b/tg/tl_message_gen.go index bde3bec6e8..6b1bd28896 100644 --- a/tg/tl_message_gen.go +++ b/tg/tl_message_gen.go @@ -296,7 +296,12 @@ type Message struct { FromID PeerClass // Peer ID, the chat where this message was sent PeerID PeerClass - // SavedPeerID field of Message. + // Messages fetched from a saved messages dialog »¹ will have peer=inputPeerSelf² and + // the saved_peer_id flag set to the ID of the saved dialog. + // + // Links: + // 1) https://core.telegram.org/api/saved-messages + // 2) https://core.telegram.org/constructor/inputPeerSelf // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID PeerClass diff --git a/tg/tl_message_media_gen.go b/tg/tl_message_media_gen.go index 19d3cd7c03..e08698cf37 100644 --- a/tg/tl_message_media_gen.go +++ b/tg/tl_message_media_gen.go @@ -898,11 +898,11 @@ type MessageMediaDocument struct { Nopremium bool // Whether this media should be hidden behind a spoiler warning Spoiler bool - // Video field of MessageMediaDocument. + // Whether this is a video. Video bool - // Round field of MessageMediaDocument. + // Whether this is a round video. Round bool - // Voice field of MessageMediaDocument. + // Whether this is a voice message. Voice bool // Attached document // diff --git a/tg/tl_messages_delete_saved_history_gen.go b/tg/tl_messages_delete_saved_history_gen.go index 8c3be257b1..4ae03192be 100644 --- a/tg/tl_messages_delete_saved_history_gen.go +++ b/tg/tl_messages_delete_saved_history_gen.go @@ -32,6 +32,10 @@ var ( ) // MessagesDeleteSavedHistoryRequest represents TL type `messages.deleteSavedHistory#6e98102b`. +// Deletes messages forwarded from a specific peer to saved messages »¹. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/method/messages.deleteSavedHistory for reference. type MessagesDeleteSavedHistoryRequest struct { @@ -40,15 +44,18 @@ type MessagesDeleteSavedHistoryRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Peer field of MessagesDeleteSavedHistoryRequest. + // Peer, whose messages will be deleted from saved messages »¹ + // + // Links: + // 1) https://core.telegram.org/api/saved-messages Peer InputPeerClass - // MaxID field of MessagesDeleteSavedHistoryRequest. + // Maximum ID of message to delete MaxID int - // MinDate field of MessagesDeleteSavedHistoryRequest. + // Delete all messages newer than this UNIX timestamp // // Use SetMinDate and GetMinDate helpers. MinDate int - // MaxDate field of MessagesDeleteSavedHistoryRequest. + // Delete all messages older than this UNIX timestamp // // Use SetMaxDate and GetMaxDate helpers. MaxDate int @@ -310,9 +317,16 @@ func (d *MessagesDeleteSavedHistoryRequest) GetMaxDate() (value int, ok bool) { } // MessagesDeleteSavedHistory invokes method messages.deleteSavedHistory#6e98102b returning error if any. +// Deletes messages forwarded from a specific peer to saved messages »¹. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.deleteSavedHistory for reference. -// Can be used by bots. func (c *Client) MessagesDeleteSavedHistory(ctx context.Context, request *MessagesDeleteSavedHistoryRequest) (*MessagesAffectedHistory, error) { var result MessagesAffectedHistory diff --git a/tg/tl_messages_edit_exported_chat_invite_gen.go b/tg/tl_messages_edit_exported_chat_invite_gen.go index 0b931ca971..04201533d5 100644 --- a/tg/tl_messages_edit_exported_chat_invite_gen.go +++ b/tg/tl_messages_edit_exported_chat_invite_gen.go @@ -454,6 +454,7 @@ func (e *MessagesEditExportedChatInviteRequest) GetTitle() (value string, ok boo // 403 EDIT_BOT_INVITE_FORBIDDEN: Normal users can't edit invites that were created by bots. // 400 INVITE_HASH_EXPIRED: The invite link has expired. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 USAGE_LIMIT_INVALID: The specified usage limit is invalid. // // See https://core.telegram.org/method/messages.editExportedChatInvite for reference. // Can be used by bots. diff --git a/tg/tl_messages_edit_message_gen.go b/tg/tl_messages_edit_message_gen.go index f6682d030b..ab64f2d9cf 100644 --- a/tg/tl_messages_edit_message_gen.go +++ b/tg/tl_messages_edit_message_gen.go @@ -607,6 +607,7 @@ func (e *MessagesEditMessageRequest) MapEntities() (value MessageEntityClassArra // 500 MSG_WAIT_FAILED: A waiting call returned an error. // 400 PEER_ID_INVALID: The provided peer id 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. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. // diff --git a/tg/tl_messages_forward_messages_gen.go b/tg/tl_messages_forward_messages_gen.go index f39c13e9b9..02ed47078a 100644 --- a/tg/tl_messages_forward_messages_gen.go +++ b/tg/tl_messages_forward_messages_gen.go @@ -702,6 +702,7 @@ func (f *MessagesForwardMessagesRequest) GetSendAs() (value InputPeerClass, ok b // 400 QUIZ_ANSWER_MISSING: You can forward a quiz while hiding the original author only after choosing an option in the quiz. // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. // 400 RANDOM_ID_INVALID: A provided random ID is invalid. +// 400 SCHEDULE_BOT_NOT_ALLOWED: Bots cannot schedule messages. // 400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future. // 400 SCHEDULE_TOO_MUCH: There are too many scheduled messages. // 400 SEND_AS_PEER_INVALID: You can't send messages as the specified peer. diff --git a/tg/tl_messages_get_history_gen.go b/tg/tl_messages_get_history_gen.go index 668882b482..91280e4bec 100644 --- a/tg/tl_messages_get_history_gen.go +++ b/tg/tl_messages_get_history_gen.go @@ -370,6 +370,7 @@ func (g *MessagesGetHistoryRequest) GetHash() (value int64) { // 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 TAKEOUT_INVALID: The specified takeout ID is invalid. // // See https://core.telegram.org/method/messages.getHistory for reference. func (c *Client) MessagesGetHistory(ctx context.Context, request *MessagesGetHistoryRequest) (MessagesMessagesClass, error) { diff --git a/tg/tl_messages_get_pinned_saved_dialogs_gen.go b/tg/tl_messages_get_pinned_saved_dialogs_gen.go index b4c455d47b..dde2215c5d 100644 --- a/tg/tl_messages_get_pinned_saved_dialogs_gen.go +++ b/tg/tl_messages_get_pinned_saved_dialogs_gen.go @@ -32,6 +32,10 @@ var ( ) // MessagesGetPinnedSavedDialogsRequest represents TL type `messages.getPinnedSavedDialogs#d63d94e0`. +// Get pinned saved dialogs, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/method/messages.getPinnedSavedDialogs for reference. type MessagesGetPinnedSavedDialogsRequest struct { @@ -128,9 +132,12 @@ func (g *MessagesGetPinnedSavedDialogsRequest) DecodeBare(b *bin.Buffer) error { } // MessagesGetPinnedSavedDialogs invokes method messages.getPinnedSavedDialogs#d63d94e0 returning error if any. +// Get pinned saved dialogs, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/method/messages.getPinnedSavedDialogs for reference. -// Can be used by bots. func (c *Client) MessagesGetPinnedSavedDialogs(ctx context.Context) (MessagesSavedDialogsClass, error) { var result MessagesSavedDialogsBox diff --git a/tg/tl_messages_get_saved_dialogs_gen.go b/tg/tl_messages_get_saved_dialogs_gen.go index 2d325331a8..75d89a9929 100644 --- a/tg/tl_messages_get_saved_dialogs_gen.go +++ b/tg/tl_messages_get_saved_dialogs_gen.go @@ -32,6 +32,10 @@ var ( ) // MessagesGetSavedDialogsRequest represents TL type `messages.getSavedDialogs#5381d21a`. +// Returns the current saved dialog list, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/method/messages.getSavedDialogs for reference. type MessagesGetSavedDialogsRequest struct { @@ -40,24 +44,25 @@ type MessagesGetSavedDialogsRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ExcludePinned field of MessagesGetSavedDialogsRequest. + // Exclude pinned dialogs ExcludePinned bool // Offsets for pagination, for more info click here¹ // // Links: // 1) https://core.telegram.org/api/offsets OffsetDate int - // Offsets for pagination, for more info click here¹ + // Offsets for pagination, for more info click here¹ (top_message ID used for + // pagination) // // Links: // 1) https://core.telegram.org/api/offsets OffsetID int - // OffsetPeer field of MessagesGetSavedDialogsRequest. - OffsetPeer InputPeerClass - // Maximum number of results to return, see pagination¹ + // Offset peer for pagination¹ // // Links: // 1) https://core.telegram.org/api/offsets + OffsetPeer InputPeerClass + // Number of list elements to be returned Limit int // Hash for pagination, for more info click here¹ // @@ -342,9 +347,12 @@ func (g *MessagesGetSavedDialogsRequest) GetHash() (value int64) { } // MessagesGetSavedDialogs invokes method messages.getSavedDialogs#5381d21a returning error if any. +// Returns the current saved dialog list, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/method/messages.getSavedDialogs for reference. -// Can be used by bots. func (c *Client) MessagesGetSavedDialogs(ctx context.Context, request *MessagesGetSavedDialogsRequest) (MessagesSavedDialogsClass, error) { var result MessagesSavedDialogsBox diff --git a/tg/tl_messages_get_saved_history_gen.go b/tg/tl_messages_get_saved_history_gen.go index 238e4b0be6..76331fff78 100644 --- a/tg/tl_messages_get_saved_history_gen.go +++ b/tg/tl_messages_get_saved_history_gen.go @@ -32,39 +32,33 @@ var ( ) // MessagesGetSavedHistoryRequest represents TL type `messages.getSavedHistory#3d9a414d`. +// Returns saved messages »¹ forwarded from a specific peer +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/method/messages.getSavedHistory for reference. type MessagesGetSavedHistoryRequest struct { - // Peer field of MessagesGetSavedHistoryRequest. + // Target peer Peer InputPeerClass - // Offsets for pagination, for more info click here¹ - // - // Links: - // 1) https://core.telegram.org/api/offsets + // Only return messages starting from the specified message ID OffsetID int - // Offsets for pagination, for more info click here¹ - // - // Links: - // 1) https://core.telegram.org/api/offsets + // Only return messages sent before the specified date OffsetDate int - // Offsets for pagination, for more info click here¹ - // - // Links: - // 1) https://core.telegram.org/api/offsets + // Number of list elements to be skipped, negative values are also accepted. AddOffset int - // Maximum number of results to return, see pagination¹ - // - // Links: - // 1) https://core.telegram.org/api/offsets + // Number of results to return Limit int - // MaxID field of MessagesGetSavedHistoryRequest. + // If a positive value was transferred, the method will return only messages with IDs + // less than max_id MaxID int - // MinID field of MessagesGetSavedHistoryRequest. + // If a positive value was transferred, the method will return only messages with IDs + // more than min_id MinID int - // Hash for pagination, for more info click here¹ + // Result hash¹ // // Links: - // 1) https://core.telegram.org/api/offsets#hash-generation + // 1) https://core.telegram.org/api/offsets Hash int64 } @@ -370,9 +364,16 @@ func (g *MessagesGetSavedHistoryRequest) GetHash() (value int64) { } // MessagesGetSavedHistory invokes method messages.getSavedHistory#3d9a414d returning error if any. +// Returns saved messages »¹ forwarded from a specific peer +// +// Links: +// 1. https://core.telegram.org/api/saved-messages +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.getSavedHistory for reference. -// Can be used by bots. func (c *Client) MessagesGetSavedHistory(ctx context.Context, request *MessagesGetSavedHistoryRequest) (MessagesMessagesClass, error) { var result MessagesMessagesBox diff --git a/tg/tl_messages_get_search_counters_gen.go b/tg/tl_messages_get_search_counters_gen.go index 1a56b17d32..32d32bfb1b 100644 --- a/tg/tl_messages_get_search_counters_gen.go +++ b/tg/tl_messages_get_search_counters_gen.go @@ -47,7 +47,10 @@ type MessagesGetSearchCountersRequest struct { Flags bin.Fields // Peer where to search Peer InputPeerClass - // SavedPeerID field of MessagesGetSearchCountersRequest. + // Search within the saved message dialog »¹ with this ID. + // + // Links: + // 1) https://core.telegram.org/api/saved-messages // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID InputPeerClass diff --git a/tg/tl_messages_get_search_results_calendar_gen.go b/tg/tl_messages_get_search_results_calendar_gen.go index b4d0d9bf17..6a7cd49f38 100644 --- a/tg/tl_messages_get_search_results_calendar_gen.go +++ b/tg/tl_messages_get_search_results_calendar_gen.go @@ -46,7 +46,10 @@ type MessagesGetSearchResultsCalendarRequest struct { Flags bin.Fields // Peer where to search Peer InputPeerClass - // SavedPeerID field of MessagesGetSearchResultsCalendarRequest. + // Search within the saved message dialog »¹ with this ID. + // + // Links: + // 1) https://core.telegram.org/api/saved-messages // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID InputPeerClass diff --git a/tg/tl_messages_get_search_results_positions_gen.go b/tg/tl_messages_get_search_results_positions_gen.go index 15477efc4f..b7cc17eaa5 100644 --- a/tg/tl_messages_get_search_results_positions_gen.go +++ b/tg/tl_messages_get_search_results_positions_gen.go @@ -46,7 +46,10 @@ type MessagesGetSearchResultsPositionsRequest struct { Flags bin.Fields // Peer where to search Peer InputPeerClass - // SavedPeerID field of MessagesGetSearchResultsPositionsRequest. + // Search within the saved message dialog »¹ with this ID. + // + // Links: + // 1) https://core.telegram.org/api/saved-messages // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID InputPeerClass diff --git a/tg/tl_messages_reorder_pinned_saved_dialogs_gen.go b/tg/tl_messages_reorder_pinned_saved_dialogs_gen.go index 1a52e707fd..2c4b166cf6 100644 --- a/tg/tl_messages_reorder_pinned_saved_dialogs_gen.go +++ b/tg/tl_messages_reorder_pinned_saved_dialogs_gen.go @@ -32,6 +32,10 @@ var ( ) // MessagesReorderPinnedSavedDialogsRequest represents TL type `messages.reorderPinnedSavedDialogs#8b716587`. +// Reorder pinned saved message dialogs »¹. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/method/messages.reorderPinnedSavedDialogs for reference. type MessagesReorderPinnedSavedDialogsRequest struct { @@ -40,9 +44,9 @@ type MessagesReorderPinnedSavedDialogsRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Force field of MessagesReorderPinnedSavedDialogsRequest. + // If set, dialogs pinned server-side but not present in the order field will be unpinned. Force bool - // Order field of MessagesReorderPinnedSavedDialogsRequest. + // New dialog order Order []InputDialogPeerClass } @@ -240,9 +244,12 @@ func (r *MessagesReorderPinnedSavedDialogsRequest) MapOrder() (value InputDialog } // MessagesReorderPinnedSavedDialogs invokes method messages.reorderPinnedSavedDialogs#8b716587 returning error if any. +// Reorder pinned saved message dialogs »¹. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/method/messages.reorderPinnedSavedDialogs for reference. -// Can be used by bots. func (c *Client) MessagesReorderPinnedSavedDialogs(ctx context.Context, request *MessagesReorderPinnedSavedDialogsRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_request_app_web_view_gen.go b/tg/tl_messages_request_app_web_view_gen.go index 1246020e82..8f353df6b2 100644 --- a/tg/tl_messages_request_app_web_view_gen.go +++ b/tg/tl_messages_request_app_web_view_gen.go @@ -413,6 +413,11 @@ func (r *MessagesRequestAppWebViewRequest) GetPlatform() (value string) { // 2. https://core.telegram.org/api/links#named-mini-app-links // 3. https://core.telegram.org/method/messages.prolongWebView // +// Possible errors: +// +// 400 BOT_APP_INVALID: The specified bot app is invalid. +// 400 BOT_APP_SHORTNAME_INVALID: The specified bot app short name is invalid. +// // See https://core.telegram.org/method/messages.requestAppWebView for reference. func (c *Client) MessagesRequestAppWebView(ctx context.Context, request *MessagesRequestAppWebViewRequest) (*AppWebViewResultURL, error) { var result AppWebViewResultURL diff --git a/tg/tl_messages_request_web_view_gen.go b/tg/tl_messages_request_web_view_gen.go index 45e7ed4e67..cd122f9e25 100644 --- a/tg/tl_messages_request_web_view_gen.go +++ b/tg/tl_messages_request_web_view_gen.go @@ -615,7 +615,9 @@ func (r *MessagesRequestWebViewRequest) GetSendAs() (value InputPeerClass, ok bo // Possible errors: // // 400 BOT_INVALID: This is not a valid bot. +// 400 BOT_WEBVIEW_DISABLED: // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 YOU_BLOCKED_USER: You blocked this user. // // See https://core.telegram.org/method/messages.requestWebView for reference. func (c *Client) MessagesRequestWebView(ctx context.Context, request *MessagesRequestWebViewRequest) (*WebViewResultURL, error) { diff --git a/tg/tl_messages_saved_dialogs_gen.go b/tg/tl_messages_saved_dialogs_gen.go index f1d43ba155..19d468f1e4 100644 --- a/tg/tl_messages_saved_dialogs_gen.go +++ b/tg/tl_messages_saved_dialogs_gen.go @@ -32,16 +32,23 @@ var ( ) // MessagesSavedDialogs represents TL type `messages.savedDialogs#f83ae221`. +// Represents some saved message dialogs »¹. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/constructor/messages.savedDialogs for reference. type MessagesSavedDialogs struct { - // Dialogs field of MessagesSavedDialogs. + // Saved message dialogs »¹. + // + // Links: + // 1) https://core.telegram.org/api/saved-messages Dialogs []SavedDialog - // Messages field of MessagesSavedDialogs. + // List of last messages from each saved dialog Messages []MessageClass - // Chats field of MessagesSavedDialogs. + // Mentioned chats Chats []ChatClass - // Users field of MessagesSavedDialogs. + // Mentioned users Users []UserClass } @@ -331,18 +338,22 @@ func (s *MessagesSavedDialogs) MapUsers() (value UserClassArray) { } // MessagesSavedDialogsSlice represents TL type `messages.savedDialogsSlice#44ba9dd9`. +// Incomplete list of saved message dialogs »¹ with messages and auxiliary data. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/constructor/messages.savedDialogsSlice for reference. type MessagesSavedDialogsSlice struct { - // Count field of MessagesSavedDialogsSlice. + // Total number of saved message dialogs Count int - // Dialogs field of MessagesSavedDialogsSlice. + // List of saved message dialogs Dialogs []SavedDialog - // Messages field of MessagesSavedDialogsSlice. + // List of last messages from dialogs Messages []MessageClass - // Chats field of MessagesSavedDialogsSlice. + // Mentioned chats Chats []ChatClass - // Users field of MessagesSavedDialogsSlice. + // Mentioned users Users []UserClass } @@ -657,10 +668,14 @@ func (s *MessagesSavedDialogsSlice) MapUsers() (value UserClassArray) { } // MessagesSavedDialogsNotModified represents TL type `messages.savedDialogsNotModified#c01f6fe8`. +// The saved dialogs haven't changed // // See https://core.telegram.org/constructor/messages.savedDialogsNotModified for reference. type MessagesSavedDialogsNotModified struct { - // Count field of MessagesSavedDialogsNotModified. + // Number of saved dialogs¹ found server-side by the query + // + // Links: + // 1) https://core.telegram.org/api/saved-messages Count int } @@ -850,16 +865,19 @@ type ModifiedMessagesSavedDialogs interface { // Zero returns true if current object has a zero value. Zero() bool - // Dialogs field of MessagesSavedDialogs. + // Saved message dialogs »¹. + // + // Links: + // 1) https://core.telegram.org/api/saved-messages GetDialogs() (value []SavedDialog) - // Messages field of MessagesSavedDialogs. + // List of last messages from each saved dialog GetMessages() (value []MessageClass) - // Chats field of MessagesSavedDialogs. + // Mentioned chats GetChats() (value []ChatClass) - // Users field of MessagesSavedDialogs. + // Mentioned users GetUsers() (value []UserClass) } diff --git a/tg/tl_messages_search_gen.go b/tg/tl_messages_search_gen.go index 2060977f40..4ecd1297c7 100644 --- a/tg/tl_messages_search_gen.go +++ b/tg/tl_messages_search_gen.go @@ -56,7 +56,10 @@ type MessagesSearchRequest struct { // // Use SetFromID and GetFromID helpers. FromID InputPeerClass - // SavedPeerID field of MessagesSearchRequest. + // Search within the saved message dialog »¹ with this ID. + // + // Links: + // 1) https://core.telegram.org/api/saved-messages // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID InputPeerClass diff --git a/tg/tl_messages_send_bot_requested_peer_gen.go b/tg/tl_messages_send_bot_requested_peer_gen.go index 65f54e2966..252b189320 100644 --- a/tg/tl_messages_send_bot_requested_peer_gen.go +++ b/tg/tl_messages_send_bot_requested_peer_gen.go @@ -290,7 +290,6 @@ func (s *MessagesSendBotRequestedPeerRequest) MapRequestedPeers() (value InputPe // 1. https://core.telegram.org/constructor/keyboardButtonRequestPeer // // See https://core.telegram.org/method/messages.sendBotRequestedPeer for reference. -// Can be used by bots. func (c *Client) MessagesSendBotRequestedPeer(ctx context.Context, request *MessagesSendBotRequestedPeerRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_send_inline_bot_result_gen.go b/tg/tl_messages_send_inline_bot_result_gen.go index 74f8322f7a..a0cfd02e27 100644 --- a/tg/tl_messages_send_inline_bot_result_gen.go +++ b/tg/tl_messages_send_inline_bot_result_gen.go @@ -599,6 +599,7 @@ func (s *MessagesSendInlineBotResultRequest) GetSendAs() (value InputPeerClass, // 403 CHAT_SEND_INLINE_FORBIDDEN: You can't send inline messages in this group. // 403 CHAT_SEND_MEDIA_FORBIDDEN: You can't send media in this chat. // 403 CHAT_SEND_PHOTOS_FORBIDDEN: You can't send photos in this chat. +// 403 CHAT_SEND_PLAIN_FORBIDDEN: You can't send non-media (text) messages in this chat. // 403 CHAT_SEND_STICKERS_FORBIDDEN: You can't send stickers in this chat. // 403 CHAT_SEND_VOICES_FORBIDDEN: You can't send voice recordings in this chat. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. @@ -614,7 +615,7 @@ func (s *MessagesSendInlineBotResultRequest) GetSendAs() (value InputPeerClass, // 400 RESULT_ID_INVALID: One of the specified result IDs is invalid. // 400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future. // 400 SCHEDULE_TOO_MUCH: There are too many scheduled messages. -// 500 SEND_MEDIA_INVALID: +// 500 SEND_MEDIA_INVALID: The specified media is invalid. // 420 SLOWMODE_WAIT_%d: Slowmode is enabled in this chat: wait %d seconds before sending another message to this chat. // 400 TOPIC_DELETED: The specified topic was deleted. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. diff --git a/tg/tl_messages_send_reaction_gen.go b/tg/tl_messages_send_reaction_gen.go index a3cacad82c..623001ae32 100644 --- a/tg/tl_messages_send_reaction_gen.go +++ b/tg/tl_messages_send_reaction_gen.go @@ -376,11 +376,12 @@ func (s *MessagesSendReactionRequest) MapReaction() (value ReactionClassArray, o // // Possible errors: // -// 403 ANONYMOUS_REACTIONS_DISABLED: +// 403 ANONYMOUS_REACTIONS_DISABLED: Sorry, anonymous administrators cannot leave reactions or participate in polls. // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 CUSTOM_REACTIONS_TOO_MANY: Too many custom reactions were specified. +// 400 DOCUMENT_INVALID: The specified document is invalid. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. // 400 MESSAGE_NOT_MODIFIED: The provided message data is identical to the previous message data, the message wasn't modified. // 400 MSG_ID_INVALID: Invalid message ID provided. diff --git a/tg/tl_messages_send_screenshot_notification_gen.go b/tg/tl_messages_send_screenshot_notification_gen.go index 7596eabf15..26788146d9 100644 --- a/tg/tl_messages_send_screenshot_notification_gen.go +++ b/tg/tl_messages_send_screenshot_notification_gen.go @@ -233,6 +233,7 @@ func (s *MessagesSendScreenshotNotificationRequest) GetRandomID() (value int64) // // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 REPLY_MESSAGE_ID_INVALID: The specified reply-to message ID is invalid. // 400 STORY_ID_INVALID: The specified story ID is invalid. // 400 YOU_BLOCKED_USER: You blocked this user. // diff --git a/tg/tl_messages_toggle_saved_dialog_pin_gen.go b/tg/tl_messages_toggle_saved_dialog_pin_gen.go index eecd9dd809..4545ffaaeb 100644 --- a/tg/tl_messages_toggle_saved_dialog_pin_gen.go +++ b/tg/tl_messages_toggle_saved_dialog_pin_gen.go @@ -32,6 +32,10 @@ var ( ) // MessagesToggleSavedDialogPinRequest represents TL type `messages.toggleSavedDialogPin#ac81bbde`. +// Pin or unpin a saved message dialog »¹. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/method/messages.toggleSavedDialogPin for reference. type MessagesToggleSavedDialogPinRequest struct { @@ -40,9 +44,9 @@ type MessagesToggleSavedDialogPinRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Pinned field of MessagesToggleSavedDialogPinRequest. + // Whether to pin or unpin the dialog Pinned bool - // Peer field of MessagesToggleSavedDialogPinRequest. + // The dialog to pin Peer InputDialogPeerClass } @@ -222,9 +226,16 @@ func (t *MessagesToggleSavedDialogPinRequest) GetPeer() (value InputDialogPeerCl } // MessagesToggleSavedDialogPin invokes method messages.toggleSavedDialogPin#ac81bbde returning error if any. +// Pin or unpin a saved message dialog »¹. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.toggleSavedDialogPin for reference. -// Can be used by bots. func (c *Client) MessagesToggleSavedDialogPin(ctx context.Context, request *MessagesToggleSavedDialogPinRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_translate_text_gen.go b/tg/tl_messages_translate_text_gen.go index 174769af75..03fa925078 100644 --- a/tg/tl_messages_translate_text_gen.go +++ b/tg/tl_messages_translate_text_gen.go @@ -375,6 +375,7 @@ func (t *MessagesTranslateTextRequest) GetToLang() (value string) { // Possible errors: // // 400 INPUT_TEXT_EMPTY: The specified text is empty. +// 400 INPUT_TEXT_TOO_LONG: The specified text is too long. // 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. diff --git a/tg/tl_payments_apply_gift_code_gen.go b/tg/tl_payments_apply_gift_code_gen.go index 69bf582b1c..3505f9aedb 100644 --- a/tg/tl_payments_apply_gift_code_gen.go +++ b/tg/tl_payments_apply_gift_code_gen.go @@ -173,6 +173,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. // // 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_phone_join_group_call_gen.go b/tg/tl_phone_join_group_call_gen.go index 6fedee53e2..1e2725df3a 100644 --- a/tg/tl_phone_join_group_call_gen.go +++ b/tg/tl_phone_join_group_call_gen.go @@ -369,7 +369,6 @@ func (j *PhoneJoinGroupCallRequest) GetParams() (value DataJSON) { // Possible errors: // // 400 DATA_JSON_INVALID: The provided JSON data is invalid. -// 500 GROUPCALL_ADD_PARTICIPANTS_FAILED: // 403 GROUPCALL_FORBIDDEN: The group call has already ended. // 400 GROUPCALL_INVALID: The specified group call is invalid. // 400 GROUPCALL_SSRC_DUPLICATE_MUCH: The app needs to retry joining the group call with a new SSRC value. diff --git a/tg/tl_saved_dialog_gen.go b/tg/tl_saved_dialog_gen.go index 501c36952a..67c305d7f9 100644 --- a/tg/tl_saved_dialog_gen.go +++ b/tg/tl_saved_dialog_gen.go @@ -32,6 +32,10 @@ var ( ) // SavedDialog represents TL type `savedDialog#bd87cb6c`. +// Represents a saved dialog »¹. +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/constructor/savedDialog for reference. type SavedDialog struct { @@ -40,11 +44,11 @@ type SavedDialog struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Pinned field of SavedDialog. + // Is the dialog pinned Pinned bool - // Peer field of SavedDialog. + // The dialog Peer PeerClass - // TopMessage field of SavedDialog. + // The latest message ID TopMessage int } diff --git a/tg/tl_stories_export_story_link_gen.go b/tg/tl_stories_export_story_link_gen.go index 940bbe59d8..5532cd65bf 100644 --- a/tg/tl_stories_export_story_link_gen.go +++ b/tg/tl_stories_export_story_link_gen.go @@ -205,7 +205,7 @@ func (e *StoriesExportStoryLinkRequest) GetID() (value int) { // Possible errors: // // 400 PEER_ID_INVALID: The provided peer id is invalid. -// 400 USER_PUBLIC_MISSING: +// 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. func (c *Client) StoriesExportStoryLink(ctx context.Context, request *StoriesExportStoryLinkRequest) (*ExportedStoryLink, error) { diff --git a/tg/tl_stories_get_story_reactions_list_gen.go b/tg/tl_stories_get_story_reactions_list_gen.go index 8e628a2c02..2a54c9b2fe 100644 --- a/tg/tl_stories_get_story_reactions_list_gen.go +++ b/tg/tl_stories_get_story_reactions_list_gen.go @@ -403,8 +403,11 @@ func (g *StoriesGetStoryReactionsListRequest) GetLimit() (value int) { // 1. https://core.telegram.org/api/reactions // 2. https://core.telegram.org/api/stories // +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// // See https://core.telegram.org/method/stories.getStoryReactionsList for reference. -// Can be used by bots. func (c *Client) StoriesGetStoryReactionsList(ctx context.Context, request *StoriesGetStoryReactionsListRequest) (*StoriesStoryReactionsList, error) { var result StoriesStoryReactionsList diff --git a/tg/tl_stories_send_story_gen.go b/tg/tl_stories_send_story_gen.go index 13074ba86f..126a435300 100644 --- a/tg/tl_stories_send_story_gen.go +++ b/tg/tl_stories_send_story_gen.go @@ -782,7 +782,6 @@ 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: // 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_update_gen.go b/tg/tl_update_gen.go index dd0702e650..19b3a0241e 100644 --- a/tg/tl_update_gen.go +++ b/tg/tl_update_gen.go @@ -24791,6 +24791,10 @@ func (u *UpdateBotMessageReactions) GetQts() (value int) { } // UpdateSavedDialogPinned represents TL type `updateSavedDialogPinned#aeaf9e74`. +// A saved message dialog¹ was pinned/unpinned +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/constructor/updateSavedDialogPinned for reference. type UpdateSavedDialogPinned struct { @@ -24799,9 +24803,9 @@ type UpdateSavedDialogPinned struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Pinned field of UpdateSavedDialogPinned. + // Whether the dialog was pinned Pinned bool - // Peer field of UpdateSavedDialogPinned. + // The dialog Peer DialogPeerClass } @@ -24986,6 +24990,10 @@ func (u *UpdateSavedDialogPinned) GetPeer() (value DialogPeerClass) { } // UpdatePinnedSavedDialogs represents TL type `updatePinnedSavedDialogs#686c85a6`. +// Pinned saved dialogs »¹ were updated +// +// Links: +// 1. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/constructor/updatePinnedSavedDialogs for reference. type UpdatePinnedSavedDialogs struct { @@ -24994,7 +25002,7 @@ type UpdatePinnedSavedDialogs struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Order field of UpdatePinnedSavedDialogs. + // New order of pinned saved dialogs // // Use SetOrder and GetOrder helpers. Order []DialogPeerClass diff --git a/tg/tl_users_get_full_user_gen.go b/tg/tl_users_get_full_user_gen.go index 46cfad988d..5323b5b2fd 100644 --- a/tg/tl_users_get_full_user_gen.go +++ b/tg/tl_users_get_full_user_gen.go @@ -171,6 +171,7 @@ func (g *UsersGetFullUserRequest) GetID() (value InputUserClass) { // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 USERNAME_OCCUPIED: The provided username is already occupied.