diff --git a/go.mod b/go.mod index 4228f4294..1a3a54be1 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/go-faster/jx v1.1.0 github.com/go-faster/xor v1.0.0 github.com/go-openapi/inflect v0.21.0 - github.com/gotd/getdoc v0.43.0 + github.com/gotd/getdoc v0.44.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 bb266af2a..8a277dc2c 100644 --- a/go.sum +++ b/go.sum @@ -21,8 +21,8 @@ github.com/go-openapi/inflect v0.21.0 h1:FoBjBTQEcbg2cJUWX6uwL9OyIW8eqc9k4KhN4lf github.com/go-openapi/inflect v0.21.0/go.mod h1:INezMuUu7SJQc2AyR3WO0DqqYUJSj8Kb4hBd7WtjlAw= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/gotd/getdoc v0.43.0 h1:8ZsO1VebDxxxsFvNIuT2ER/ArmjzCCxWvY4zwF/OaNY= -github.com/gotd/getdoc v0.43.0/go.mod h1:6kVssCElTsjbo5l1JclXjavzJVWTKW8nMFEJEuL3gZg= +github.com/gotd/getdoc v0.44.0 h1:hSJzDY313wysMqmu6+sWg4pbKc4nJF1/316lxjmrPKk= +github.com/gotd/getdoc v0.44.0/go.mod h1:tPqC2xq2IHhcxvmhdRfTA4ZK0YQKtJtbyZgbQcSuAXI= github.com/gotd/ige v0.2.2 h1:XQ9dJZwBfDnOGSTxKXBGP4gMud3Qku2ekScRjDWWfEk= github.com/gotd/ige v0.2.2/go.mod h1:tuCRb+Y5Y3eNTo3ypIfNpQ4MFjrnONiL2jN2AKZXmb0= github.com/gotd/neo v0.1.5 h1:oj0iQfMbGClP8xI59x7fE/uHoTJD7NZH9oV1WNuPukQ= diff --git a/tg/tl_auth_send_code_gen.go b/tg/tl_auth_send_code_gen.go index 3c1a6dedb..5e84423c7 100644 --- a/tg/tl_auth_send_code_gen.go +++ b/tg/tl_auth_send_code_gen.go @@ -263,7 +263,7 @@ func (s *AuthSendCodeRequest) GetSettings() (value CodeSettings) { // 406 PHONE_PASSWORD_FLOOD: You have tried logging in too many times. // 400 PHONE_PASSWORD_PROTECTED: This phone is password protected. // 400 SMS_CODE_CREATE_FAILED: An error occurred while creating the SMS code. -// 406 UPDATE_APP_TO_LOGIN: Please update to the latest version of MadelineProto to login. +// 406 UPDATE_APP_TO_LOGIN: Please update your client to login. // // See https://core.telegram.org/method/auth.sendCode for reference. func (c *Client) AuthSendCode(ctx context.Context, request *AuthSendCodeRequest) (AuthSentCodeClass, error) { diff --git a/tg/tl_auth_sign_in_gen.go b/tg/tl_auth_sign_in_gen.go index 347af9401..c16945b30 100644 --- a/tg/tl_auth_sign_in_gen.go +++ b/tg/tl_auth_sign_in_gen.go @@ -325,7 +325,7 @@ func (s *AuthSignInRequest) GetEmailVerification() (value EmailVerificationClass // 406 PHONE_NUMBER_INVALID: The phone number is invalid. // 400 PHONE_NUMBER_UNOCCUPIED: The phone number is not yet being used. // 500 SIGN_IN_FAILED: Failure while signing in. -// 406 UPDATE_APP_TO_LOGIN: Please update to the latest version of MadelineProto to login. +// 406 UPDATE_APP_TO_LOGIN: Please update your client to login. // // See https://core.telegram.org/method/auth.signIn for reference. func (c *Client) AuthSignIn(ctx context.Context, request *AuthSignInRequest) (AuthAuthorizationClass, error) { diff --git a/tg/tl_bot_info_gen.go b/tg/tl_bot_info_gen.go index a474295f7..7a4a6378b 100644 --- a/tg/tl_bot_info_gen.go +++ b/tg/tl_bot_info_gen.go @@ -71,7 +71,12 @@ type BotInfo struct { // // Use SetMenuButton and GetMenuButton helpers. MenuButton BotMenuButtonClass - // PrivacyPolicyURL field of BotInfo. + // The HTTP link to the privacy policy of the bot. If not set, then the /privacy command + // must be used, if supported by the bot (i.e. if it's present in the commands vector). + // If it isn't supported, then https://telegram.org/privacy-tpa¹ must be opened, instead. + // + // Links: + // 1) https://telegram.org/privacy-tpa // // Use SetPrivacyPolicyURL and GetPrivacyPolicyURL helpers. PrivacyPolicyURL string diff --git a/tg/tl_broadcast_revenue_balances_gen.go b/tg/tl_broadcast_revenue_balances_gen.go index eb1dc11d6..f20857263 100644 --- a/tg/tl_broadcast_revenue_balances_gen.go +++ b/tg/tl_broadcast_revenue_balances_gen.go @@ -42,9 +42,15 @@ var ( // // See https://core.telegram.org/constructor/broadcastRevenueBalances for reference. type BroadcastRevenueBalances struct { - // Flags field of BroadcastRevenueBalances. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // WithdrawalEnabled field of BroadcastRevenueBalances. + // If set, the available balance can be withdrawn »¹. + // + // Links: + // 1) https://core.telegram.org/api/revenue#withdrawing-revenue WithdrawalEnabled bool // Amount of not-yet-withdrawn cryptocurrency. CurrentBalance int64 diff --git a/tg/tl_channel_admin_log_event_action_gen.go b/tg/tl_channel_admin_log_event_action_gen.go index 3ee56e7ad..f986852a2 100644 --- a/tg/tl_channel_admin_log_event_action_gen.go +++ b/tg/tl_channel_admin_log_event_action_gen.go @@ -7573,10 +7573,11 @@ func (c *ChannelAdminLogEventActionChangeEmojiStickerSet) GetNewStickerset() (va } // ChannelAdminLogEventActionToggleSignatureProfiles represents TL type `channelAdminLogEventActionToggleSignatureProfiles#60a79c79`. +// Channel signature profiles were enabled/disabled. // // See https://core.telegram.org/constructor/channelAdminLogEventActionToggleSignatureProfiles for reference. type ChannelAdminLogEventActionToggleSignatureProfiles struct { - // NewValue field of ChannelAdminLogEventActionToggleSignatureProfiles. + // New value NewValue bool } @@ -7709,6 +7710,10 @@ func (c *ChannelAdminLogEventActionToggleSignatureProfiles) GetNewValue() (value } // ChannelAdminLogEventActionParticipantSubExtend represents TL type `channelAdminLogEventActionParticipantSubExtend#64642db3`. +// A paid subscriber has extended their Telegram Star subscription »¹. +// +// Links: +// 1. https://core.telegram.org/api/stars#star-subscriptions // // See https://core.telegram.org/constructor/channelAdminLogEventActionParticipantSubExtend for reference. type ChannelAdminLogEventActionParticipantSubExtend struct { diff --git a/tg/tl_channel_admin_log_events_filter_gen.go b/tg/tl_channel_admin_log_events_filter_gen.go index 5c05201d5..26cae0dda 100644 --- a/tg/tl_channel_admin_log_events_filter_gen.go +++ b/tg/tl_channel_admin_log_events_filter_gen.go @@ -139,7 +139,10 @@ type ChannelAdminLogEventsFilter struct { // Links: // 1) https://core.telegram.org/api/forum Forums bool - // SubExtend field of ChannelAdminLogEventsFilter. + // Telegram Star subscription extension events »¹ + // + // Links: + // 1) https://core.telegram.org/constructor/channelAdminLogEventActionParticipantSubExtend SubExtend bool } diff --git a/tg/tl_channel_participant_gen.go b/tg/tl_channel_participant_gen.go index 269faa3a8..d3829dbee 100644 --- a/tg/tl_channel_participant_gen.go +++ b/tg/tl_channel_participant_gen.go @@ -36,13 +36,20 @@ var ( // // See https://core.telegram.org/constructor/channelParticipant for reference. type ChannelParticipant struct { - // Flags field of ChannelParticipant. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Participant user ID UserID int64 // Date joined Date int - // SubscriptionUntilDate field of ChannelParticipant. + // If set, contains the expiration date of the current Telegram Star subscription period + // »¹ for the specified participant. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions // // Use SetSubscriptionUntilDate and GetSubscriptionUntilDate helpers. SubscriptionUntilDate int @@ -277,7 +284,11 @@ type ChannelParticipantSelf struct { InviterID int64 // When did I join the channel/supergroup Date int - // SubscriptionUntilDate field of ChannelParticipantSelf. + // If set, contains the expiration date of the current Telegram Star subscription period + // »¹ for the specified participant. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions // // Use SetSubscriptionUntilDate and GetSubscriptionUntilDate helpers. SubscriptionUntilDate int diff --git a/tg/tl_channels_toggle_signatures_gen.go b/tg/tl_channels_toggle_signatures_gen.go index 382f3fb98..a5870c564 100644 --- a/tg/tl_channels_toggle_signatures_gen.go +++ b/tg/tl_channels_toggle_signatures_gen.go @@ -36,11 +36,15 @@ var ( // // See https://core.telegram.org/method/channels.toggleSignatures for reference. type ChannelsToggleSignaturesRequest struct { - // Flags field of ChannelsToggleSignaturesRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // SignaturesEnabled field of ChannelsToggleSignaturesRequest. + // If set, enables message signatures. SignaturesEnabled bool - // ProfilesEnabled field of ChannelsToggleSignaturesRequest. + // If set, messages from channel admins will link to their profiles, just like for group + // messages: can only be set if the signatures_enabled flag is set. ProfilesEnabled bool // Channel Channel InputChannelClass diff --git a/tg/tl_chat_full_gen.go b/tg/tl_chat_full_gen.go index 310cd3779..00577c166 100644 --- a/tg/tl_chat_full_gen.go +++ b/tg/tl_chat_full_gen.go @@ -1183,7 +1183,10 @@ type ChannelFull struct { // Links: // 1) https://core.telegram.org/api/stars#revenue-statistics CanViewStarsRevenue bool - // PaidReactionsAvailable field of ChannelFull. + // If set, users may send paid Telegram Star reactions »¹ to messages of this channel. + // + // Links: + // 1) https://core.telegram.org/api/reactions#paid-reactions PaidReactionsAvailable bool // ID of the channel ID int64 diff --git a/tg/tl_chat_gen.go b/tg/tl_chat_gen.go index ec936d567..7200e6645 100644 --- a/tg/tl_chat_gen.go +++ b/tg/tl_chat_gen.go @@ -1161,7 +1161,8 @@ type Channel struct { StoriesHiddenMin bool // No stories from the channel are visible. StoriesUnavailable bool - // SignatureProfiles field of Channel. + // If set, messages sent by admins to this channel will link to the admin's profile (just + // like with groups). SignatureProfiles bool // ID of the channel, see here »¹ for more info // @@ -1263,7 +1264,11 @@ type Channel struct { // // Use SetLevel and GetLevel helpers. Level int - // SubscriptionUntilDate field of Channel. + // Expiration date of the Telegram Star subscription »¹ the current user has bought to + // gain access to this channel. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions // // Use SetSubscriptionUntilDate and GetSubscriptionUntilDate helpers. SubscriptionUntilDate int diff --git a/tg/tl_chat_invite_gen.go b/tg/tl_chat_invite_gen.go index 20ce24d96..871ebf268 100644 --- a/tg/tl_chat_invite_gen.go +++ b/tg/tl_chat_invite_gen.go @@ -214,7 +214,13 @@ type ChatInvite struct { // If set, this chat was reported by many users as a fake or scam: be careful when // interacting with it. Fake bool - // CanRefulfillSubscription field of ChatInvite. + // If set, indicates that the user has already paid for the associated Telegram Star + // subscriptions »¹ and it hasn't expired yet, so they may re-join the channel using + // messages.importChatInvite² without repeating the payment. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions + // 2) https://core.telegram.org/method/messages.importChatInvite CanRefulfillSubscription bool // Chat/supergroup/channel title Title string @@ -235,11 +241,18 @@ type ChatInvite struct { // Links: // 1) https://core.telegram.org/api/colors Color int - // SubscriptionPricing field of ChatInvite. + // For Telegram Star subscriptions »¹, contains the pricing of the subscription the + // user must activate to join the private channel. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions // // Use SetSubscriptionPricing and GetSubscriptionPricing helpers. SubscriptionPricing StarsSubscriptionPricing - // SubscriptionFormID field of ChatInvite. + // For Telegram Star subscriptions »¹, the ID of the payment form for the subscription. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions // // Use SetSubscriptionFormID and GetSubscriptionFormID helpers. SubscriptionFormID int64 diff --git a/tg/tl_document_attribute_gen.go b/tg/tl_document_attribute_gen.go index e051e7936..eb084fe18 100644 --- a/tg/tl_document_attribute_gen.go +++ b/tg/tl_document_attribute_gen.go @@ -601,7 +601,7 @@ type DocumentAttributeVideo struct { // // Use SetVideoStartTs and GetVideoStartTs helpers. VideoStartTs float64 - // VideoCodec field of DocumentAttributeVideo. + // Codec used for the video, i.e. "h264", "h265", or "av1" // // Use SetVideoCodec and GetVideoCodec helpers. VideoCodec string diff --git a/tg/tl_exported_chat_invite_gen.go b/tg/tl_exported_chat_invite_gen.go index b159eaa68..243b09870 100644 --- a/tg/tl_exported_chat_invite_gen.go +++ b/tg/tl_exported_chat_invite_gen.go @@ -74,7 +74,12 @@ type ChatInviteExported struct { // // Use SetRequested and GetRequested helpers. Requested int - // SubscriptionExpired field of ChatInviteExported. + // For Telegram Star subscriptions »¹, contains the number of chat members which have + // already joined the chat using the link, but have already left due to expiration of + // their subscription. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions // // Use SetSubscriptionExpired and GetSubscriptionExpired helpers. SubscriptionExpired int @@ -82,7 +87,11 @@ type ChatInviteExported struct { // // Use SetTitle and GetTitle helpers. Title string - // SubscriptionPricing field of ChatInviteExported. + // For Telegram Star subscriptions »¹, contains the pricing of the subscription the + // user must activate to join the private channel. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions // // Use SetSubscriptionPricing and GetSubscriptionPricing helpers. SubscriptionPricing StarsSubscriptionPricing diff --git a/tg/tl_input_invoice_gen.go b/tg/tl_input_invoice_gen.go index 63beb499a..4a3cfd87d 100644 --- a/tg/tl_input_invoice_gen.go +++ b/tg/tl_input_invoice_gen.go @@ -529,18 +529,21 @@ func (i *InputInvoicePremiumGiftCode) GetOption() (value PremiumGiftCodeOption) // InputInvoiceStars represents TL type `inputInvoiceStars#65f00ce3`. // Used to top up the Telegram Stars¹ balance of the current account or someone else's -// account. +// account, or to start a Telegram Star giveaway »². // // Links: // 1. https://core.telegram.org/api/stars +// 2. https://core.telegram.org/api/giveaways#star-giveaways // // See https://core.telegram.org/constructor/inputInvoiceStars for reference. type InputInvoiceStars struct { - // Either an inputStorePaymentStarsTopup¹ or an inputStorePaymentStarsGift². + // An inputStorePaymentStarsGiveaway¹, inputStorePaymentStarsTopup² or + // inputStorePaymentStarsGift³. // // Links: - // 1) https://core.telegram.org/constructor/inputStorePaymentStarsTopup - // 2) https://core.telegram.org/constructor/inputStorePaymentStarsGift + // 1) https://core.telegram.org/constructor/inputStorePaymentStarsGiveaway + // 2) https://core.telegram.org/constructor/inputStorePaymentStarsTopup + // 3) https://core.telegram.org/constructor/inputStorePaymentStarsGift Purpose InputStorePaymentPurposeClass } @@ -676,10 +679,17 @@ func (i *InputInvoiceStars) GetPurpose() (value InputStorePaymentPurposeClass) { } // InputInvoiceChatInviteSubscription represents TL type `inputInvoiceChatInviteSubscription#34e793f1`. +// Used to pay for a Telegram Star subscription »¹. +// +// Links: +// 1. https://core.telegram.org/api/stars#star-subscriptions // // See https://core.telegram.org/constructor/inputInvoiceChatInviteSubscription for reference. type InputInvoiceChatInviteSubscription struct { - // Hash field of InputInvoiceChatInviteSubscription. + // The invitation link of the Telegram Star subscription »¹ + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions Hash string } @@ -810,18 +820,29 @@ func (i *InputInvoiceChatInviteSubscription) GetHash() (value string) { } // InputInvoiceStarGift represents TL type `inputInvoiceStarGift#25d8c1d8`. +// Used to buy a Telegram Star Gift, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/inputInvoiceStarGift for reference. type InputInvoiceStarGift struct { - // Flags field of InputInvoiceStarGift. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // HideName field of InputInvoiceStarGift. + // If set, your name will be hidden if the destination user decides to display the gift + // on their profile (they will still see that you sent the gift) HideName bool - // UserID field of InputInvoiceStarGift. + // Identifier of the user that will receive the gift UserID InputUserClass - // GiftID field of InputInvoiceStarGift. + // Identifier of the gift, from starGift¹.id + // + // Links: + // 1) https://core.telegram.org/constructor/starGift GiftID int64 - // Message field of InputInvoiceStarGift. + // Optional message, attached with the gift // // Use SetMessage and GetMessage helpers. Message TextWithEntities diff --git a/tg/tl_input_media_gen.go b/tg/tl_input_media_gen.go index 2ace6f964..9803bf366 100644 --- a/tg/tl_input_media_gen.go +++ b/tg/tl_input_media_gen.go @@ -4511,7 +4511,10 @@ func (i *InputMediaWebPage) GetURL() (value string) { // // See https://core.telegram.org/constructor/inputMediaPaidMedia for reference. type InputMediaPaidMedia struct { - // Flags field of InputMediaPaidMedia. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // The price of the media in Telegram Stars¹. // @@ -4520,7 +4523,12 @@ type InputMediaPaidMedia struct { StarsAmount int64 // Photos or videos. ExtendedMedia []InputMediaClass - // Payload field of InputMediaPaidMedia. + // Bots only, specifies a custom payload that will then be passed in + // updateBotPurchasedPaidMedia¹ when a payment is made (this field will not be visible + // to the user) + // + // Links: + // 1) https://core.telegram.org/constructor/updateBotPurchasedPaidMedia // // Use SetPayload and GetPayload helpers. Payload string diff --git a/tg/tl_input_store_payment_purpose_gen.go b/tg/tl_input_store_payment_purpose_gen.go index 9166b087a..dbe17ad3f 100644 --- a/tg/tl_input_store_payment_purpose_gen.go +++ b/tg/tl_input_store_payment_purpose_gen.go @@ -480,7 +480,7 @@ type InputStorePaymentPremiumGiftCode struct { // Links: // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 - // Message field of InputStorePaymentPremiumGiftCode. + // Message attached with the gift // // Use SetMessage and GetMessage helpers. Message TextWithEntities @@ -1785,40 +1785,79 @@ func (i *InputStorePaymentStarsGift) GetAmount() (value int64) { } // InputStorePaymentStarsGiveaway represents TL type `inputStorePaymentStarsGiveaway#751f08fa`. +// Used to pay for a star giveaway, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/giveaways#star-giveaways // // See https://core.telegram.org/constructor/inputStorePaymentStarsGiveaway for reference. type InputStorePaymentStarsGiveaway struct { - // Flags field of InputStorePaymentStarsGiveaway. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // OnlyNewSubscribers field of InputStorePaymentStarsGiveaway. + // If set, only new subscribers starting from the giveaway creation date will be able to + // participate to the giveaway. OnlyNewSubscribers bool - // WinnersAreVisible field of InputStorePaymentStarsGiveaway. + // If set, giveaway winners are public and will be listed in a + // messageMediaGiveawayResults¹ message that will be automatically sent to the channel + // once the giveaway ends. + // + // Links: + // 1) https://core.telegram.org/constructor/messageMediaGiveawayResults WinnersAreVisible bool - // Stars field of InputStorePaymentStarsGiveaway. + // Total number of Telegram Stars being given away (each user will receive stars/users + // stars). Stars int64 - // BoostPeer field of InputStorePaymentStarsGiveaway. + // The channel/supergroup starting the giveaway, that the user must join to participate, + // that will receive the giveaway boosts¹; see here »² for more info on giveaways. + // + // Links: + // 1) https://core.telegram.org/api/boost + // 2) https://core.telegram.org/api/giveaways BoostPeer InputPeerClass - // AdditionalPeers field of InputStorePaymentStarsGiveaway. + // Additional channels that the user must join to participate to the giveaway can be + // specified here. // // Use SetAdditionalPeers and GetAdditionalPeers helpers. AdditionalPeers []InputPeerClass - // CountriesISO2 field of InputStorePaymentStarsGiveaway. + // The set of users that can participate to the giveaway can be restricted by passing + // here an explicit whitelist of up to giveaway_countries_max¹ countries, specified as + // two-letter ISO 3166-1 alpha-2 country codes. + // + // Links: + // 1) https://core.telegram.org/api/config#giveaway-countries-max // // Use SetCountriesISO2 and GetCountriesISO2 helpers. CountriesISO2 []string - // PrizeDescription field of InputStorePaymentStarsGiveaway. + // Can contain a textual description of additional giveaway prizes. // // Use SetPrizeDescription and GetPrizeDescription helpers. PrizeDescription string - // RandomID field of InputStorePaymentStarsGiveaway. + // Random ID to avoid resending the giveaway RandomID int64 - // UntilDate field of InputStorePaymentStarsGiveaway. + // The end date of the giveaway, must be at most giveaway_period_max¹ seconds in the + // future; see here »² for more info on giveaways. + // + // Links: + // 1) https://core.telegram.org/api/config#giveaway-period-max + // 2) https://core.telegram.org/api/giveaways UntilDate int - // Currency field of InputStorePaymentStarsGiveaway. + // Three-letter ISO 4217 currency¹ code + // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string - // Amount field of InputStorePaymentStarsGiveaway. + // Total price in the smallest units of the currency (integer, not float/double). For + // example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in + // currencies.json¹, it shows the number of digits past the decimal point for each + // currency (2 for the majority of currencies). + // + // Links: + // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 - // Users field of InputStorePaymentStarsGiveaway. + // Number of winners. Users int } diff --git a/tg/tl_keyboard_button_gen.go b/tg/tl_keyboard_button_gen.go index a75888262..fb426c870 100644 --- a/tg/tl_keyboard_button_gen.go +++ b/tg/tl_keyboard_button_gen.go @@ -3466,12 +3466,13 @@ func (i *InputKeyboardButtonRequestPeer) GetMaxQuantity() (value int) { } // KeyboardButtonCopy represents TL type `keyboardButtonCopy#75d2698e`. +// Clipboard button: when clicked, the attached text must be copied to the clipboard. // // See https://core.telegram.org/constructor/keyboardButtonCopy for reference. type KeyboardButtonCopy struct { - // Text field of KeyboardButtonCopy. + // Title of the button Text string - // CopyText field of KeyboardButtonCopy. + // The text that will be copied to the clipboard CopyText string } diff --git a/tg/tl_message_action_gen.go b/tg/tl_message_action_gen.go index d58e26b24..ea9583e2b 100644 --- a/tg/tl_message_action_gen.go +++ b/tg/tl_message_action_gen.go @@ -5464,7 +5464,7 @@ type MessageActionGiftPremium struct { // // Use SetCryptoAmount and GetCryptoAmount helpers. CryptoAmount int64 - // Message field of MessageActionGiftPremium. + // Message attached with the gift // // Use SetMessage and GetMessage helpers. Message TextWithEntities @@ -7013,7 +7013,7 @@ type MessageActionGiftCode struct { // // Use SetCryptoAmount and GetCryptoAmount helpers. CryptoAmount int64 - // Message field of MessageActionGiftCode. + // Message attached with the gift // // Use SetMessage and GetMessage helpers. Message TextWithEntities @@ -7529,9 +7529,15 @@ func (m *MessageActionGiftCode) GetMessage() (value TextWithEntities, ok bool) { // // See https://core.telegram.org/constructor/messageActionGiveawayLaunch for reference. type MessageActionGiveawayLaunch struct { - // Flags field of MessageActionGiveawayLaunch. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Stars field of MessageActionGiveawayLaunch. + // For Telegram Star giveaways¹, the total number of Telegram Stars being given away. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-giveaways // // Use SetStars and GetStars helpers. Stars int64 @@ -7706,9 +7712,15 @@ func (m *MessageActionGiveawayLaunch) GetStars() (value int64, ok bool) { // // See https://core.telegram.org/constructor/messageActionGiveawayResults for reference. type MessageActionGiveawayResults struct { - // Flags field of MessageActionGiveawayResults. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Stars field of MessageActionGiveawayResults. + // If set, this is a Telegram Star giveaway¹ + // + // Links: + // 1) https://core.telegram.org/api/stars#star-giveaways Stars bool // Number of winners in the giveaway WinnersCount int @@ -8914,20 +8926,31 @@ func (m *MessageActionGiftStars) GetTransactionID() (value string, ok bool) { } // MessageActionPrizeStars represents TL type `messageActionPrizeStars#b00c47a2`. +// You won some Telegram Stars¹ in a Telegram Star giveaway »². +// +// Links: +// 1. https://core.telegram.org/api/stars +// 2. https://core.telegram.org/api/giveaways#star-giveaways // // See https://core.telegram.org/constructor/messageActionPrizeStars for reference. type MessageActionPrizeStars struct { - // Flags field of MessageActionPrizeStars. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Unclaimed field of MessageActionPrizeStars. Unclaimed bool - // Stars field of MessageActionPrizeStars. + // The number of Telegram Stars you won Stars int64 - // TransactionID field of MessageActionPrizeStars. + // ID of the telegram star transaction. TransactionID string - // BoostPeer field of MessageActionPrizeStars. + // Identifier of the peer that was automatically boosted by the winners of the giveaway. BoostPeer PeerClass - // GiveawayMsgID field of MessageActionPrizeStars. + // ID of the message containing the messageMediaGiveaway¹ + // + // Links: + // 1) https://core.telegram.org/constructor/messageMediaGiveaway GiveawayMsgID int } @@ -9187,24 +9210,44 @@ func (m *MessageActionPrizeStars) GetGiveawayMsgID() (value int) { } // MessageActionStarGift represents TL type `messageActionStarGift#8557637`. +// You received a gift, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/messageActionStarGift for reference. type MessageActionStarGift struct { - // Flags field of MessageActionStarGift. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // NameHidden field of MessageActionStarGift. + // If set, the name of the sender of the gift will be hidden if the destination user + // decides to display the gift on their profile NameHidden bool - // Saved field of MessageActionStarGift. + // Whether this gift was added to the destination user's profile (may be toggled using + // payments.saveStarGift¹ and fetched using payments.getUserStarGifts²) + // + // Links: + // 1) https://core.telegram.org/method/payments.saveStarGift + // 2) https://core.telegram.org/method/payments.getUserStarGifts Saved bool - // Converted field of MessageActionStarGift. + // Whether this gift was converted to Telegram Stars¹ and cannot be displayed on the + // profile anymore. + // + // Links: + // 1) https://core.telegram.org/api/stars Converted bool - // Gift field of MessageActionStarGift. + // Info about the gift Gift StarGift - // Message field of MessageActionStarGift. + // Additional message from the sender of the gift // // Use SetMessage and GetMessage helpers. Message TextWithEntities - // ConvertStars field of MessageActionStarGift. + // The receiver of this gift may convert it to this many Telegram Stars, instead of + // displaying it on their profile page.convert_stars will be equal to stars only if the + // gift was bought using recently bought Telegram Stars, otherwise it will be less than + // stars. // // Use SetConvertStars and GetConvertStars helpers. ConvertStars int64 diff --git a/tg/tl_message_gen.go b/tg/tl_message_gen.go index ef431f7b0..7bcc4cc5f 100644 --- a/tg/tl_message_gen.go +++ b/tg/tl_message_gen.go @@ -296,7 +296,16 @@ type Message struct { // If set, the message was sent because of a scheduled action by the message sender, for // example, as away, or a greeting service message. Offline bool - // VideoProcessingPending field of Message. + // The video contained in the message is currently being processed by the server (i.e. to + // generate alternative qualities, that will be contained in the final + // messageMediaDocument¹.alt_document), and will be sent once the video is processed, + // which will happen approximately at the specified date (i.e. messages with this flag + // set should be treated similarly to scheduled messages², but instead of the scheduled + // date, date contains the estimated conversion date). + // + // Links: + // 1) https://core.telegram.org/constructor/messageMediaDocument + // 2) https://core.telegram.org/api/scheduled-messages VideoProcessingPending bool // ID of the message ID int diff --git a/tg/tl_message_media_gen.go b/tg/tl_message_media_gen.go index 8d39d5088..9ff04670d 100644 --- a/tg/tl_message_media_gen.go +++ b/tg/tl_message_media_gen.go @@ -908,7 +908,7 @@ type MessageMediaDocument struct { // // Use SetDocument and GetDocument helpers. Document DocumentClass - // AltDocuments field of MessageMediaDocument. + // Videos only, contains alternative qualities of the video. // // Use SetAltDocuments and GetAltDocuments helpers. AltDocuments []DocumentClass @@ -3542,7 +3542,10 @@ type MessageMediaGiveaway struct { // // Use SetMonths and GetMonths helpers. Months int - // Stars field of MessageMediaGiveaway. + // For Telegram Star giveaways¹, the total number of Telegram Stars being given away. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-giveaways // // Use SetStars and GetStars helpers. Stars int64 @@ -4054,7 +4057,10 @@ type MessageMediaGiveawayResults struct { // // Use SetMonths and GetMonths helpers. Months int - // Stars field of MessageMediaGiveawayResults. + // For Telegram Star giveaways¹, the total number of Telegram Stars being given away. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-giveaways // // Use SetStars and GetStars helpers. Stars int64 diff --git a/tg/tl_message_reactions_gen.go b/tg/tl_message_reactions_gen.go index b92b745ae..278447068 100644 --- a/tg/tl_message_reactions_gen.go +++ b/tg/tl_message_reactions_gen.go @@ -71,7 +71,10 @@ type MessageReactions struct { // // Use SetRecentReactions and GetRecentReactions helpers. RecentReactions []MessagePeerReaction - // TopReactors field of MessageReactions. + // Paid Telegram Star reactions leaderboard »¹ for this message. + // + // Links: + // 1) https://core.telegram.org/api/reactions#paid-reactions // // Use SetTopReactors and GetTopReactors helpers. TopReactors []MessageReactor diff --git a/tg/tl_message_reactor_gen.go b/tg/tl_message_reactor_gen.go index 67c33a1ef..d60978d81 100644 --- a/tg/tl_message_reactor_gen.go +++ b/tg/tl_message_reactor_gen.go @@ -32,22 +32,32 @@ var ( ) // MessageReactor represents TL type `messageReactor#4ba3a95a`. +// Info about a user in the paid Star reactions leaderboard¹ for a message. +// +// Links: +// 1. https://core.telegram.org/api/reactions#paid-reactions // // See https://core.telegram.org/constructor/messageReactor for reference. type MessageReactor struct { - // Flags field of MessageReactor. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Top field of MessageReactor. + // If set, the reactor is one of the most active reactors; may be unset if the reactor is + // the current user. Top bool - // My field of MessageReactor. + // If set, this reactor is the current user. My bool - // Anonymous field of MessageReactor. + // If set, the reactor is anonymous. Anonymous bool - // PeerID field of MessageReactor. + // Identifier of the peer that reacted: may be unset for anonymous reactors different + // from the current user (i.e. if the current user sent an anonymous reaction anonymous + // will be set but this field will also be set). // // Use SetPeerID and GetPeerID helpers. PeerID PeerClass - // Count field of MessageReactor. + // The number of sent Telegram Stars. Count int } diff --git a/tg/tl_message_report_option_gen.go b/tg/tl_message_report_option_gen.go index f3a6fe48d..f85240511 100644 --- a/tg/tl_message_report_option_gen.go +++ b/tg/tl_message_report_option_gen.go @@ -32,12 +32,17 @@ var ( ) // MessageReportOption represents TL type `messageReportOption#7903e3d9`. +// Report menu option // // See https://core.telegram.org/constructor/messageReportOption for reference. type MessageReportOption struct { - // Text field of MessageReportOption. + // Option title Text string - // Option field of MessageReportOption. + // Option identifier: if the user selects this option, re-invoke messages.report¹, + // passing this option to option + // + // Links: + // 1) https://core.telegram.org/method/messages.report Option []byte } diff --git a/tg/tl_messages_click_sponsored_message_gen.go b/tg/tl_messages_click_sponsored_message_gen.go index bcda2a831..0494a92a7 100644 --- a/tg/tl_messages_click_sponsored_message_gen.go +++ b/tg/tl_messages_click_sponsored_message_gen.go @@ -32,18 +32,26 @@ var ( ) // MessagesClickSponsoredMessageRequest represents TL type `messages.clickSponsoredMessage#f093465`. +// Informs the server that the user has interacted with a sponsored message in one of the +// ways listed here »¹. +// +// Links: +// 1. https://core.telegram.org/api/sponsored-messages#clicking-on-sponsored-messages // // See https://core.telegram.org/method/messages.clickSponsoredMessage for reference. type MessagesClickSponsoredMessageRequest struct { - // Flags field of MessagesClickSponsoredMessageRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Media field of MessagesClickSponsoredMessageRequest. + // The user clicked on the media Media bool - // Fullscreen field of MessagesClickSponsoredMessageRequest. + // The user expanded the video to full screen, and then clicked on it. Fullscreen bool - // Peer field of MessagesClickSponsoredMessageRequest. + // The channel/bot where the ad is located Peer InputPeerClass - // RandomID field of MessagesClickSponsoredMessageRequest. + // The ad's unique ID. RandomID []byte } @@ -281,8 +289,14 @@ func (c *MessagesClickSponsoredMessageRequest) GetRandomID() (value []byte) { } // MessagesClickSponsoredMessage invokes method messages.clickSponsoredMessage#f093465 returning error if any. +// Informs the server that the user has interacted with a sponsored message in one of the +// ways listed here »¹. +// +// Links: +// 1. https://core.telegram.org/api/sponsored-messages#clicking-on-sponsored-messages // // See https://core.telegram.org/method/messages.clickSponsoredMessage for reference. +// Can be used by bots. func (c *Client) MessagesClickSponsoredMessage(ctx context.Context, request *MessagesClickSponsoredMessageRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_export_chat_invite_gen.go b/tg/tl_messages_export_chat_invite_gen.go index 7a8fb6e54..b0087acb3 100644 --- a/tg/tl_messages_export_chat_invite_gen.go +++ b/tg/tl_messages_export_chat_invite_gen.go @@ -62,7 +62,11 @@ type MessagesExportChatInviteRequest struct { // // Use SetTitle and GetTitle helpers. Title string - // SubscriptionPricing field of MessagesExportChatInviteRequest. + // For Telegram Star subscriptions »¹, contains the pricing of the subscription the + // user must activate to join the private channel. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions // // Use SetSubscriptionPricing and GetSubscriptionPricing helpers. SubscriptionPricing StarsSubscriptionPricing diff --git a/tg/tl_messages_forward_messages_gen.go b/tg/tl_messages_forward_messages_gen.go index 7ae0bf0a7..90bfe6363 100644 --- a/tg/tl_messages_forward_messages_gen.go +++ b/tg/tl_messages_forward_messages_gen.go @@ -58,7 +58,12 @@ type MessagesForwardMessagesRequest struct { // Links: // 1) https://telegram.org/blog/protected-content-delete-by-date-and-more Noforwards bool - // AllowPaidFloodskip field of MessagesForwardMessagesRequest. + // Bots only: if set, allows sending up to 1000 messages per second, ignoring + // broadcasting limits¹ for a fee of 0.1 Telegram Stars per message. The relevant Stars + // will be withdrawn from the bot's balance. + // + // Links: + // 1) https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once AllowPaidFloodskip bool // Source of messages FromPeer InputPeerClass diff --git a/tg/tl_messages_get_chat_invite_importers_gen.go b/tg/tl_messages_get_chat_invite_importers_gen.go index 38cbe6f90..7ca5da3ae 100644 --- a/tg/tl_messages_get_chat_invite_importers_gen.go +++ b/tg/tl_messages_get_chat_invite_importers_gen.go @@ -46,7 +46,11 @@ type MessagesGetChatInviteImportersRequest struct { // Links: // 1) https://core.telegram.org/api/invites#join-requests Requested bool - // SubscriptionExpired field of MessagesGetChatInviteImportersRequest. + // Set this flag if the link is a Telegram Star subscription link »¹ and only members + // with already expired subscription must be returned. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions SubscriptionExpired bool // Chat Peer InputPeerClass diff --git a/tg/tl_messages_get_paid_reaction_privacy_gen.go b/tg/tl_messages_get_paid_reaction_privacy_gen.go index 9cec4b8ad..359ed0b01 100644 --- a/tg/tl_messages_get_paid_reaction_privacy_gen.go +++ b/tg/tl_messages_get_paid_reaction_privacy_gen.go @@ -32,6 +32,12 @@ var ( ) // MessagesGetPaidReactionPrivacyRequest represents TL type `messages.getPaidReactionPrivacy#472455aa`. +// Fetches an updatePaidReactionPrivacy¹ update with the current default paid reaction +// privacy, see here »² for more info. +// +// Links: +// 1. https://core.telegram.org/constructor/updatePaidReactionPrivacy +// 2. https://core.telegram.org/api/reactions#paid-reactions // // See https://core.telegram.org/method/messages.getPaidReactionPrivacy for reference. type MessagesGetPaidReactionPrivacyRequest struct { @@ -128,8 +134,15 @@ func (g *MessagesGetPaidReactionPrivacyRequest) DecodeBare(b *bin.Buffer) error } // MessagesGetPaidReactionPrivacy invokes method messages.getPaidReactionPrivacy#472455aa returning error if any. +// Fetches an updatePaidReactionPrivacy¹ update with the current default paid reaction +// privacy, see here »² for more info. +// +// Links: +// 1. https://core.telegram.org/constructor/updatePaidReactionPrivacy +// 2. https://core.telegram.org/api/reactions#paid-reactions // // See https://core.telegram.org/method/messages.getPaidReactionPrivacy for reference. +// Can be used by bots. func (c *Client) MessagesGetPaidReactionPrivacy(ctx context.Context) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_get_sponsored_messages_gen.go b/tg/tl_messages_get_sponsored_messages_gen.go index 07def0d47..d77438841 100644 --- a/tg/tl_messages_get_sponsored_messages_gen.go +++ b/tg/tl_messages_get_sponsored_messages_gen.go @@ -32,10 +32,14 @@ var ( ) // MessagesGetSponsoredMessagesRequest represents TL type `messages.getSponsoredMessages#9bd2f439`. +// Get a list of sponsored messages for a peer, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/sponsored-messages // // See https://core.telegram.org/method/messages.getSponsoredMessages for reference. type MessagesGetSponsoredMessagesRequest struct { - // Peer field of MessagesGetSponsoredMessagesRequest. + // The currently open channel/bot. Peer InputPeerClass } @@ -166,8 +170,13 @@ func (g *MessagesGetSponsoredMessagesRequest) GetPeer() (value InputPeerClass) { } // MessagesGetSponsoredMessages invokes method messages.getSponsoredMessages#9bd2f439 returning error if any. +// Get a list of sponsored messages for a peer, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/sponsored-messages // // See https://core.telegram.org/method/messages.getSponsoredMessages for reference. +// Can be used by bots. func (c *Client) MessagesGetSponsoredMessages(ctx context.Context, peer InputPeerClass) (MessagesSponsoredMessagesClass, error) { var result MessagesSponsoredMessagesBox diff --git a/tg/tl_messages_report_gen.go b/tg/tl_messages_report_gen.go index a04e2dca0..08fd0363e 100644 --- a/tg/tl_messages_report_gen.go +++ b/tg/tl_messages_report_gen.go @@ -40,7 +40,7 @@ type MessagesReportRequest struct { Peer InputPeerClass // IDs of messages to report ID []int - // Option field of MessagesReportRequest. + // Menu option, intially empty Option []byte // Comment for report moderation Message string diff --git a/tg/tl_messages_report_sponsored_message_gen.go b/tg/tl_messages_report_sponsored_message_gen.go index 19c66ba35..c44439f49 100644 --- a/tg/tl_messages_report_sponsored_message_gen.go +++ b/tg/tl_messages_report_sponsored_message_gen.go @@ -32,14 +32,23 @@ var ( ) // MessagesReportSponsoredMessageRequest represents TL type `messages.reportSponsoredMessage#1af3dbb8`. +// Report a sponsored message »¹, see here »² for more info on the full flow. +// +// Links: +// 1. https://core.telegram.org/api/sponsored-messages +// 2. https://core.telegram.org/api/sponsored-messages#reporting-sponsored-messages // // See https://core.telegram.org/method/messages.reportSponsoredMessage for reference. type MessagesReportSponsoredMessageRequest struct { - // Peer field of MessagesReportSponsoredMessageRequest. + // The channel/bot where the ad is located Peer InputPeerClass - // RandomID field of MessagesReportSponsoredMessageRequest. + // The ad's unique ID. RandomID []byte - // Option field of MessagesReportSponsoredMessageRequest. + // Chosen report option, initially an empty string, see here »¹ for more info on the + // full flow. + // + // Links: + // 1) https://core.telegram.org/api/sponsored-messages#reporting-sponsored-messages Option []byte } @@ -220,8 +229,14 @@ func (r *MessagesReportSponsoredMessageRequest) GetOption() (value []byte) { } // MessagesReportSponsoredMessage invokes method messages.reportSponsoredMessage#1af3dbb8 returning error if any. +// Report a sponsored message »¹, see here »² for more info on the full flow. +// +// Links: +// 1. https://core.telegram.org/api/sponsored-messages +// 2. https://core.telegram.org/api/sponsored-messages#reporting-sponsored-messages // // See https://core.telegram.org/method/messages.reportSponsoredMessage for reference. +// Can be used by bots. func (c *Client) MessagesReportSponsoredMessage(ctx context.Context, request *MessagesReportSponsoredMessageRequest) (ChannelsSponsoredMessageReportResultClass, error) { var result ChannelsSponsoredMessageReportResultBox diff --git a/tg/tl_messages_send_media_gen.go b/tg/tl_messages_send_media_gen.go index f878424c5..c6f8f576f 100644 --- a/tg/tl_messages_send_media_gen.go +++ b/tg/tl_messages_send_media_gen.go @@ -61,7 +61,12 @@ type MessagesSendMediaRequest struct { // If set, any eventual webpage preview will be shown on top of the message instead of at // the bottom. InvertMedia bool - // AllowPaidFloodskip field of MessagesSendMediaRequest. + // Bots only: if set, allows sending up to 1000 messages per second, ignoring + // broadcasting limits¹ for a fee of 0.1 Telegram Stars per message. The relevant Stars + // will be withdrawn from the bot's balance. + // + // Links: + // 1) https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once AllowPaidFloodskip bool // Destination Peer InputPeerClass diff --git a/tg/tl_messages_send_message_gen.go b/tg/tl_messages_send_message_gen.go index a26bbbf99..688c7d83c 100644 --- a/tg/tl_messages_send_message_gen.go +++ b/tg/tl_messages_send_message_gen.go @@ -63,7 +63,12 @@ type MessagesSendMessageRequest struct { // If set, any eventual webpage preview will be shown on top of the message instead of at // the bottom. InvertMedia bool - // AllowPaidFloodskip field of MessagesSendMessageRequest. + // Bots only: if set, allows sending up to 1000 messages per second, ignoring + // broadcasting limits¹ for a fee of 0.1 Telegram Stars per message. The relevant Stars + // will be withdrawn from the bot's balance. + // + // Links: + // 1) https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once AllowPaidFloodskip bool // The destination where the message will be sent Peer InputPeerClass diff --git a/tg/tl_messages_send_multi_media_gen.go b/tg/tl_messages_send_multi_media_gen.go index 52e29002d..a2eb8744a 100644 --- a/tg/tl_messages_send_multi_media_gen.go +++ b/tg/tl_messages_send_multi_media_gen.go @@ -67,7 +67,12 @@ type MessagesSendMultiMediaRequest struct { // If set, any eventual webpage preview will be shown on top of the message instead of at // the bottom. InvertMedia bool - // AllowPaidFloodskip field of MessagesSendMultiMediaRequest. + // Bots only: if set, allows sending up to 1000 messages per second, ignoring + // broadcasting limits¹ for a fee of 0.1 Telegram Stars per message. The relevant Stars + // will be withdrawn from the bot's balance. + // + // Links: + // 1) https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once AllowPaidFloodskip bool // The destination chat Peer InputPeerClass diff --git a/tg/tl_messages_send_paid_reaction_gen.go b/tg/tl_messages_send_paid_reaction_gen.go index 845995809..2ec997f5a 100644 --- a/tg/tl_messages_send_paid_reaction_gen.go +++ b/tg/tl_messages_send_paid_reaction_gen.go @@ -32,20 +32,46 @@ var ( ) // MessagesSendPaidReactionRequest represents TL type `messages.sendPaidReaction#9dd6a67b`. +// Sends one or more paid Telegram Star reactions »¹, transferring Telegram Stars »² +// to a channel's balance. +// +// Links: +// 1. https://core.telegram.org/api/reactions#paid-reactions +// 2. https://core.telegram.org/api/stars // // See https://core.telegram.org/method/messages.sendPaidReaction for reference. type MessagesSendPaidReactionRequest struct { - // Flags field of MessagesSendPaidReactionRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Peer field of MessagesSendPaidReactionRequest. + // The channel Peer InputPeerClass - // MsgID field of MessagesSendPaidReactionRequest. + // The message to react to MsgID int - // Count field of MessagesSendPaidReactionRequest. + // The number of stars¹ to send (each will increment the reaction counter by one). + // + // Links: + // 1) https://core.telegram.org/api/stars Count int - // RandomID field of MessagesSendPaidReactionRequest. + // Unique client message ID required to prevent message resending RandomID int64 - // Private field of MessagesSendPaidReactionRequest. + // Each post with star reactions has a leaderboard with the top senders, but users can + // opt out of appearing there if they prefer more privacy. If the user explicitly chose + // to make their paid reaction(s) private, pass boolTrue¹ to messages.sendPaidReaction² + // private. If the user explicitly chose to make their paid reaction(s) private, pass + // boolFalse³ to messages.sendPaidReaction⁴.private. If the user did not make any + // explicit choice about the privacy of their paid reaction(s) (i.e. when reacting by + // clicking on an existing star reaction on a message), do not populate the messages + // sendPaidReaction⁵.private flag. + // + // Links: + // 1) https://core.telegram.org/constructor/boolTrue + // 2) https://core.telegram.org/method/messages.sendPaidReaction + // 3) https://core.telegram.org/constructor/boolTrue + // 4) https://core.telegram.org/method/messages.sendPaidReaction + // 5) https://core.telegram.org/method/messages.sendPaidReaction // // Use SetPrivate and GetPrivate helpers. Private bool @@ -313,8 +339,15 @@ func (s *MessagesSendPaidReactionRequest) GetPrivate() (value bool, ok bool) { } // MessagesSendPaidReaction invokes method messages.sendPaidReaction#9dd6a67b returning error if any. +// Sends one or more paid Telegram Star reactions »¹, transferring Telegram Stars »² +// to a channel's balance. +// +// Links: +// 1. https://core.telegram.org/api/reactions#paid-reactions +// 2. https://core.telegram.org/api/stars // // See https://core.telegram.org/method/messages.sendPaidReaction for reference. +// Can be used by bots. func (c *Client) MessagesSendPaidReaction(ctx context.Context, request *MessagesSendPaidReactionRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_set_chat_available_reactions_gen.go b/tg/tl_messages_set_chat_available_reactions_gen.go index 0dddcb78a..05c21d173 100644 --- a/tg/tl_messages_set_chat_available_reactions_gen.go +++ b/tg/tl_messages_set_chat_available_reactions_gen.go @@ -51,7 +51,8 @@ type MessagesSetChatAvailableReactionsRequest struct { AvailableReactions ChatReactionsClass // This flag may be used to impose a custom limit of unique reactions (i.e. a // customizable version of appConfig.reactions_uniq_max¹); this field and the other info - // set by the method will then be available to users in channelFull² and chatFull³. + // set by the method will then be available to users in channelFull² and chatFull³. If + // this flag is not set, the previously configured reactions_limit will not be altered. // // Links: // 1) https://core.telegram.org/api/config#reactions-uniq-max @@ -60,7 +61,13 @@ type MessagesSetChatAvailableReactionsRequest struct { // // Use SetReactionsLimit and GetReactionsLimit helpers. ReactionsLimit int - // PaidEnabled field of MessagesSetChatAvailableReactionsRequest. + // If this flag is set and a Bool¹ is passed, the method will enable or disable paid + // message reactions »². If this flag is not set, the previously stored setting will + // not be changed. + // + // Links: + // 1) https://core.telegram.org/type/Bool + // 2) https://core.telegram.org/api/reactions#paid-reactions // // Use SetPaidEnabled and GetPaidEnabled helpers. PaidEnabled bool diff --git a/tg/tl_messages_toggle_paid_reaction_privacy_gen.go b/tg/tl_messages_toggle_paid_reaction_privacy_gen.go index b891c0e4b..610908550 100644 --- a/tg/tl_messages_toggle_paid_reaction_privacy_gen.go +++ b/tg/tl_messages_toggle_paid_reaction_privacy_gen.go @@ -32,14 +32,19 @@ var ( ) // MessagesTogglePaidReactionPrivacyRequest represents TL type `messages.togglePaidReactionPrivacy#849ad397`. +// Changes the privacy of already sent paid reactions¹ on a specific message. +// +// Links: +// 1. https://core.telegram.org/api/reactions#paid-reactions // // See https://core.telegram.org/method/messages.togglePaidReactionPrivacy for reference. type MessagesTogglePaidReactionPrivacyRequest struct { - // Peer field of MessagesTogglePaidReactionPrivacyRequest. + // The channel Peer InputPeerClass - // MsgID field of MessagesTogglePaidReactionPrivacyRequest. + // The ID of the message to which we sent the paid reactions MsgID int - // Private field of MessagesTogglePaidReactionPrivacyRequest. + // If true, makes the current anonymous in the top sender leaderboard for this message; + // otherwise, does the opposite. Private bool } @@ -220,8 +225,13 @@ func (t *MessagesTogglePaidReactionPrivacyRequest) GetPrivate() (value bool) { } // MessagesTogglePaidReactionPrivacy invokes method messages.togglePaidReactionPrivacy#849ad397 returning error if any. +// Changes the privacy of already sent paid reactions¹ on a specific message. +// +// Links: +// 1. https://core.telegram.org/api/reactions#paid-reactions // // See https://core.telegram.org/method/messages.togglePaidReactionPrivacy for reference. +// Can be used by bots. func (c *Client) MessagesTogglePaidReactionPrivacy(ctx context.Context, request *MessagesTogglePaidReactionPrivacyRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_view_sponsored_message_gen.go b/tg/tl_messages_view_sponsored_message_gen.go index e906da44d..53b08d40b 100644 --- a/tg/tl_messages_view_sponsored_message_gen.go +++ b/tg/tl_messages_view_sponsored_message_gen.go @@ -32,12 +32,16 @@ var ( ) // MessagesViewSponsoredMessageRequest represents TL type `messages.viewSponsoredMessage#673ad8f1`. +// Mark a specific sponsored message »¹ as read +// +// Links: +// 1. https://core.telegram.org/api/sponsored-messages // // See https://core.telegram.org/method/messages.viewSponsoredMessage for reference. type MessagesViewSponsoredMessageRequest struct { - // Peer field of MessagesViewSponsoredMessageRequest. + // The channel/bot where the ad is located Peer InputPeerClass - // RandomID field of MessagesViewSponsoredMessageRequest. + // The ad's unique ID. RandomID []byte } @@ -193,8 +197,13 @@ func (v *MessagesViewSponsoredMessageRequest) GetRandomID() (value []byte) { } // MessagesViewSponsoredMessage invokes method messages.viewSponsoredMessage#673ad8f1 returning error if any. +// Mark a specific sponsored message »¹ as read +// +// Links: +// 1. https://core.telegram.org/api/sponsored-messages // // See https://core.telegram.org/method/messages.viewSponsoredMessage for reference. +// Can be used by bots. func (c *Client) MessagesViewSponsoredMessage(ctx context.Context, request *MessagesViewSponsoredMessageRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_change_stars_subscription_gen.go b/tg/tl_payments_change_stars_subscription_gen.go index 3a4f20ab2..4614a044c 100644 --- a/tg/tl_payments_change_stars_subscription_gen.go +++ b/tg/tl_payments_change_stars_subscription_gen.go @@ -32,16 +32,26 @@ var ( ) // PaymentsChangeStarsSubscriptionRequest represents TL type `payments.changeStarsSubscription#c7770878`. +// Activate or deactivate a Telegram Star subscription »¹. +// +// Links: +// 1. https://core.telegram.org/api/invites#paid-invite-links // // See https://core.telegram.org/method/payments.changeStarsSubscription for reference. type PaymentsChangeStarsSubscriptionRequest struct { - // Flags field of PaymentsChangeStarsSubscriptionRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Peer field of PaymentsChangeStarsSubscriptionRequest. + // Always pass inputPeerSelf¹. + // + // Links: + // 1) https://core.telegram.org/constructor/inputPeerSelf Peer InputPeerClass - // SubscriptionID field of PaymentsChangeStarsSubscriptionRequest. + // ID of the subscription. SubscriptionID string - // Canceled field of PaymentsChangeStarsSubscriptionRequest. + // Whether to cancel or reactivate the subscription. // // Use SetCanceled and GetCanceled helpers. Canceled bool @@ -259,8 +269,13 @@ func (c *PaymentsChangeStarsSubscriptionRequest) GetCanceled() (value bool, ok b } // PaymentsChangeStarsSubscription invokes method payments.changeStarsSubscription#c7770878 returning error if any. +// Activate or deactivate a Telegram Star subscription »¹. +// +// Links: +// 1. https://core.telegram.org/api/invites#paid-invite-links // // See https://core.telegram.org/method/payments.changeStarsSubscription for reference. +// Can be used by bots. func (c *Client) PaymentsChangeStarsSubscription(ctx context.Context, request *PaymentsChangeStarsSubscriptionRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_convert_star_gift_gen.go b/tg/tl_payments_convert_star_gift_gen.go index 84c74a154..ac66c8062 100644 --- a/tg/tl_payments_convert_star_gift_gen.go +++ b/tg/tl_payments_convert_star_gift_gen.go @@ -32,12 +32,29 @@ var ( ) // PaymentsConvertStarGiftRequest represents TL type `payments.convertStarGift#421e027`. +// Convert a received gift »¹ into Telegram Stars: this will permanently destroy the +// gift, converting it into starGift².convert_stars Telegram Stars³, added to the +// user's balance. +// Note that starGift¹.convert_stars will be less than the buying price (starGift² +// stars) of the gift if it was originally bought using Telegram Stars bought a long time +// ago. +// +// Links: +// 1. https://core.telegram.org/api/gifts +// 2. https://core.telegram.org/constructor/starGift +// 3. https://core.telegram.org/api/stars +// 4. https://core.telegram.org/constructor/starGift +// 5. https://core.telegram.org/constructor/starGift // // See https://core.telegram.org/method/payments.convertStarGift for reference. type PaymentsConvertStarGiftRequest struct { - // UserID field of PaymentsConvertStarGiftRequest. + // ID of the user that sent us the gift. UserID InputUserClass - // MsgID field of PaymentsConvertStarGiftRequest. + // The ID of the messageService¹ with the messageActionStarGift². + // + // Links: + // 1) https://core.telegram.org/constructor/messageService + // 2) https://core.telegram.org/constructor/messageActionStarGift MsgID int } @@ -193,8 +210,22 @@ func (c *PaymentsConvertStarGiftRequest) GetMsgID() (value int) { } // PaymentsConvertStarGift invokes method payments.convertStarGift#421e027 returning error if any. +// Convert a received gift »¹ into Telegram Stars: this will permanently destroy the +// gift, converting it into starGift².convert_stars Telegram Stars³, added to the +// user's balance. +// Note that starGift¹.convert_stars will be less than the buying price (starGift² +// stars) of the gift if it was originally bought using Telegram Stars bought a long time +// ago. +// +// Links: +// 1. https://core.telegram.org/api/gifts +// 2. https://core.telegram.org/constructor/starGift +// 3. https://core.telegram.org/api/stars +// 4. https://core.telegram.org/constructor/starGift +// 5. https://core.telegram.org/constructor/starGift // // See https://core.telegram.org/method/payments.convertStarGift for reference. +// Can be used by bots. func (c *Client) PaymentsConvertStarGift(ctx context.Context, request *PaymentsConvertStarGiftRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_fulfill_stars_subscription_gen.go b/tg/tl_payments_fulfill_stars_subscription_gen.go index f3ee67176..df3012482 100644 --- a/tg/tl_payments_fulfill_stars_subscription_gen.go +++ b/tg/tl_payments_fulfill_stars_subscription_gen.go @@ -32,12 +32,19 @@ var ( ) // PaymentsFulfillStarsSubscriptionRequest represents TL type `payments.fulfillStarsSubscription#cc5bebb3`. +// Re-join a private channel associated to an active Telegram Star subscription »¹. +// +// Links: +// 1. https://core.telegram.org/api/invites#paid-invite-links // // See https://core.telegram.org/method/payments.fulfillStarsSubscription for reference. type PaymentsFulfillStarsSubscriptionRequest struct { - // Peer field of PaymentsFulfillStarsSubscriptionRequest. + // Always pass inputPeerSelf¹. + // + // Links: + // 1) https://core.telegram.org/constructor/inputPeerSelf Peer InputPeerClass - // SubscriptionID field of PaymentsFulfillStarsSubscriptionRequest. + // ID of the subscription. SubscriptionID string } @@ -193,8 +200,13 @@ func (f *PaymentsFulfillStarsSubscriptionRequest) GetSubscriptionID() (value str } // PaymentsFulfillStarsSubscription invokes method payments.fulfillStarsSubscription#cc5bebb3 returning error if any. +// Re-join a private channel associated to an active Telegram Star subscription »¹. +// +// Links: +// 1. https://core.telegram.org/api/invites#paid-invite-links // // See https://core.telegram.org/method/payments.fulfillStarsSubscription for reference. +// Can be used by bots. func (c *Client) PaymentsFulfillStarsSubscription(ctx context.Context, request *PaymentsFulfillStarsSubscriptionRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_get_star_gifts_gen.go b/tg/tl_payments_get_star_gifts_gen.go index 6fd1cce46..d8cd81e73 100644 --- a/tg/tl_payments_get_star_gifts_gen.go +++ b/tg/tl_payments_get_star_gifts_gen.go @@ -32,10 +32,17 @@ var ( ) // PaymentsGetStarGiftsRequest represents TL type `payments.getStarGifts#c4563590`. +// Get a list of available gifts, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/method/payments.getStarGifts for reference. type PaymentsGetStarGiftsRequest struct { - // Hash field of PaymentsGetStarGiftsRequest. + // Hash used for caching, for more info click here¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int } @@ -161,8 +168,13 @@ func (g *PaymentsGetStarGiftsRequest) GetHash() (value int) { } // PaymentsGetStarGifts invokes method payments.getStarGifts#c4563590 returning error if any. +// Get a list of available gifts, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/method/payments.getStarGifts for reference. +// Can be used by bots. func (c *Client) PaymentsGetStarGifts(ctx context.Context, hash int) (PaymentsStarGiftsClass, error) { var result PaymentsStarGiftsBox diff --git a/tg/tl_payments_get_stars_giveaway_options_gen.go b/tg/tl_payments_get_stars_giveaway_options_gen.go index 5ca5c85f7..e7e037303 100644 --- a/tg/tl_payments_get_stars_giveaway_options_gen.go +++ b/tg/tl_payments_get_stars_giveaway_options_gen.go @@ -32,6 +32,10 @@ var ( ) // PaymentsGetStarsGiveawayOptionsRequest represents TL type `payments.getStarsGiveawayOptions#bd1efd3e`. +// Fetch a list of star giveaway options »¹. +// +// Links: +// 1. https://core.telegram.org/api/giveaways#star-giveaways // // See https://core.telegram.org/method/payments.getStarsGiveawayOptions for reference. type PaymentsGetStarsGiveawayOptionsRequest struct { @@ -128,8 +132,13 @@ func (g *PaymentsGetStarsGiveawayOptionsRequest) DecodeBare(b *bin.Buffer) error } // PaymentsGetStarsGiveawayOptions invokes method payments.getStarsGiveawayOptions#bd1efd3e returning error if any. +// Fetch a list of star giveaway options »¹. +// +// Links: +// 1. https://core.telegram.org/api/giveaways#star-giveaways // // See https://core.telegram.org/method/payments.getStarsGiveawayOptions for reference. +// Can be used by bots. func (c *Client) PaymentsGetStarsGiveawayOptions(ctx context.Context) ([]StarsGiveawayOption, error) { var result StarsGiveawayOptionVector diff --git a/tg/tl_payments_get_stars_subscriptions_gen.go b/tg/tl_payments_get_stars_subscriptions_gen.go index 9462c9322..a2a901180 100644 --- a/tg/tl_payments_get_stars_subscriptions_gen.go +++ b/tg/tl_payments_get_stars_subscriptions_gen.go @@ -32,16 +32,30 @@ var ( ) // PaymentsGetStarsSubscriptionsRequest represents TL type `payments.getStarsSubscriptions#32512c5`. +// Obtain a list of active, expired or cancelled Telegram Star subscriptions »¹. +// +// Links: +// 1. https://core.telegram.org/api/invites#paid-invite-links // // See https://core.telegram.org/method/payments.getStarsSubscriptions for reference. type PaymentsGetStarsSubscriptionsRequest struct { - // Flags field of PaymentsGetStarsSubscriptionsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // MissingBalance field of PaymentsGetStarsSubscriptionsRequest. + // Whether to return only expired subscriptions due to an excessively low Telegram Star + // balance. MissingBalance bool - // Peer field of PaymentsGetStarsSubscriptionsRequest. + // Always pass inputPeerSelf¹. + // + // Links: + // 1) https://core.telegram.org/constructor/inputPeerSelf Peer InputPeerClass - // Offset field of PaymentsGetStarsSubscriptionsRequest. + // Offset for pagination, taken from payments.starsStatus¹. + // + // Links: + // 1) https://core.telegram.org/constructor/payments.starsStatus#subscriptions_next_offset Offset string } @@ -246,8 +260,13 @@ func (g *PaymentsGetStarsSubscriptionsRequest) GetOffset() (value string) { } // PaymentsGetStarsSubscriptions invokes method payments.getStarsSubscriptions#32512c5 returning error if any. +// Obtain a list of active, expired or cancelled Telegram Star subscriptions »¹. +// +// Links: +// 1. https://core.telegram.org/api/invites#paid-invite-links // // See https://core.telegram.org/method/payments.getStarsSubscriptions for reference. +// Can be used by bots. func (c *Client) PaymentsGetStarsSubscriptions(ctx context.Context, request *PaymentsGetStarsSubscriptionsRequest) (*PaymentsStarsStatus, error) { var result PaymentsStarsStatus diff --git a/tg/tl_payments_get_stars_transactions_gen.go b/tg/tl_payments_get_stars_transactions_gen.go index d9d96d52f..320f5c659 100644 --- a/tg/tl_payments_get_stars_transactions_gen.go +++ b/tg/tl_payments_get_stars_transactions_gen.go @@ -52,7 +52,10 @@ type PaymentsGetStarsTransactionsRequest struct { Outbound bool // Return transactions in ascending order by date (instead of descending order by date). Ascending bool - // SubscriptionID field of PaymentsGetStarsTransactionsRequest. + // If set, fetches only transactions for the specified Telegram Star subscription »¹. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions // // Use SetSubscriptionID and GetSubscriptionID helpers. SubscriptionID string diff --git a/tg/tl_payments_get_user_star_gifts_gen.go b/tg/tl_payments_get_user_star_gifts_gen.go index 69d5e6c0a..5863acb16 100644 --- a/tg/tl_payments_get_user_star_gifts_gen.go +++ b/tg/tl_payments_get_user_star_gifts_gen.go @@ -32,14 +32,27 @@ var ( ) // PaymentsGetUserStarGiftsRequest represents TL type `payments.getUserStarGifts#5e72c7e1`. +// Get the gifts »¹ pinned on a specific user's profile. +// May also be used to fetch all gifts received by the current user. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/method/payments.getUserStarGifts for reference. type PaymentsGetUserStarGiftsRequest struct { - // UserID field of PaymentsGetUserStarGiftsRequest. + // Identifier of the user (can be the current user to fetch all gifts received by the + // current user). UserID InputUserClass - // Offset field of PaymentsGetUserStarGiftsRequest. + // Offset for pagination¹, taken from payments.userStarGifts² (initially empty). + // + // Links: + // 1) https://core.telegram.org/api/offsets + // 2) https://core.telegram.org/constructor/payments.userStarGifts Offset string - // Limit field of PaymentsGetUserStarGiftsRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -220,8 +233,14 @@ func (g *PaymentsGetUserStarGiftsRequest) GetLimit() (value int) { } // PaymentsGetUserStarGifts invokes method payments.getUserStarGifts#5e72c7e1 returning error if any. +// Get the gifts »¹ pinned on a specific user's profile. +// May also be used to fetch all gifts received by the current user. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/method/payments.getUserStarGifts for reference. +// Can be used by bots. func (c *Client) PaymentsGetUserStarGifts(ctx context.Context, request *PaymentsGetUserStarGiftsRequest) (*PaymentsUserStarGifts, error) { var result PaymentsUserStarGifts diff --git a/tg/tl_payments_giveaway_info_gen.go b/tg/tl_payments_giveaway_info_gen.go index 3b226c762..8cfd8ab86 100644 --- a/tg/tl_payments_giveaway_info_gen.go +++ b/tg/tl_payments_giveaway_info_gen.go @@ -443,7 +443,12 @@ type PaymentsGiveawayInfoResults struct { // // Use SetGiftCodeSlug and GetGiftCodeSlug helpers. GiftCodeSlug string - // StarsPrize field of PaymentsGiveawayInfoResults. + // If we're one of the winners of this Telegram Star giveaway¹, the number Telegram + // Stars² we won. + // + // Links: + // 1) https://core.telegram.org/api/giveaways#star-giveaways + // 2) https://core.telegram.org/api/stars // // Use SetStarsPrize and GetStarsPrize helpers. StarsPrize int64 diff --git a/tg/tl_payments_payment_form_gen.go b/tg/tl_payments_payment_form_gen.go index 3595d201c..29fc8360b 100644 --- a/tg/tl_payments_payment_form_gen.go +++ b/tg/tl_payments_payment_form_gen.go @@ -1174,12 +1174,16 @@ func (p *PaymentsPaymentFormStars) MapUsers() (value UserClassArray) { } // PaymentsPaymentFormStarGift represents TL type `payments.paymentFormStarGift#b425cfe1`. +// Represents a payment form for a gift, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/payments.paymentFormStarGift for reference. type PaymentsPaymentFormStarGift struct { - // FormID field of PaymentsPaymentFormStarGift. + // Form ID. FormID int64 - // Invoice field of PaymentsPaymentFormStarGift. + // Invoice Invoice Invoice } diff --git a/tg/tl_payments_save_star_gift_gen.go b/tg/tl_payments_save_star_gift_gen.go index 3f3aad428..fdbe4c537 100644 --- a/tg/tl_payments_save_star_gift_gen.go +++ b/tg/tl_payments_save_star_gift_gen.go @@ -32,16 +32,27 @@ var ( ) // PaymentsSaveStarGiftRequest represents TL type `payments.saveStarGift#87acf08e`. +// Display or remove a received gift »¹ from our profile. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/method/payments.saveStarGift for reference. type PaymentsSaveStarGiftRequest struct { - // Flags field of PaymentsSaveStarGiftRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Unsave field of PaymentsSaveStarGiftRequest. + // If set, hides the gift from our profile. Unsave bool - // UserID field of PaymentsSaveStarGiftRequest. + // ID of the user that sent us the gift. UserID InputUserClass - // MsgID field of PaymentsSaveStarGiftRequest. + // The ID of the messageService¹ with the messageActionStarGift². + // + // Links: + // 1) https://core.telegram.org/constructor/messageService + // 2) https://core.telegram.org/constructor/messageActionStarGift MsgID int } @@ -246,8 +257,13 @@ func (s *PaymentsSaveStarGiftRequest) GetMsgID() (value int) { } // PaymentsSaveStarGift invokes method payments.saveStarGift#87acf08e returning error if any. +// Display or remove a received gift »¹ from our profile. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/method/payments.saveStarGift for reference. +// Can be used by bots. func (c *Client) PaymentsSaveStarGift(ctx context.Context, request *PaymentsSaveStarGiftRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_star_gifts_gen.go b/tg/tl_payments_star_gifts_gen.go index 6ab94689b..769b667df 100644 --- a/tg/tl_payments_star_gifts_gen.go +++ b/tg/tl_payments_star_gifts_gen.go @@ -32,6 +32,10 @@ var ( ) // PaymentsStarGiftsNotModified represents TL type `payments.starGiftsNotModified#a388a368`. +// The list of available gifts »¹ hasn't changed. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/payments.starGiftsNotModified for reference. type PaymentsStarGiftsNotModified struct { @@ -133,12 +137,19 @@ func (s *PaymentsStarGiftsNotModified) DecodeBare(b *bin.Buffer) error { } // PaymentsStarGifts represents TL type `payments.starGifts#901689ea`. +// Available gifts »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/payments.starGifts for reference. type PaymentsStarGifts struct { - // Hash field of PaymentsStarGifts. + // Hash used for caching, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int - // Gifts field of PaymentsStarGifts. + // List of available gifts. Gifts []StarGift } diff --git a/tg/tl_payments_stars_status_gen.go b/tg/tl_payments_stars_status_gen.go index 4844c4bb6..8a112146a 100644 --- a/tg/tl_payments_stars_status_gen.go +++ b/tg/tl_payments_stars_status_gen.go @@ -32,7 +32,8 @@ var ( ) // PaymentsStarsStatus represents TL type `payments.starsStatus#bbfa316c`. -// Info about the current Telegram Star balance and transaction history »¹. +// Info about the current Telegram Star subscriptions, balance and transaction history +// »¹. // // Links: // 1. https://core.telegram.org/api/stars#balance-and-transaction-history @@ -46,15 +47,29 @@ type PaymentsStarsStatus struct { Flags bin.Fields // Current Telegram Star balance. Balance int64 - // Subscriptions field of PaymentsStarsStatus. + // Info about current Telegram Star subscriptions, only returned when invoking payments + // getStarsTransactions¹ and payments.getStarsSubscriptions². + // + // Links: + // 1) https://core.telegram.org/method/payments.getStarsTransactions + // 2) https://core.telegram.org/method/payments.getStarsSubscriptions // // Use SetSubscriptions and GetSubscriptions helpers. Subscriptions []StarsSubscription - // SubscriptionsNextOffset field of PaymentsStarsStatus. + // Offset for pagination of subscriptions: only usable with payments + // getStarsSubscriptions¹, returned when invoking payments.getStarsTransactions² and + // payments.getStarsSubscriptions³. + // + // Links: + // 1) https://core.telegram.org/method/payments.getStarsSubscriptions + // 2) https://core.telegram.org/method/payments.getStarsTransactions + // 3) https://core.telegram.org/method/payments.getStarsSubscriptions // // Use SetSubscriptionsNextOffset and GetSubscriptionsNextOffset helpers. SubscriptionsNextOffset string - // SubscriptionsMissingBalance field of PaymentsStarsStatus. + // The number of Telegram Stars the user should buy to be able to extend expired + // subscriptions soon (i.e. the current balance is not enough to extend all expired + // subscriptions). // // Use SetSubscriptionsMissingBalance and GetSubscriptionsMissingBalance helpers. SubscriptionsMissingBalance int64 diff --git a/tg/tl_payments_user_star_gifts_gen.go b/tg/tl_payments_user_star_gifts_gen.go index ef6c9496c..b9a73697b 100644 --- a/tg/tl_payments_user_star_gifts_gen.go +++ b/tg/tl_payments_user_star_gifts_gen.go @@ -32,20 +32,30 @@ var ( ) // PaymentsUserStarGifts represents TL type `payments.userStarGifts#6b65b517`. +// Gifts¹ displayed on a user's profile. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/payments.userStarGifts for reference. type PaymentsUserStarGifts struct { - // Flags field of PaymentsUserStarGifts. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Count field of PaymentsUserStarGifts. + // Total number of gifts displayed on the profile. Count int - // Gifts field of PaymentsUserStarGifts. + // The gifts. Gifts []UserStarGift - // NextOffset field of PaymentsUserStarGifts. + // Offset for pagination¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets // // Use SetNextOffset and GetNextOffset helpers. NextOffset string - // Users field of PaymentsUserStarGifts. + // Users mentioned in the gifts vector. Users []UserClass } diff --git a/tg/tl_prepaid_giveaway_gen.go b/tg/tl_prepaid_giveaway_gen.go index 44be3ba8c..7af1a3b67 100644 --- a/tg/tl_prepaid_giveaway_gen.go +++ b/tg/tl_prepaid_giveaway_gen.go @@ -257,18 +257,25 @@ func (p *PrepaidGiveaway) GetDate() (value int) { } // PrepaidStarsGiveaway represents TL type `prepaidStarsGiveaway#9a9d77e0`. +// Contains info about a prepaid Telegram Star giveaway »¹. +// +// Links: +// 1. https://core.telegram.org/api/giveaways#star-giveaways // // See https://core.telegram.org/constructor/prepaidStarsGiveaway for reference. type PrepaidStarsGiveaway struct { - // ID field of PrepaidStarsGiveaway. + // Prepaid giveaway ID. ID int64 - // Stars field of PrepaidStarsGiveaway. + // Number of given away Telegram Stars »¹ + // + // Links: + // 1) https://core.telegram.org/api/stars Stars int64 - // Quantity field of PrepaidStarsGiveaway. + // Number of giveaway winners Quantity int - // Boosts field of PrepaidStarsGiveaway. + // Number of boosts the channel will gain by launching the giveaway. Boosts int - // Date field of PrepaidStarsGiveaway. + // When was the giveaway paid for Date int } diff --git a/tg/tl_reaction_gen.go b/tg/tl_reaction_gen.go index 9bcb445d4..0f488d77a 100644 --- a/tg/tl_reaction_gen.go +++ b/tg/tl_reaction_gen.go @@ -410,6 +410,10 @@ func (r *ReactionCustomEmoji) GetDocumentID() (value int64) { } // ReactionPaid represents TL type `reactionPaid#523da4eb`. +// Represents a paid Telegram Star reaction »¹. +// +// Links: +// 1. https://core.telegram.org/api/reactions#paid-reactions // // See https://core.telegram.org/constructor/reactionPaid for reference. type ReactionPaid struct { diff --git a/tg/tl_report_result_gen.go b/tg/tl_report_result_gen.go index 6b14179c0..88b43b79c 100644 --- a/tg/tl_report_result_gen.go +++ b/tg/tl_report_result_gen.go @@ -32,12 +32,18 @@ var ( ) // ReportResultChooseOption represents TL type `reportResultChooseOption#f0e4e0b6`. +// The user must choose one of the following options, and then messages.report¹ must be +// re-invoked, passing the option's option identifier to messages.report².option. +// +// Links: +// 1. https://core.telegram.org/method/messages.report +// 2. https://core.telegram.org/method/messages.report // // See https://core.telegram.org/constructor/reportResultChooseOption for reference. type ReportResultChooseOption struct { - // Title field of ReportResultChooseOption. + // Title of the option popup Title string - // Options field of ReportResultChooseOption. + // Available options, rendered as menu entries. Options []MessageReportOption } @@ -208,14 +214,30 @@ func (r *ReportResultChooseOption) GetOptions() (value []MessageReportOption) { } // ReportResultAddComment represents TL type `reportResultAddComment#6f09ac31`. +// The user should enter an additional comment for the moderators, and then messages +// report¹ must be re-invoked, passing the comment to messages.report².message. +// +// Links: +// 1. https://core.telegram.org/method/messages.report +// 2. https://core.telegram.org/method/messages.report // // See https://core.telegram.org/constructor/reportResultAddComment for reference. type ReportResultAddComment struct { - // Flags field of ReportResultAddComment. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Optional field of ReportResultAddComment. + // Whether this step can be skipped by the user, passing an empty message to messages + // report¹, or if a non-empty message is mandatory. + // + // Links: + // 1) https://core.telegram.org/method/messages.report Optional bool - // Option field of ReportResultAddComment. + // The messages.report¹ method must be re-invoked, passing this option to option + // + // Links: + // 1) https://core.telegram.org/method/messages.report Option []byte } @@ -395,6 +417,7 @@ func (r *ReportResultAddComment) GetOption() (value []byte) { } // ReportResultReported represents TL type `reportResultReported#8db33c4b`. +// The report was sent successfully, no further actions are required. // // See https://core.telegram.org/constructor/reportResultReported for reference. type ReportResultReported struct { diff --git a/tg/tl_sponsored_message_gen.go b/tg/tl_sponsored_message_gen.go index 1e34b75dc..421203810 100644 --- a/tg/tl_sponsored_message_gen.go +++ b/tg/tl_sponsored_message_gen.go @@ -71,7 +71,7 @@ type SponsoredMessage struct { // // Use SetPhoto and GetPhoto helpers. Photo PhotoClass - // Media field of SponsoredMessage. + // If set, contains some media. // // Use SetMedia and GetMedia helpers. Media MessageMediaClass diff --git a/tg/tl_star_gift_gen.go b/tg/tl_star_gift_gen.go index 514c9406a..09e93b9a2 100644 --- a/tg/tl_star_gift_gen.go +++ b/tg/tl_star_gift_gen.go @@ -32,38 +32,55 @@ var ( ) // StarGift represents TL type `starGift#49c577cd`. +// Represents a star gift, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/starGift for reference. type StarGift struct { - // Flags field of StarGift. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Limited field of StarGift. + // Whether this is a limited-supply gift. Limited bool - // SoldOut field of StarGift. + // Whether this gift sold out and cannot be bought anymore. SoldOut bool // Birthday field of StarGift. Birthday bool - // ID field of StarGift. + // Identifier of the gift ID int64 - // Sticker field of StarGift. + // Sticker¹ that represents the gift. + // + // Links: + // 1) https://core.telegram.org/api/stickers Sticker DocumentClass - // Stars field of StarGift. + // Price of the gift in Telegram Stars¹. + // + // Links: + // 1) https://core.telegram.org/api/stars Stars int64 - // AvailabilityRemains field of StarGift. + // For limited-supply gifts: the remaining number of gifts that may be bought. // // Use SetAvailabilityRemains and GetAvailabilityRemains helpers. AvailabilityRemains int - // AvailabilityTotal field of StarGift. + // For limited-supply gifts: the total number of gifts that was available in the initial + // supply. // // Use SetAvailabilityTotal and GetAvailabilityTotal helpers. AvailabilityTotal int - // ConvertStars field of StarGift. + // The receiver of this gift may convert it to this many Telegram Stars, instead of + // displaying it on their profile page.convert_stars will be equal to stars only if the + // gift was bought using recently bought Telegram Stars, otherwise it will be less than + // stars. ConvertStars int64 - // FirstSaleDate field of StarGift. + // For sold out gifts only: when was the gift first bought. // // Use SetFirstSaleDate and GetFirstSaleDate helpers. FirstSaleDate int - // LastSaleDate field of StarGift. + // For sold out gifts only: when was the gift last bought. // // Use SetLastSaleDate and GetLastSaleDate helpers. LastSaleDate int diff --git a/tg/tl_stars_giveaway_option_gen.go b/tg/tl_stars_giveaway_option_gen.go index dc95d8f64..e407db5af 100644 --- a/tg/tl_stars_giveaway_option_gen.go +++ b/tg/tl_stars_giveaway_option_gen.go @@ -32,28 +32,49 @@ var ( ) // StarsGiveawayOption represents TL type `starsGiveawayOption#94ce852a`. +// Contains info about a Telegram Star giveaway¹ option. +// +// Links: +// 1. https://core.telegram.org/api/giveaways#star-giveaways // // See https://core.telegram.org/constructor/starsGiveawayOption for reference. type StarsGiveawayOption struct { - // Flags field of StarsGiveawayOption. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Extended field of StarsGiveawayOption. + // If set, this option must only be shown in the full list of giveaway options (i.e. they + // must be added to the list only when the user clicks on the expand button). Extended bool - // Default field of StarsGiveawayOption. + // If set, this option must be pre-selected by default in the option list. Default bool - // Stars field of StarsGiveawayOption. + // The number of Telegram Stars that will be distributed among winners Stars int64 - // YearlyBoosts field of StarsGiveawayOption. + // Number of times the chat will be boosted for one year if the + // inputStorePaymentStarsGiveaway¹.boost_peer flag is populated + // + // Links: + // 1) https://core.telegram.org/constructor/inputStorePaymentStarsGiveaway YearlyBoosts int - // StoreProduct field of StarsGiveawayOption. + // Identifier of the store product associated with the option, official apps only. // // Use SetStoreProduct and GetStoreProduct helpers. StoreProduct string - // Currency field of StarsGiveawayOption. + // Three-letter ISO 4217 currency¹ code + // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string - // Amount field of StarsGiveawayOption. + // Total price in the smallest units of the currency (integer, not float/double). For + // example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in + // currencies.json¹, it shows the number of digits past the decimal point for each + // currency (2 for the majority of currencies). + // + // Links: + // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 - // Winners field of StarsGiveawayOption. + // Allowed options for the number of giveaway winners. Winners []StarsGiveawayWinnersOption } diff --git a/tg/tl_stars_giveaway_winners_option_gen.go b/tg/tl_stars_giveaway_winners_option_gen.go index caa566aea..6d396a262 100644 --- a/tg/tl_stars_giveaway_winners_option_gen.go +++ b/tg/tl_stars_giveaway_winners_option_gen.go @@ -32,16 +32,23 @@ var ( ) // StarsGiveawayWinnersOption represents TL type `starsGiveawayWinnersOption#54236209`. +// Allowed options for the number of giveaway winners. // // See https://core.telegram.org/constructor/starsGiveawayWinnersOption for reference. type StarsGiveawayWinnersOption struct { - // Flags field of StarsGiveawayWinnersOption. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Default field of StarsGiveawayWinnersOption. + // If set, this option must be pre-selected by default in the option list. Default bool - // Users field of StarsGiveawayWinnersOption. + // The number of users that will be randomly chosen as winners. Users int - // PerUserStars field of StarsGiveawayWinnersOption. + // The number of Telegram Stars¹ each winner will receive. + // + // Links: + // 1) https://core.telegram.org/api/stars PerUserStars int64 } diff --git a/tg/tl_stars_subscription_gen.go b/tg/tl_stars_subscription_gen.go index 9c968b64d..d4194ba69 100644 --- a/tg/tl_stars_subscription_gen.go +++ b/tg/tl_stars_subscription_gen.go @@ -32,28 +32,41 @@ var ( ) // StarsSubscription represents TL type `starsSubscription#2e6eab1a`. +// Represents a Telegram Star subscription »¹. +// +// Links: +// 1. https://core.telegram.org/api/invites#paid-invite-links // // See https://core.telegram.org/constructor/starsSubscription for reference. type StarsSubscription struct { - // Flags field of StarsSubscription. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Canceled field of StarsSubscription. + // Whether this subscription was cancelled. Canceled bool - // CanRefulfill field of StarsSubscription. + // Whether we left the associated private channel, but we can still rejoin it using + // payments.fulfillStarsSubscription¹ because the current subscription period hasn't + // expired yet. + // + // Links: + // 1) https://core.telegram.org/method/payments.fulfillStarsSubscription CanRefulfill bool - // MissingBalance field of StarsSubscription. + // Whether this subscription has expired because there are not enough stars on the user's + // balance to extend it. MissingBalance bool // BotCanceled field of StarsSubscription. BotCanceled bool - // ID field of StarsSubscription. + // Subscription ID. ID string - // Peer field of StarsSubscription. + // Identifier of the associated private chat. Peer PeerClass - // UntilDate field of StarsSubscription. + // Expiration date of the current subscription period. UntilDate int - // Pricing field of StarsSubscription. + // Pricing of the subscription in Telegram Stars. Pricing StarsSubscriptionPricing - // ChatInviteHash field of StarsSubscription. + // Invitation link, used to renew the subscription after cancellation or expiration. // // Use SetChatInviteHash and GetChatInviteHash helpers. ChatInviteHash string diff --git a/tg/tl_stars_subscription_pricing_gen.go b/tg/tl_stars_subscription_pricing_gen.go index 1ab62d69f..9ec49897a 100644 --- a/tg/tl_stars_subscription_pricing_gen.go +++ b/tg/tl_stars_subscription_pricing_gen.go @@ -32,12 +32,18 @@ var ( ) // StarsSubscriptionPricing represents TL type `starsSubscriptionPricing#5416d58`. +// Pricing of a Telegram Star subscription »¹. +// +// Links: +// 1. https://core.telegram.org/api/invites#paid-invite-links // // See https://core.telegram.org/constructor/starsSubscriptionPricing for reference. type StarsSubscriptionPricing struct { - // Period field of StarsSubscriptionPricing. + // The user should pay amount stars every period seconds to gain and maintain access to + // the channel. Currently the only allowed subscription period is 30*24*60*60, i.e. the + // user will be debited amount stars every month. Period int - // Amount field of StarsSubscriptionPricing. + // Price of the subscription in Telegram Stars. Amount int64 } diff --git a/tg/tl_stars_transaction_gen.go b/tg/tl_stars_transaction_gen.go index 38c1b7656..89ad1db10 100644 --- a/tg/tl_stars_transaction_gen.go +++ b/tg/tl_stars_transaction_gen.go @@ -52,7 +52,10 @@ type StarsTransaction struct { Failed bool // This transaction was a gift from the user in peer.peer. Gift bool - // Reaction field of StarsTransaction. + // This transaction is a paid reaction »¹. + // + // Links: + // 1) https://core.telegram.org/api/reactions#paid-reactions Reaction bool // Transaction ID. ID string @@ -110,19 +113,40 @@ type StarsTransaction struct { // // Use SetExtendedMedia and GetExtendedMedia helpers. ExtendedMedia []MessageMediaClass - // SubscriptionPeriod field of StarsTransaction. + // The number of seconds between consecutive Telegram Star debiting for Telegram Star + // subscriptions »¹. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-subscriptions // // Use SetSubscriptionPeriod and GetSubscriptionPeriod helpers. SubscriptionPeriod int - // GiveawayPostID field of StarsTransaction. + // ID of the message containing the messageMediaGiveaway¹, for incoming star giveaway + // prizes². + // + // Links: + // 1) https://core.telegram.org/constructor/messageMediaGiveaway + // 2) https://core.telegram.org/api/giveaways#star-giveaways // // Use SetGiveawayPostID and GetGiveawayPostID helpers. GiveawayPostID int - // Stargift field of StarsTransaction. + // This transaction indicates a purchase or a sale (conversion back to Stars) of a gift + // »¹. + // + // Links: + // 1) https://core.telegram.org/api/stars // // Use SetStargift and GetStargift helpers. Stargift StarGift - // FloodskipNumber field of StarsTransaction. + // This transaction is payment for paid bot broadcasts¹. Paid broadcasts are only + // allowed if the allow_paid_floodskip parameter of messages.sendMessage² and other + // message sending methods is set while trying to broadcast more than 30 messages per + // second to bot users. The integer value returned by this flag indicates the number of + // billed API calls. + // + // Links: + // 1) https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once + // 2) https://core.telegram.org/method/messages.sendMessage // // Use SetFloodskipNumber and GetFloodskipNumber helpers. FloodskipNumber int diff --git a/tg/tl_stars_transaction_peer_gen.go b/tg/tl_stars_transaction_peer_gen.go index 3d0e29263..a7d3adae2 100644 --- a/tg/tl_stars_transaction_peer_gen.go +++ b/tg/tl_stars_transaction_peer_gen.go @@ -817,6 +817,12 @@ func (s *StarsTransactionPeerAds) DecodeBare(b *bin.Buffer) error { } // StarsTransactionPeerAPI represents TL type `starsTransactionPeerAPI#f9677aad`. +// Describes a Telegram Star¹ transaction used to pay for paid API usage, such as paid +// bot broadcasts². +// +// Links: +// 1. https://core.telegram.org/api/stars +// 2. https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once // // See https://core.telegram.org/constructor/starsTransactionPeerAPI for reference. type StarsTransactionPeerAPI struct { diff --git a/tg/tl_stats_get_broadcast_revenue_stats_gen.go b/tg/tl_stats_get_broadcast_revenue_stats_gen.go index ca98a1586..3bc6ab9a6 100644 --- a/tg/tl_stats_get_broadcast_revenue_stats_gen.go +++ b/tg/tl_stats_get_broadcast_revenue_stats_gen.go @@ -46,7 +46,7 @@ type StatsGetBroadcastRevenueStatsRequest struct { Flags bin.Fields // Whether to enable dark theme for graph colors Dark bool - // Peer field of StatsGetBroadcastRevenueStatsRequest. + // Get ad revenue stats for the specified channel or bot Peer InputPeerClass } diff --git a/tg/tl_stats_get_broadcast_revenue_transactions_gen.go b/tg/tl_stats_get_broadcast_revenue_transactions_gen.go index 165b8ca9e..acdac2297 100644 --- a/tg/tl_stats_get_broadcast_revenue_transactions_gen.go +++ b/tg/tl_stats_get_broadcast_revenue_transactions_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/stats.getBroadcastRevenueTransactions for reference. type StatsGetBroadcastRevenueTransactionsRequest struct { - // Peer field of StatsGetBroadcastRevenueTransactionsRequest. + // Get ad revenue transactions for the specified channel or bot Peer InputPeerClass // Offset for pagination¹ // diff --git a/tg/tl_stats_get_broadcast_revenue_withdrawal_url_gen.go b/tg/tl_stats_get_broadcast_revenue_withdrawal_url_gen.go index 9c6684cf2..3dbc5c927 100644 --- a/tg/tl_stats_get_broadcast_revenue_withdrawal_url_gen.go +++ b/tg/tl_stats_get_broadcast_revenue_withdrawal_url_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/method/stats.getBroadcastRevenueWithdrawalUrl for reference. type StatsGetBroadcastRevenueWithdrawalURLRequest struct { - // Peer field of StatsGetBroadcastRevenueWithdrawalURLRequest. + // Get ad revenue withdrawal URL for the specified channel or bot Peer InputPeerClass // 2FA password, see here »¹ for more info. // diff --git a/tg/tl_stories_report_gen.go b/tg/tl_stories_report_gen.go index bbcf89c77..ba5aabe77 100644 --- a/tg/tl_stories_report_gen.go +++ b/tg/tl_stories_report_gen.go @@ -40,7 +40,7 @@ type StoriesReportRequest struct { Peer InputPeerClass // IDs of the stories to report. ID []int - // Option field of StoriesReportRequest. + // Menu option, intially empty Option []byte // Comment for report moderation Message string diff --git a/tg/tl_stories_search_posts_gen.go b/tg/tl_stories_search_posts_gen.go index 5d1abbf2c..5a95e8479 100644 --- a/tg/tl_stories_search_posts_gen.go +++ b/tg/tl_stories_search_posts_gen.go @@ -62,7 +62,7 @@ type StoriesSearchPostsRequest struct { // // Use SetArea and GetArea helpers. Area MediaAreaClass - // Peer field of StoriesSearchPostsRequest. + // If set, returns only stories posted by this peer. // // Use SetPeer and GetPeer helpers. Peer InputPeerClass diff --git a/tg/tl_update_gen.go b/tg/tl_update_gen.go index c01d0ac0c..3867b44c9 100644 --- a/tg/tl_update_gen.go +++ b/tg/tl_update_gen.go @@ -13850,7 +13850,10 @@ func (u *UpdateNewScheduledMessage) GetMessage() (value MessageClass) { // // See https://core.telegram.org/constructor/updateDeleteScheduledMessages for reference. type UpdateDeleteScheduledMessages struct { - // Flags field of UpdateDeleteScheduledMessages. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Peer Peer PeerClass @@ -28225,14 +28228,24 @@ func (u *UpdateStarsRevenueStatus) GetStatus() (value StarsRevenueStatus) { } // UpdateBotPurchasedPaidMedia represents TL type `updateBotPurchasedPaidMedia#283bd312`. +// Bots only: a user has purchased a paid media¹. +// +// Links: +// 1. https://core.telegram.org/api/paid-media // // See https://core.telegram.org/constructor/updateBotPurchasedPaidMedia for reference. type UpdateBotPurchasedPaidMedia struct { - // UserID field of UpdateBotPurchasedPaidMedia. + // The user that bought the media UserID int64 - // Payload field of UpdateBotPurchasedPaidMedia. + // Payload passed by the bot in inputMediaPaidMedia¹.payload + // + // Links: + // 1) https://core.telegram.org/constructor/inputMediaPaidMedia Payload string - // Qts field of UpdateBotPurchasedPaidMedia. + // New qts value, see updates »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/updates Qts int } @@ -28413,10 +28426,18 @@ func (u *UpdateBotPurchasedPaidMedia) GetQts() (value int) { } // UpdatePaidReactionPrivacy represents TL type `updatePaidReactionPrivacy#51ca7aec`. +// Contains the current default paid reaction privacy, see here »¹ for more info. +// Clients should invoke messages.getPaidReactionPrivacy¹ on startup to fetch the +// current default reaction privacy because this update is only sent to currently online +// sessions and cannot be fetched using getDifference on client startup. +// +// Links: +// 1. https://core.telegram.org/api/reactions#paid-reactions +// 2. https://core.telegram.org/method/messages.getPaidReactionPrivacy // // See https://core.telegram.org/constructor/updatePaidReactionPrivacy for reference. type UpdatePaidReactionPrivacy struct { - // Private field of UpdatePaidReactionPrivacy. + // Whether paid reaction privacy is enabled or disabled. Private bool } diff --git a/tg/tl_user_full_gen.go b/tg/tl_user_full_gen.go index dede34036..51db60f63 100644 --- a/tg/tl_user_full_gen.go +++ b/tg/tl_user_full_gen.go @@ -119,7 +119,10 @@ type UserFull struct { // Links: // 1) https://core.telegram.org/api/business#re-enable-ads SponsoredEnabled bool - // CanViewRevenue field of UserFull. + // If set, this user can view ad revenue statistics »¹ for this bot. + // + // Links: + // 1) https://core.telegram.org/api/revenue#revenue-statistics CanViewRevenue bool // BotCanManageEmojiStatus field of UserFull. BotCanManageEmojiStatus bool @@ -274,7 +277,10 @@ type UserFull struct { // // Use SetPersonalChannelMessage and GetPersonalChannelMessage helpers. PersonalChannelMessage int - // StargiftsCount field of UserFull. + // Number of gifts¹ the user has chosen to display on their profile + // + // Links: + // 1) https://core.telegram.org/api/gifts // // Use SetStargiftsCount and GetStargiftsCount helpers. StargiftsCount int diff --git a/tg/tl_user_gen.go b/tg/tl_user_gen.go index 1663524f2..1556d9002 100644 --- a/tg/tl_user_gen.go +++ b/tg/tl_user_gen.go @@ -334,11 +334,11 @@ type User struct { ID int64 // Access hash of the user, see here »¹ for more info. If this flag is set, when // updating the local peer database², generate a virtual flag called min_access_hash, - // which is: - Set to true if min is set AND - The phone flag is not set OR - The phone + // which is: - Set to true if min is set AND -- The phone flag is not set OR -- The phone // flag is set and the associated phone number string is non-empty - Set to false // otherwise. Then, apply both access_hash and min_access_hash to the local database if: - // - min_access_hash is false OR - min_access_hash is true AND - There is no locally - // cached object for this user OR - There is no access_hash in the local cache OR - The + // - min_access_hash is false OR - min_access_hash is true AND -- There is no locally + // cached object for this user OR -- There is no access_hash in the local cache OR -- The // cached object's min_access_hash is also true If the final merged object stored to the // database has the min_access_hash field set to true, the related access_hash is only // suitable to use in inputPeerPhotoFileLocation »³, to directly download the profile @@ -356,7 +356,7 @@ type User struct { // Use SetAccessHash and GetAccessHash helpers. AccessHash int64 // First name. When updating the local peer database¹, apply changes to this field only - // if: - The min flag is not set OR - The min flag is set AND - The min flag of the + // if: - The min flag is not set OR - The min flag is set AND -- The min flag of the // locally cached user entry is set. // // Links: @@ -365,7 +365,7 @@ type User struct { // Use SetFirstName and GetFirstName helpers. FirstName string // Last name. When updating the local peer database¹, apply changes to this field only - // if: - The min flag is not set OR - The min flag is set AND - The min flag of the + // if: - The min flag is not set OR - The min flag is set AND -- The min flag of the // locally cached user entry is set. // // Links: @@ -374,7 +374,7 @@ type User struct { // Use SetLastName and GetLastName helpers. LastName string // Main active username. When updating the local peer database¹, apply changes to this - // field only if: - The min flag is not set OR - The min flag is set AND - The min flag + // field only if: - The min flag is not set OR - The min flag is set AND -- The min flag // of the locally cached user entry is set. Changes to this flag should invalidate the // local userFull² cache for this user ID if the above conditions are respected and the // bot_can_edit flag is also set. @@ -386,7 +386,7 @@ type User struct { // Use SetUsername and GetUsername helpers. Username string // Phone number. When updating the local peer database¹, apply changes to this field - // only if: - The min flag is not set OR - The min flag is set AND - The min flag of the + // only if: - The min flag is not set OR - The min flag is set AND -- The min flag of the // locally cached user entry is set. // // Links: @@ -395,8 +395,8 @@ type User struct { // Use SetPhone and GetPhone helpers. Phone string // Profile picture of user. When updating the local peer database¹, apply changes to - // this field only if: - The min flag is not set OR - The min flag is set AND - The - // apply_min_photo flag is set OR - The min flag of the locally cached user entry is set. + // this field only if: - The min flag is not set OR - The min flag is set AND -- The + // apply_min_photo flag is set OR -- The min flag of the locally cached user entry is set. // // Links: // 1) https://core.telegram.org/api/peers @@ -404,9 +404,9 @@ type User struct { // Use SetPhoto and GetPhoto helpers. Photo UserProfilePhotoClass // Online status of user. When updating the local peer database¹, apply changes to this - // field only if: - The min flag is not set OR - The min flag is set AND - The min flag - // of the locally cached user entry is set OR - The locally cached user entry is equal to - // userStatusEmpty². + // field only if: - The min flag is not set OR - The min flag is set AND -- The min flag + // of the locally cached user entry is set OR -- The locally cached user entry is equal + // to userStatusEmpty². // // Links: // 1) https://core.telegram.org/api/peers @@ -445,7 +445,7 @@ type User struct { // Use SetEmojiStatus and GetEmojiStatus helpers. EmojiStatus EmojiStatusClass // Additional usernames. When updating the local peer database¹, apply changes to this - // field only if: - The min flag is not set OR - The min flag is set AND - The min flag + // field only if: - The min flag is not set OR - The min flag is set AND -- The min flag // of the locally cached user entry is set. Changes to this flag (if the above conditions // are respected) should invalidate the local userFull² cache for this user ID. // diff --git a/tg/tl_user_star_gift_gen.go b/tg/tl_user_star_gift_gen.go index 175a1000b..0918c7fb4 100644 --- a/tg/tl_user_star_gift_gen.go +++ b/tg/tl_user_star_gift_gen.go @@ -32,32 +32,50 @@ var ( ) // UserStarGift represents TL type `userStarGift#eea49a6e`. +// Represents a gift¹, displayed on a user's profile page. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/userStarGift for reference. type UserStarGift struct { - // Flags field of UserStarGift. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // NameHidden field of UserStarGift. + // If set, from_id will not be visible to users (it will still be visible to the receiver + // of the gift). NameHidden bool - // Unsaved field of UserStarGift. + // If set, indicates this is a gift sent by from_id, received by the current user and + // currently hidden from our profile page. Unsaved bool - // FromID field of UserStarGift. + // Sender of the gift (may be empty for anonymous senders; will always be set if this + // gift was sent to us). // // Use SetFromID and GetFromID helpers. FromID int64 - // Date field of UserStarGift. + // When was this gift sent. Date int - // Gift field of UserStarGift. + // The gift. Gift StarGift - // Message field of UserStarGift. + // Message attached to the gift by the sender. // // Use SetMessage and GetMessage helpers. Message TextWithEntities - // MsgID field of UserStarGift. + // Only visible to the receiver of the gift, contains the ID of the messageService¹ with + // the messageActionStarGift² in the chat with from_id. + // + // Links: + // 1) https://core.telegram.org/constructor/messageService + // 2) https://core.telegram.org/constructor/messageActionStarGift // // Use SetMsgID and GetMsgID helpers. MsgID int - // ConvertStars field of UserStarGift. + // The receiver of this gift may convert it to this many Telegram Stars, instead of + // displaying it on their profile page.convert_stars will be equal to the buying price of + // the gift only if the gift was bought using recently bought Telegram Stars, otherwise + // it will be less than stars. // // Use SetConvertStars and GetConvertStars helpers. ConvertStars int64