From b5aea68f6604b8e6ec0f73e1fba70ec1215792a5 Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Thu, 2 Jan 2025 00:27:45 +0100 Subject: [PATCH] api doc --- src/TL.Schema.cs | 132 +++++++++++++++++++++++++++++++--------- src/TL.SchemaFuncs.cs | 138 ++++++++++++++++++++++++++++-------------- src/TL.Secret.cs | 16 ----- 3 files changed, 196 insertions(+), 90 deletions(-) diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index cb0d452..aed4861 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -1856,7 +1856,7 @@ namespace TL has_effect = 0x4, /// Field has a value has_factcheck = 0x8, - /// 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 .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). + /// 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 .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).
See here » for more info.
video_processing_pending = 0x10, } @@ -2352,6 +2352,7 @@ namespace TL [IfFlag(1)] public string shipping_option_id; /// Provider payment identifier public PaymentCharge charge; + /// Expiration date of the Telegram Star subscription ». [IfFlag(4)] public DateTime subscription_until_date; [Flags] public enum Flags : uint @@ -2380,6 +2381,7 @@ namespace TL public long total_amount; /// An invoice slug taken from an invoice deep link or from the premium_invoice_slug app config parameter » [IfFlag(0)] public string invoice_slug; + /// Expiration date of the Telegram Star subscription ». [IfFlag(4)] public DateTime subscription_until_date; [Flags] public enum Flags : uint @@ -2814,6 +2816,7 @@ namespace TL [Flags] public enum Flags : uint { + /// If set, this indicates the reverse transaction that refunds the remaining stars to the creator of a giveaway if, when the giveaway ends, the number of members in the channel is smaller than the number of winners in the giveaway. unclaimed = 0x1, } } @@ -3511,6 +3514,7 @@ namespace TL [IfFlag(38)] public int personal_channel_message; /// Number of gifts the user has chosen to display on their profile [IfFlag(40)] public int stargifts_count; + /// This bot has an active referral program » [IfFlag(43)] public StarRefProgram starref_program; [Flags] public enum Flags : uint @@ -3595,6 +3599,7 @@ namespace TL has_stargifts_count = 0x100, /// If set, this user can view ad revenue statistics » for this bot. can_view_revenue = 0x200, + /// If set, this is a bot that can change our emoji status » bot_can_manage_emoji_status = 0x400, /// Field has a value has_starref_program = 0x800, @@ -4751,7 +4756,7 @@ namespace TL /// Message public MessageBase message; } - /// Some scheduled messages were deleted from the schedule queue of a chat See + /// Some scheduled messages were deleted (or sent) from the schedule queue of a chat See [TLDef(0xF2A71983)] public sealed partial class UpdateDeleteScheduledMessages : Update { @@ -4761,6 +4766,7 @@ namespace TL public Peer peer; /// Deleted scheduled messages public int[] messages; + /// If set, this update indicates that some scheduled messages were sent (not simply deleted from the schedule queue).
In this case, the messages field will contain the scheduled message IDs for the sent messages (initially returned in ), and sent_messages will contain the real message IDs for the sent messages.
[IfFlag(0)] public int[] sent_messages; [Flags] public enum Flags : uint @@ -6799,7 +6805,7 @@ namespace TL About = 0x3823CC40, ///Whether the user can see our birthday. Birthday = 0xD65A11CC, - ///
See + ///Whether received gifts will be automatically displayed on our profile StarGiftsAutoSave = 0xE1732341, } @@ -6828,11 +6834,11 @@ namespace TL About = 0xA486B761, ///Whether the user can see our birthday. Birthday = 0x2000A518, - ///See + ///Whether received gifts will be automatically displayed on our profile StarGiftsAutoSave = 0x2CA4FDF8, } - /// Privacy rules indicate who can or can't do something and are specified by a , and its input counterpart . See Derived classes: , , , , , , , , , + /// Privacy rules indicate who can or can't do something and are specified by a , and its input counterpart . See Derived classes: , , , , , , , , , , , public abstract partial class InputPrivacyRule : IObject { } /// Allow only contacts See [TLDef(0x0D09E07B)] @@ -6880,14 +6886,14 @@ namespace TL /// Allow only users with a Premium subscription », currently only usable for . See [TLDef(0x77CDC9F1)] public sealed partial class InputPrivacyValueAllowPremium : InputPrivacyRule { } - /// See + /// Allow bots and mini apps See [TLDef(0x5A4FCCE5)] public sealed partial class InputPrivacyValueAllowBots : InputPrivacyRule { } - /// See + /// Disallow bots and mini apps See [TLDef(0xC4E57915)] public sealed partial class InputPrivacyValueDisallowBots : InputPrivacyRule { } - /// Privacy rules together with privacy keys indicate what can or can't someone do and are specified by a constructor, and its input counterpart . See Derived classes: , , , , , , , , , + /// Privacy rules together with privacy keys indicate what can or can't someone do and are specified by a constructor, and its input counterpart . See Derived classes: , , , , , , , , , , , public abstract partial class PrivacyRule : IObject { } /// Allow all contacts See [TLDef(0xFFFE1BAC)] @@ -6935,10 +6941,10 @@ namespace TL /// Allow only users with a Premium subscription », currently only usable for . See [TLDef(0xECE9814B)] public sealed partial class PrivacyValueAllowPremium : PrivacyRule { } - /// See + /// Allow bots and mini apps See [TLDef(0x21461B5D)] public sealed partial class PrivacyValueAllowBots : PrivacyRule { } - /// See + /// Disallow bots and mini apps See [TLDef(0xF6A5F82F)] public sealed partial class PrivacyValueDisallowBots : PrivacyRule { } @@ -7201,7 +7207,7 @@ namespace TL public string display_url; /// Hash used for caching, for more info click here public int hash; - /// Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else, see here » for a full list. + /// Type of the web page. One of the following:

- video
- gif
- photo
- document
- profile
- telegram_background
- telegram_theme
- telegram_story
- telegram_channel
- telegram_channel_request
- telegram_megagroup
- telegram_chat
- telegram_megagroup_request
- telegram_chat_request
- telegram_album
- telegram_message
- telegram_bot
- telegram_voicechat
- telegram_livestream
- telegram_user
- telegram_botapp
- telegram_channel_boost
- telegram_group_boost
- telegram_giftcode
- telegram_stickerset

[IfFlag(0)] public string type; /// Short name of the site (e.g., Google Docs, App Store) [IfFlag(1)] public string site_name; @@ -7731,6 +7737,7 @@ namespace TL [IfFlag(3)] public BotMenuButtonBase menu_button; /// 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. [IfFlag(7)] public string privacy_policy_url; + /// Mini app » settings
[IfFlag(8)] public BotAppSettings app_settings; [Flags] public enum Flags : uint @@ -10391,6 +10398,7 @@ namespace TL [IfFlag(8)] public long[] suggested_tip_amounts; /// Terms of service URL [IfFlag(10)] public string terms_url; + /// The number of seconds between consecutive Telegram Star debiting for bot subscription invoices [IfFlag(11)] public int subscription_period; [Flags] public enum Flags : uint @@ -11924,7 +11932,9 @@ namespace TL [TLDef(0x64642DB3)] public sealed partial class ChannelAdminLogEventActionParticipantSubExtend : ChannelAdminLogEventAction { + /// Same as new_participant. public ChannelParticipantBase prev_participant; + /// The subscriber that extended the subscription. public ChannelParticipantBase new_participant; } @@ -13580,7 +13590,7 @@ namespace TL { /// Platform identifier (ios, android, wp, all, etc.), can be concatenated with a dash as separator (android-ios, ios-wp, etc) public string platform; - /// Restriction reason (porno, terms, etc.) + /// Restriction reason (porno, terms, etc.). Ignore this restriction reason if it is contained in the ignore_restriction_reasons » client configuration parameter. public string reason; /// Error message to be shown to the user public string text; @@ -15533,6 +15543,7 @@ namespace TL has_query_id = 0x1, /// If set, the app must be opened in fullsize mode instead of compact mode. fullsize = 0x2, + /// If set, the app must be opened in fullscreen fullscreen = 0x4, } } @@ -15680,7 +15691,7 @@ namespace TL public InputUserBase user_id; /// Identifier of the gift, from .id public long gift_id; - /// Optional message, attached with the gift + /// Optional message, attached with the gift.
The maximum length for this field is specified in the stargifts_message_length_max client configuration value ».
[IfFlag(1)] public TextWithEntities message; [Flags] public enum Flags : uint @@ -17609,6 +17620,7 @@ namespace TL [IfFlag(4)] public string used_gift_slug; /// If set, this boost counts as multiplier boosts, otherwise it counts as a single boost. [IfFlag(5)] public int multiplier; + /// Number of Telegram Stars distributed among the winners of the giveaway. [IfFlag(6)] public long stars; [Flags] public enum Flags : uint @@ -19157,8 +19169,11 @@ namespace TL [IfFlag(14)] public StarGift stargift; /// 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.
[IfFlag(15)] public int floodskip_number; + /// This transaction is the receival (or refund) of an affiliate commission (i.e. this is the transaction received by the peer that created the referral link, flag 17 is for transactions made by users that imported the referral link). [IfFlag(16)] public int starref_commission_permille; + /// For transactions made by referred users, the peer that received the affiliate commission. [IfFlag(17)] public Peer starref_peer; + /// For transactions made by referred users, the amount of Telegram Stars received by the affiliate, can be negative for refunds. [IfFlag(17)] public StarsAmount starref_amount; [Flags] public enum Flags : uint @@ -19212,7 +19227,7 @@ namespace TL public StarsAmount balance; /// Info about current Telegram Star subscriptions, only returned when invoking Payments_GetStarsTransactions and Payments_GetStarsSubscriptions. [IfFlag(1)] public StarsSubscription[] subscriptions; - /// Offset for pagination of subscriptions: only usable with Payments_GetStarsSubscriptions, returned when invoking Payments_GetStarsTransactions and Payments_GetStarsSubscriptions. + /// Offset for pagination of subscriptions: only usable and returned when invoking Payments_GetStarsSubscriptions. [IfFlag(2)] public string subscriptions_next_offset; /// 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). [IfFlag(4)] public long subscriptions_missing_balance; @@ -19321,7 +19336,7 @@ namespace TL [Flags] public enum Flags : uint { - /// If set, the user may withdraw up to available_balance stars. + /// If set, the user may withdraw up to available_balance stars. withdrawal_enabled = 0x1, /// Field has a value has_next_withdrawal_at = 0x2, @@ -19340,11 +19355,11 @@ namespace TL public double usd_rate; } - /// Contains the URL to use to withdraw Telegram Star revenue. See + /// Contains the URL to use to withdraw Telegram Star revenue. See [TLDef(0x1DAB80B7)] public sealed partial class Payments_StarsRevenueWithdrawalUrl : IObject { - /// Contains the URL to use to withdraw Telegram Star revenue. + /// Contains the URL to use to withdraw Telegram Star revenue. public string url; } @@ -19460,8 +19475,11 @@ namespace TL public StarsSubscriptionPricing pricing; /// Invitation link, used to renew the subscription after cancellation or expiration. [IfFlag(3)] public string chat_invite_hash; + /// For bot subscriptions, the title of the subscription invoice [IfFlag(4)] public string title; + /// For bot subscriptions, the photo from the subscription invoice [IfFlag(5)] public WebDocumentBase photo; + /// For bot subscriptions, the identifier of the subscription invoice [IfFlag(6)] public string invoice_slug; [Flags] public enum Flags : uint @@ -19480,6 +19498,7 @@ namespace TL has_photo = 0x20, /// Field has a value has_invoice_slug = 0x40, + /// Set if this bot subscription was cancelled by the bot bot_canceled = 0x80, } } @@ -19585,6 +19604,7 @@ namespace TL limited = 0x1, /// Whether this gift sold out and cannot be bought anymore. sold_out = 0x2, + /// Whether this is a birthday-themed gift birthday = 0x4, } } @@ -19698,143 +19718,199 @@ namespace TL [TLDef(0x8DB33C4B)] public sealed partial class ReportResultReported : ReportResult { } - /// See + /// Represents a prepared inline message saved by a bot, to be sent to the user via a web app » See [TLDef(0x8ECF0511)] public sealed partial class Messages_BotPreparedInlineMessage : IObject { + /// The ID of the saved message, to be passed to the id field of the web_app_send_prepared_message event » public string id; + /// Expiration date of the message public DateTime expire_date; } - /// See + /// Represents a prepared inline message received via a bot's mini app, that can be sent to some chats » See [TLDef(0xFF57708D)] public sealed partial class Messages_PreparedInlineMessage : IObject { + /// The query_id to pass to Messages_SendInlineBotResult public long query_id; + /// The contents of the message, to be shown in a preview public BotInlineResultBase result; + /// Types of chats where this message can be sent public InlineQueryPeerType[] peer_types; + /// Caching validity of the results public int cache_time; + /// Users mentioned in the results public Dictionary users; } - /// See + /// Mini app » settings See [TLDef(0xC99B1950)] public sealed partial class BotAppSettings : IObject { + /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// SVG placeholder logo, compressed using the same format used for vector thumbnails ». [IfFlag(0)] public byte[] placeholder_path; + /// Default light mode background color [IfFlag(1)] public int background_color; + /// Default dark mode background color [IfFlag(2)] public int background_dark_color; + /// Default light mode header color [IfFlag(3)] public int header_color; + /// Default dark mode header color [IfFlag(4)] public int header_dark_color; [Flags] public enum Flags : uint { + /// Field has a value has_placeholder_path = 0x1, + /// Field has a value has_background_color = 0x2, + /// Field has a value has_background_dark_color = 0x4, + /// Field has a value has_header_color = 0x8, + /// Field has a value has_header_dark_color = 0x10, } } - /// See + /// Indo about an affiliate program offered by a bot See [TLDef(0xDD0C66F2)] public sealed partial class StarRefProgram : IObject { + /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// ID of the bot that offers the program public long bot_id; + /// An affiliate gets a commission of .commission_permilleTelegram Stars for every mini app transaction made by users they refer public int commission_permille; + /// An affiliate gets a commission for every mini app transaction made by users they refer, for duration_months months after a referral link is imported, starting the bot for the first time [IfFlag(0)] public int duration_months; + /// Point in time (Unix timestamp) when the affiliate program will be closed (optional, if not set the affiliate program isn't scheduled to be closed) [IfFlag(1)] public DateTime end_date; + /// The amount of daily revenue per user in Telegram Stars of the bot that created the affiliate program [IfFlag(2)] public StarsAmount daily_revenue_per_user; [Flags] public enum Flags : uint { + /// Field has a value has_duration_months = 0x1, + /// Field has a value has_end_date = 0x2, + /// Field has a value has_daily_revenue_per_user = 0x4, } } - /// See + /// Info about an active affiliate program we have with a Mini App See [TLDef(0x19A13F71)] public sealed partial class ConnectedBotStarRef : IObject { + /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Referral link to be shared public string url; + /// When did we affiliate with bot_id public DateTime date; + /// ID of the mini app that created the affiliate program public long bot_id; + /// The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by bot_id public int commission_permille; + /// Number of months the program will be active; if not set, there is no expiration date. [IfFlag(0)] public int duration_months; + /// The number of users that used the affiliate program public long participants; + /// The number of Telegram Stars that were earned by the affiliate program public long revenue; [Flags] public enum Flags : uint { + /// Field has a value has_duration_months = 0x1, + /// If set, this affiliation was revoked by the affiliate using Payments_EditConnectedStarRefBot, or by the affiliation program owner using Bots_UpdateStarRefProgram revoked = 0x2, } } - /// See + /// Active affiliations See [TLDef(0x98D5EA1D)] public sealed partial class Payments_ConnectedStarRefBots : IObject { + /// Total number of active affiliations public int count; + /// The affiliations public ConnectedBotStarRef[] connected_bots; + /// Peers mentioned in connected_bots public Dictionary users; } - /// See + /// A list of suggested mini apps with available affiliate programs See [TLDef(0xB4D5D859)] public sealed partial class Payments_SuggestedStarRefBots : IObject { + /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Total number of results (for pagination) public int count; + /// Suggested affiliate programs (full or partial list to be fetched using pagination) public StarRefProgram[] suggested_bots; + /// Peers mentioned in suggested_bots public Dictionary users; + /// Next offset for pagination [IfFlag(0)] public string next_offset; [Flags] public enum Flags : uint { + /// Field has a value has_next_offset = 0x1, } } - /// See + /// Describes a real (i.e. possibly decimal) amount of Telegram Stars. See [TLDef(0xBBB6B4A3)] public sealed partial class StarsAmount : IObject { + /// The integer amount of Telegram Stars. public long amount; + /// The decimal amount of Telegram Stars, expressed as nanostars (i.e. 1 nanostar is equal to 1/1'000'000'000th of a Telegram Star).
This field may also be negative (the allowed range is -999999999 to 999999999).
public int nanos; } - ///
See + /// Found stickers See Derived classes: , public abstract partial class Messages_FoundStickersBase : IObject { } - /// See + /// No new stickers were found for the specified query See [TLDef(0x6010C534)] public sealed partial class Messages_FoundStickersNotModified : Messages_FoundStickersBase { + /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Offset for pagination [IfFlag(0)] public int next_offset; [Flags] public enum Flags : uint { + /// Field has a value has_next_offset = 0x1, } } - /// See + /// Found stickers See [TLDef(0x82C9E290)] public sealed partial class Messages_FoundStickers : Messages_FoundStickersBase { + /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Offset for pagination [IfFlag(0)] public int next_offset; + /// Hash used for caching, for more info click here public long hash; + /// Found stickers public DocumentBase[] stickers; [Flags] public enum Flags : uint { + /// Field has a value has_next_offset = 0x1, } } diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index 403a62a..321e06c 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -232,7 +232,7 @@ namespace TL bot_auth_token = bot_auth_token, }); - /// Try logging to an account protected by a 2FA password. See Possible codes: 400 (details) + /// Try logging to an account protected by a 2FA password. See Possible codes: 400,500 (details) /// The account's password (see SRP) public static Task Auth_CheckPassword(this Client client, InputCheckPasswordSRP password) => client.Invoke(new Auth_CheckPassword @@ -507,7 +507,7 @@ namespace TL rules = rules, }); - /// Delete the user's account from the telegram servers. See Possible codes: 420 (details) + /// Delete the user's account from the telegram servers. See Possible codes: 400,420 (details) /// Why is the account being deleted, can be empty /// 2FA password: this field can be omitted even for accounts with 2FA enabled: in this case account account deletion will be delayed by 7 days as specified in the docs » public static Task Account_DeleteAccount(this Client client, string reason, InputCheckPasswordSRP password = null) @@ -1482,7 +1482,7 @@ namespace TL contacts = contacts, }); - /// Deletes several contacts from the list. See + /// Deletes several contacts from the list. See Possible codes: 400 (details) /// User ID list public static Task Contacts_DeleteContacts(this Client client, params InputUserBase[] id) => client.Invoke(new Contacts_DeleteContacts @@ -1542,6 +1542,7 @@ namespace TL /// Resolve a @username to get peer info See [bots: ✓] Possible codes: 400 (details) /// @username to resolve + /// Referrer ID from referral links ». public static Task Contacts_ResolveUsername(this Client client, string username, string referer = null) => client.Invoke(new Contacts_ResolveUsername { @@ -1761,7 +1762,7 @@ namespace TL /// If a positive value was transferred, only messages with a sending date smaller than the transferred one will be returned /// Only return messages starting from the specified message ID /// Additional offset - /// Number of results to return + /// Number of results to return, can be 0 to only return the message counter. /// Maximum message ID to return /// Minimum message ID to return /// Hash @@ -1844,7 +1845,7 @@ namespace TL action = action, }); - /// Sends a message to a chat See [bots: ✓] Possible codes: 400,403,406,420,500 (details) + /// Sends a message to a chat See [bots: ✓] Possible codes: 400,403,404,406,420,500 (details) /// Set this flag to disable generation of the webpage preview /// Send this message silently (no notifications for the receivers) /// Send this message as background message @@ -3622,7 +3623,7 @@ namespace TL reaction = reaction, }); - /// Translate a given text. See Possible codes: 400 (details) + /// Translate a given text. See Possible codes: 400,500 (details) /// If the text is a chat message, the peer ID /// A list of message IDs to translate /// A list of styled messages to translate @@ -3713,7 +3714,8 @@ namespace TL /// Open a bot mini app, sending over user information after user confirmation. See Possible codes: 400,403 (details) /// Whether the webview was opened by clicking on the bot's menu button ». /// Whether the inline message that will be sent by the bot on behalf of the user once the web app interaction is Messages_SendWebViewResultMessage should be sent silently (no notifications for the receivers). - /// If set, requests to open the mini app in compact mode (as opposed to fullview mode). Must be set if the mode parameter of the attachment menu deep link is equal to compact. + /// If set, requests to open the mini app in compact mode (as opposed to normal or fullscreen mode). Must be set if the mode parameter of the attachment menu deep link is equal to compact. + /// If set, requests to open the mini app in fullscreen mode (as opposed to normal or compact mode). Must be set if the mode parameter of the attachment menu deep link is equal to fullscreen. /// Dialog where the web app is being opened, and where the resulting message will be sent (see the docs for more info »). /// Bot that owns the web app /// Web app URL @@ -3758,6 +3760,7 @@ namespace TL /// Whether the webapp was opened by clicking on the switch_webview button shown on top of the inline results list returned by Messages_GetInlineBotResults. /// Set this flag if opening the Mini App from the installed side menu entry ». /// Deprecated. + /// Requests to open the app in fullscreen mode. /// Bot that owns the mini app /// Web app URL, if opening from a keyboard button or inline result /// Deprecated. @@ -3898,7 +3901,7 @@ namespace TL }); /// Changes the default value of the Time-To-Live setting, applied to all new chats. See Possible codes: 400 (details) - /// The new default Time-To-Live of all messages sent in new chats. + /// The new default Time-To-Live of all messages sent in new chats, in seconds. public static Task Messages_SetDefaultHistoryTTL(this Client client, int period) => client.Invoke(new Messages_SetDefaultHistoryTTL { @@ -3985,7 +3988,8 @@ namespace TL /// Open a bot mini app from a direct Mini App deep link, sending over user information after user confirmation. See Possible codes: 400 (details) /// Set this flag if the bot is asking permission to send messages to the user as specified in the direct Mini App deep link docs, and the user agreed. - /// If set, requests to open the mini app in compact mode (as opposed to fullview mode). Must be set if the mode parameter of the direct Mini App deep link is equal to compact. + /// If set, requests to open the mini app in compact mode (as opposed to normal or fullscreen mode). Must be set if the mode parameter of the direct Mini App deep link is equal to compact. + /// If set, requests to open the mini app in fullscreen mode (as opposed to compact or normal mode). Must be set if the mode parameter of the direct Mini App deep link is equal to fullscreen. /// If the client has clicked on the link in a Telegram chat, pass the chat's peer information; otherwise pass the bot's peer information, instead. /// The app obtained by invoking Messages_GetBotApp as specified in the direct Mini App deep link docs. /// If the startapp query string parameter is present in the direct Mini App deep link, pass it to start_param. @@ -4304,7 +4308,8 @@ namespace TL }); /// Open a Main Mini App. See Possible codes: 400 (details) - /// If set, requests to open the mini app in compact mode (as opposed to fullview mode). Must be set if the mode parameter of the Main Mini App link is equal to compact. + /// If set, requests to open the mini app in compact mode (as opposed to normal or fullscreen mode). Must be set if the mode parameter of the Main Mini App link is equal to compact. + /// If set, requests to open the mini app in fullscreen mode (as opposed to compact or normal mode). Must be set if the mode parameter of the Main Mini App link is equal to fullscreen. /// Currently open chat, may be if no chat is currently open. /// Bot that owns the main mini app. /// Start parameter, if opening from a Main Mini App link ». @@ -4321,7 +4326,7 @@ namespace TL platform = platform, }); - /// Sends one or more paid Telegram Star reactions », transferring Telegram Stars » to a channel's balance. See [bots: ✓] + /// Sends one or more paid Telegram Star reactions », transferring Telegram Stars » to a channel's balance. See Possible codes: 400 (details) /// The channel /// The message to react to /// The number of stars to send (each will increment the reaction counter by one). @@ -4338,7 +4343,7 @@ namespace TL private_ = private_ ?? default, }); - /// Changes the privacy of already sent paid reactions on a specific message. See [bots: ✓] + /// Changes the privacy of already sent paid reactions on a specific message. See Possible codes: 400 (details) /// The channel /// The ID of the message to which we sent the paid reactions /// If true, makes the current anonymous in the top sender leaderboard for this message; otherwise, does the opposite. @@ -4350,13 +4355,13 @@ namespace TL private_ = private_, }); - /// Fetches an update with the current default paid reaction privacy, see here » for more info. See [bots: ✓] + /// Fetches an update with the current default paid reaction privacy, see here » for more info. See public static Task Messages_GetPaidReactionPrivacy(this Client client) => client.Invoke(new Messages_GetPaidReactionPrivacy { }); - /// Mark a specific sponsored message » as read See [bots: ✓] + /// Mark a specific sponsored message » as read See /// The channel/bot where the ad is located /// The ad's unique ID. public static Task Messages_ViewSponsoredMessage(this Client client, InputPeer peer, byte[] random_id) @@ -4366,7 +4371,7 @@ namespace TL random_id = random_id, }); - /// Informs the server that the user has interacted with a sponsored message in one of the ways listed here ». See [bots: ✓] + /// Informs the server that the user has interacted with a sponsored message in one of the ways listed here ». See /// The user clicked on the media /// The user expanded the video to full screen, and then clicked on it. /// The channel/bot where the ad is located @@ -4379,7 +4384,7 @@ namespace TL random_id = random_id, }); - /// Report a sponsored message », see here » for more info on the full flow. See [bots: ✓] + /// Report a sponsored message », see here » for more info on the full flow. See /// The channel/bot where the ad is located /// The ad's unique ID. /// Chosen report option, initially an empty string, see here » for more info on the full flow. @@ -4391,7 +4396,7 @@ namespace TL option = option, }); - /// Get a list of sponsored messages for a peer, see here » for more info. See [bots: ✓] + /// Get a list of sponsored messages for a peer, see here » for more info. See /// The currently open channel/bot. /// a null value means messages.sponsoredMessagesEmpty public static Task Messages_GetSponsoredMessages(this Client client, InputPeer peer) @@ -4400,7 +4405,10 @@ namespace TL peer = peer, }); - /// See + /// Save a prepared inline message, to be shared by the user of the mini app using a web_app_send_prepared_message event See [bots: ✓] Possible codes: 400 (details) + /// The message + /// The user to whom the web_app_send_prepared_message event event will be sent + /// Types of chats where this message can be sent public static Task Messages_SavePreparedInlineMessage(this Client client, InputBotInlineResultBase result, InputUserBase user_id, InlineQueryPeerType[] peer_types = null) => client.Invoke(new Messages_SavePreparedInlineMessage { @@ -4410,7 +4418,9 @@ namespace TL peer_types = peer_types, }); - /// See + /// Obtain a prepared inline message generated by a mini app: invoked when handling web_app_send_prepared_message events See Possible codes: 400 (details) + /// The bot that owns the mini app that emitted the web_app_send_prepared_message event + /// The id from the web_app_send_prepared_message event public static Task Messages_GetPreparedInlineMessage(this Client client, InputUserBase bot, string id) => client.Invoke(new Messages_GetPreparedInlineMessage { @@ -4418,7 +4428,14 @@ namespace TL id = id, }); - /// See + /// Search for stickers using AI-powered keyword search See + /// If set, returns custom emoji stickers + /// The search term + /// Space-separated list of emojis to search for + /// List of possible IETF language tags of the user's input language; may be empty if unknown + /// Offset for pagination + /// Maximum number of results to return, see pagination + /// Hash used for caching, for more info click here.
The hash may be generated locally by using the ids of the returned or stored sticker s. public static Task Messages_SearchStickers(this Client client, string q, string emoticon, string[] lang_code, int offset = default, int limit = int.MaxValue, long hash = default, bool emojis = false) => client.Invoke(new Messages_SearchStickers { @@ -5756,7 +5773,9 @@ namespace TL bot = bot, }); - /// See + /// Change the emoji status of a user (invoked by bots, see here » for more info on the full flow) See [bots: ✓] Possible codes: 400 (details) + /// The user whose emoji status should be changed + /// The emoji status public static Task Bots_UpdateUserEmojiStatus(this Client client, InputUserBase user_id, EmojiStatus emoji_status) => client.Invoke(new Bots_UpdateUserEmojiStatus { @@ -5764,7 +5783,9 @@ namespace TL emoji_status = emoji_status, }); - /// See + /// Allow or prevent a bot from changing our emoji status » See Possible codes: 400 (details) + /// The bot + /// Whether to allow or prevent the bot from changing our emoji status public static Task Bots_ToggleUserEmojiStatusPermission(this Client client, InputUserBase bot, bool enabled) => client.Invoke(new Bots_ToggleUserEmojiStatusPermission { @@ -5772,7 +5793,10 @@ namespace TL enabled = enabled, }); - /// See + /// Check if a mini app can request the download of a specific file: called when handling web_app_request_file_download events » See Possible codes: 400 (details) + /// The bot that owns the mini app that requested the download + /// The filename from the web_app_request_file_download event » + /// The url from the web_app_request_file_download event » public static Task Bots_CheckDownloadFileParams(this Client client, InputUserBase bot, string file_name, string url) => client.Invoke(new Bots_CheckDownloadFileParams { @@ -5781,13 +5805,16 @@ namespace TL url = url, }); - /// See + /// Get a list of bots owned by the current user See public static Task Bots_GetAdminedBots(this Client client) => client.Invoke(new Bots_GetAdminedBots { }); - /// See + /// Create, edit or delete the affiliate program of a bot we own See Possible codes: 400 (details) + /// The bot + /// The permille commission rate: it indicates the share of Telegram Stars received by affiliates for every transaction made by users they referred inside of the bot.
The minimum and maximum values for this parameter are contained in the starref_min_commission_permille and starref_max_commission_permille client configuration parameters.
Can be 0 to terminate the affiliate program.
Both the duration and the commission may only be raised after creation of the program: to lower them, the program must first be terminated and a new one created. + /// Indicates the duration of the affiliate program; if not set, there is no expiration date. public static Task Bots_UpdateStarRefProgram(this Client client, InputUserBase bot, int commission_permille, int? duration_months = null) => client.Invoke(new Bots_UpdateStarRefProgram { @@ -5799,7 +5826,7 @@ namespace TL /// Get a payment form See Possible codes: 400 (details) /// Invoice - /// A JSON object with the following keys, containing color theme information (integers, RGB24) to pass to the payment provider, to apply in eventual verification pages:
bg_color - Background color
text_color - Text color
hint_color - Hint text color
link_color - Link color
button_color - Button color
button_text_color - Button text color + /// Theme parameters » public static Task Payments_GetPaymentForm(this Client client, InputInvoice invoice, DataJSON theme_params = null) => client.Invoke(new Payments_GetPaymentForm { @@ -6017,7 +6044,7 @@ namespace TL peer = peer, }); - /// Withdraw funds from a channel or bot's star balance ». See Possible codes: 400 (details) + /// Withdraw funds from a channel or bot's star balance ». See Possible codes: 400 (details) /// Channel or bot from which to withdraw funds. /// Amount of stars to withdraw. /// 2FA password, see here » for more info. @@ -6029,7 +6056,7 @@ namespace TL password = password, }); - /// Returns a URL for a Telegram Ad platform account that can be used to set up advertisements for channel/bot in peer, paid using the Telegram Stars owned by the specified peer, see here » for more info. See Possible codes: 400 (details) + /// Returns a URL for a Telegram Ad platform account that can be used to set up advertisements for channel/bot in peer, paid using the Telegram Stars owned by the specified peer, see here » for more info. See Possible codes: 400,403 (details) /// Channel or bot that owns the stars. public static Task Payments_GetStarsRevenueAdsAccountUrl(this Client client, InputPeer peer) => client.Invoke(new Payments_GetStarsRevenueAdsAccountUrl @@ -6047,7 +6074,7 @@ namespace TL id = id, }); - /// Obtain a list of Telegram Stars gift options » as s. See + /// Obtain a list of Telegram Stars gift options » as s. See Possible codes: 400 (details) /// Receiver of the gift (optional). public static Task Payments_GetStarsGiftOptions(this Client client, InputUserBase user_id = null) => client.Invoke(new Payments_GetStarsGiftOptions @@ -6056,10 +6083,10 @@ namespace TL user_id = user_id, }); - /// Obtain a list of active, expired or cancelled Telegram Star subscriptions ». See [bots: ✓] - /// Whether to return only expired subscriptions due to an excessively low Telegram Star balance. + /// Obtain a list of active, expired or cancelled Telegram Star subscriptions ». See Possible codes: 400 (details) + /// Whether to return only subscriptions expired due to an excessively low Telegram Star balance. /// Always pass . - /// Offset for pagination, taken from payments.starsStatus. + /// Offset for pagination, taken from .subscriptions_next_offset. public static Task Payments_GetStarsSubscriptions(this Client client, InputPeer peer, string offset, bool missing_balance = false) => client.Invoke(new Payments_GetStarsSubscriptions { @@ -6068,7 +6095,7 @@ namespace TL offset = offset, }); - /// Activate or deactivate a Telegram Star subscription ». See [bots: ✓] + /// Activate or deactivate a Telegram Star subscription ». See Possible codes: 400 (details) /// Always pass . /// ID of the subscription. /// Whether to cancel or reactivate the subscription. @@ -6081,7 +6108,7 @@ namespace TL canceled = canceled ?? default, }); - /// Re-join a private channel associated to an active Telegram Star subscription ». See [bots: ✓] + /// Re-join a private channel associated to an active Telegram Star subscription ». See Possible codes: 400 (details) /// Always pass . /// ID of the subscription. public static Task Payments_FulfillStarsSubscription(this Client client, InputPeer peer, string subscription_id) @@ -6091,14 +6118,14 @@ namespace TL subscription_id = subscription_id, }); - /// Fetch a list of star giveaway options ». See [bots: ✓] + /// Fetch a list of star giveaway options ». See public static Task Payments_GetStarsGiveawayOptions(this Client client) => client.Invoke(new Payments_GetStarsGiveawayOptions { }); - /// Get a list of available gifts, see here » for more info. See [bots: ✓] - /// Hash used for caching, for more info click here. + /// Get a list of available gifts, see here » for more info. See + /// Hash used for caching, for more info click here.
The hash may be generated locally by using the ids of the returned or stored sticker s. /// a null value means payments.starGiftsNotModified public static Task Payments_GetStarGifts(this Client client, int hash = default) => client.Invoke(new Payments_GetStarGifts @@ -6106,7 +6133,7 @@ namespace TL hash = hash, }); - /// Get the gifts » pinned on a specific user's profile. See [bots: ✓] + /// Get the gifts » pinned on a specific user's profile. See Possible codes: 400 (details) /// Identifier of the user (can be the current user to fetch all gifts received by the current user). /// Offset for pagination, taken from (initially empty). /// Maximum number of results to return, see pagination @@ -6118,7 +6145,7 @@ namespace TL limit = limit, }); - /// Display or remove a received gift » from our profile. See [bots: ✓] + /// Display or remove a received gift » from our profile. See Possible codes: 400 (details) /// If set, hides the gift from our profile. /// ID of the user that sent us the gift. /// The ID of the with the . @@ -6130,7 +6157,7 @@ namespace TL msg_id = msg_id, }); - /// Convert a received gift » into Telegram Stars: this will permanently destroy the gift, converting it into .convert_stars Telegram Stars, added to the user's balance. See [bots: ✓] + /// Convert a received gift » into Telegram Stars: this will permanently destroy the gift, converting it into .convert_stars Telegram Stars, added to the user's balance. See Possible codes: 400 (details) /// ID of the user that sent us the gift. /// The ID of the with the . public static Task Payments_ConvertStarGift(this Client client, InputUserBase user_id, int msg_id) @@ -6140,7 +6167,10 @@ namespace TL msg_id = msg_id, }); - /// See + /// Cancel a bot subscription See Possible codes: 400 (details) + /// If not set, disables autorenewal of the subscriptions, and prevents the user from reactivating the subscription once the current period expires: a subscription cancelled by the bot will have the .bot_canceled flag set.
The bot can can partially undo this operation by setting this flag: this will allow the user to reactivate the subscription. + /// The ID of the user whose subscription should be (un)cancelled + /// The provider_charge_id from the service message sent to the bot for the first subscription payment. public static Task Payments_BotCancelStarsSubscription(this Client client, InputUserBase user_id, string charge_id, bool restore = false) => client.Invoke(new Payments_BotCancelStarsSubscription { @@ -6149,7 +6179,11 @@ namespace TL charge_id = charge_id, }); - /// See + /// Fetch all affiliations we have created for a certain peer See + /// The affiliated peer + /// If set, returns only results older than the specified unixtime + /// Offset for pagination, taken from the last returned .url (initially empty) + /// Maximum number of results to return, see pagination public static Task Payments_GetConnectedStarRefBots(this Client client, InputPeer peer, int limit = int.MaxValue, DateTime? offset_date = null, string offset_link = null) => client.Invoke(new Payments_GetConnectedStarRefBots { @@ -6160,7 +6194,9 @@ namespace TL limit = limit, }); - /// See + /// Fetch info about a specific bot affiliation » See Possible codes: 400 (details) + /// The affiliated peer + /// The bot that offers the affiliate program public static Task Payments_GetConnectedStarRefBot(this Client client, InputPeer peer, InputUserBase bot) => client.Invoke(new Payments_GetConnectedStarRefBot { @@ -6168,7 +6204,12 @@ namespace TL bot = bot, }); - /// See + /// Obtain a list of suggested mini apps with available affiliate programs See Possible codes: 403 (details) + /// If set, orders results by the expected revenue + /// If set, orders results by the creation date of the affiliate program + /// The peer that will become the affiliate: star commissions will be transferred to this peer's star balance. + /// Offset for pagination, taken from .next_offset, initially empty. + /// Maximum number of results to return, see pagination public static Task Payments_GetSuggestedStarRefBots(this Client client, InputPeer peer, string offset, int limit = int.MaxValue, bool order_by_revenue = false, bool order_by_date = false) => client.Invoke(new Payments_GetSuggestedStarRefBots { @@ -6178,7 +6219,9 @@ namespace TL limit = limit, }); - /// See + /// Join a bot's affiliate program, becoming an affiliate » See + /// The peer that will become the affiliate: star commissions will be transferred to this peer's star balance. + /// The bot that offers the affiliate program public static Task Payments_ConnectStarRefBot(this Client client, InputPeer peer, InputUserBase bot) => client.Invoke(new Payments_ConnectStarRefBot { @@ -6186,7 +6229,10 @@ namespace TL bot = bot, }); - /// See + /// Leave a bot's affiliate program » See Possible codes: 400 (details) + /// If set, leaves the bot's affiliate program + /// The peer that was affiliated + /// The affiliate link to revoke public static Task Payments_EditConnectedStarRefBot(this Client client, InputPeer peer, string link, bool revoked = false) => client.Invoke(new Payments_EditConnectedStarRefBot { diff --git a/src/TL.Secret.cs b/src/TL.Secret.cs index c9c475b..a9a9c11 100644 --- a/src/TL.Secret.cs +++ b/src/TL.Secret.cs @@ -42,11 +42,8 @@ namespace TL /// Indicates the location of a photo, will be deprecated soon See public abstract partial class FileLocationBase : IObject { - /// Server volume public virtual long VolumeId => default; - /// File ID public virtual int LocalId => default; - /// Checksum to access the file public virtual long Secret => default; } @@ -501,38 +498,25 @@ namespace TL [TLDef(0x7C596B46)] public sealed partial class FileLocationUnavailable : FileLocationBase { - /// Server volume public long volume_id; - /// File ID public int local_id; - /// Checksum to access the file public long secret; - /// Server volume public override long VolumeId => volume_id; - /// File ID public override int LocalId => local_id; - /// Checksum to access the file public override long Secret => secret; } /// File location. See [TLDef(0x53D69076)] public sealed partial class FileLocation : FileLocationBase { - /// Number of the data center holding the file public int dc_id; - /// Server volume public long volume_id; - /// File ID public int local_id; - /// Checksum to access the file public long secret; - /// Server volume public override long VolumeId => volume_id; - /// File ID public override int LocalId => local_id; - /// Checksum to access the file public override long Secret => secret; } }