From 7643ed5ba43de5049ea72eb5bb8b8e82ad21d5d4 Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Sun, 7 Jul 2024 22:55:12 +0200 Subject: [PATCH] API Layer 184: MessageActionPaymentRefunded, flag can_view_stars_revenue --- .github/dev.yml | 2 +- README.md | 2 +- src/TL.Schema.cs | 202 ++++++++++++++++++++++++++++++------- src/TL.SchemaFuncs.cs | 97 ++++++++++++------ src/TL.Table.cs | 3 +- src/WTelegramClient.csproj | 2 +- 6 files changed, 236 insertions(+), 72 deletions(-) diff --git a/.github/dev.yml b/.github/dev.yml index d3c7729..d13b28d 100644 --- a/.github/dev.yml +++ b/.github/dev.yml @@ -1,7 +1,7 @@ pr: none trigger: [ master ] -name: 4.1.3-dev.$(Rev:r) +name: 4.1.4-dev.$(Rev:r) pool: vmImage: ubuntu-latest diff --git a/README.md b/README.md index 3e0b5b2..a092718 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![API Layer](https://img.shields.io/badge/API_Layer-183-blueviolet)](https://corefork.telegram.org/methods) +[![API Layer](https://img.shields.io/badge/API_Layer-184-blueviolet)](https://corefork.telegram.org/methods) [![NuGet version](https://img.shields.io/nuget/v/WTelegramClient?color=00508F)](https://www.nuget.org/packages/WTelegramClient/) [![NuGet prerelease](https://img.shields.io/nuget/vpre/WTelegramClient?color=C09030&label=dev+nuget)](https://www.nuget.org/packages/WTelegramClient/absoluteLatest) [![Donate](https://img.shields.io/badge/Help_this_project:-Donate-ff4444)](https://www.buymeacoffee.com/wizou) diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index 829557a..bb5144e 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -1523,6 +1523,7 @@ public sealed partial class ChannelFull : ChatFullBase /// Field has a value has_reactions_limit = 0x2000, paid_media_allowed = 0x4000, + can_view_stars_revenue = 0x8000, } /// ID of the channel @@ -1702,6 +1703,7 @@ public sealed partial class Message : MessageBase { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Extra bits of information, use flags2.HasFlag(...) to test for those public Flags2 flags2; /// ID of the message public int id; @@ -1717,6 +1719,7 @@ public sealed partial class Message : MessageBase [IfFlag(2)] public MessageFwdHeader fwd_from; /// ID of the inline bot that generated the message [IfFlag(11)] public long via_bot_id; + /// Whether the message was sent by the business bot specified in via_bot_id on behalf of the user. [IfFlag(32)] public long via_business_bot_id; /// Reply information [IfFlag(3)] public MessageReplyHeaderBase reply_to; @@ -1748,6 +1751,7 @@ public sealed partial class Message : MessageBase [IfFlag(22)] public RestrictionReason[] restriction_reason; /// Time To Live of the message, once message.date+message.ttl_period === time(), the message will be deleted on the server, and must be deleted locally as well. [IfFlag(25)] public int ttl_period; + /// If set, this message is a quick reply shortcut message » (note that quick reply shortcut messages sent to a private chat will not have this field set). [IfFlag(30)] public int quick_reply_shortcut_id; [IfFlag(34)] public long effect; [IfFlag(35)] public FactCheck factcheck; @@ -2648,10 +2652,11 @@ public sealed partial class MessageActionGiveawayResults : MessageAction /// Number of undistributed prizes public int unclaimed_count; } - /// See + /// Some boosts » were applied to the channel or supergroup. See [TLDef(0xCC02AA6D)] public sealed partial class MessageActionBoostApply : MessageAction { + /// Number of applied boosts. public int boosts; } /// See @@ -2661,6 +2666,22 @@ public sealed partial class MessageActionRequestedPeerSentMe : MessageAction public int button_id; public RequestedPeer[] peers; } + /// See + [TLDef(0x41B3E202)] + public sealed partial class MessageActionPaymentRefunded : MessageAction + { + public Flags flags; + public Peer peer; + public string currency; + public long total_amount; + [IfFlag(0)] public byte[] payload; + public PaymentCharge charge; + + [Flags] public enum Flags : uint + { + has_payload = 0x1, + } + } /// Chat info. See Derived classes: , public abstract partial class DialogBase : IObject @@ -3130,7 +3151,9 @@ public sealed partial class PeerSettings : IObject [IfFlag(9)] public string request_chat_title; /// If set, this is a private chat with an administrator of a chat or channel to which the user sent a join request, and this field contains the timestamp when the join request » was sent. [IfFlag(9)] public DateTime request_chat_date; + /// Contains the ID of the business bot » managing this chat, used to display info about the bot in the action bar. [IfFlag(13)] public long business_bot_id; + /// Contains a deep link », used to open a management menu in the business bot. This flag is set if and only if business_bot_id is set. [IfFlag(13)] public string business_bot_manage_url; [Flags] public enum Flags : uint @@ -3157,7 +3180,9 @@ public sealed partial class PeerSettings : IObject has_request_chat_title = 0x200, /// This flag is set if request_chat_title and request_chat_date fields are set and the join request » is related to a channel (otherwise if only the request fields are set, the join request » is related to a chat). request_chat_broadcast = 0x400, + /// This flag is set if both business_bot_id and business_bot_manage_url are set and all connected business bots » were paused in this chat using Account_ToggleConnectedBotPaused. business_bot_paused = 0x800, + /// This flag is set if both business_bot_id and business_bot_manage_url are set and connected business bots » can reply to messages in this chat, as specified by the settings during initial configuration. business_bot_can_reply = 0x1000, /// Fields and have a value has_business_bot_id = 0x2000, @@ -3312,7 +3337,9 @@ public sealed partial class UserFull : IObject [IfFlag(35)] public BusinessAwayMessage business_away_message; [IfFlag(36)] public BusinessIntro business_intro; [IfFlag(37)] public Birthday birthday; + /// ID of the associated personal channel », that should be shown in the profile page. [IfFlag(38)] public long personal_channel_id; + /// ID of the latest message of the associated personal channel », that should be previewed in the profile page. [IfFlag(38)] public int personal_channel_message; [Flags] public enum Flags : uint @@ -5080,7 +5107,7 @@ public sealed partial class UpdateChannelPinnedTopics : Update has_order = 0x1, } } - /// User information was updated, it must be refetched using Users_GetFullUser. See + /// User ( and/or ) information was updated, it must be refetched using Users_GetFullUser. See [TLDef(0x20529438)] public partial class UpdateUser : Update { @@ -5242,7 +5269,7 @@ public sealed partial class UpdatePinnedSavedDialogs : Update has_order = 0x1, } } - /// See + /// The list of reaction tag » names assigned by the user has changed and should be refetched using Messages_GetSavedReactionTags. See [TLDef(0x39C67432)] public sealed partial class UpdateSavedReactionTags : Update { } /// See @@ -5251,34 +5278,39 @@ public sealed partial class UpdateSmsJob : Update { public string job_id; } - /// See + /// Info about or the order of quick reply shortcuts » was changed. See [TLDef(0xF9470AB2)] public sealed partial class UpdateQuickReplies : Update { + /// New quick reply shortcut order and information. public QuickReply[] quick_replies; } - /// See + /// A new quick reply shortcut » was created. See [TLDef(0xF53DA717)] public sealed partial class UpdateNewQuickReply : Update { + /// Quick reply shortcut. public QuickReply quick_reply; } - /// See + /// A quick reply shortcut » was deleted. This will not emit updates, even if all the messages in the shortcut are also deleted by this update. See [TLDef(0x53E6F1EC)] public partial class UpdateDeleteQuickReply : Update { + /// ID of the quick reply shortcut that was deleted. public int shortcut_id; } - /// See + /// A new message was added to a quick reply shortcut ». See [TLDef(0x3E050D0F)] public sealed partial class UpdateQuickReplyMessage : Update { + /// The message that was added (the .quick_reply_shortcut_id field will contain the shortcut ID). public MessageBase message; } - /// See + /// One or more messages in a quick reply shortcut » were deleted. See [TLDef(0x566FE7CD, inheritBefore = true)] public sealed partial class UpdateDeleteQuickReplyMessages : UpdateDeleteQuickReply { + /// IDs of the deleted messages. public int[] messages; } /// See @@ -6524,7 +6556,7 @@ public enum InputPrivacyKey : uint VoiceMessages = 0xAEE69D68, ///Whether people can see your bio About = 0x3823CC40, - ///See + ///Whether the user can see our birthday. Birthday = 0xD65A11CC, } @@ -6551,7 +6583,7 @@ public enum PrivacyKey : uint VoiceMessages = 0x0697F414, ///Whether people can see your bio About = 0xA486B761, - ///See + ///Whether the user can see our birthday. Birthday = 0x2000A518, } @@ -7366,6 +7398,7 @@ public sealed partial class StickerSet : IObject text_color = 0x200, /// If set, this custom emoji stickerset can be used in channel/supergroup emoji statuses. channel_emoji_status = 0x400, + /// Whether we created this stickerset creator = 0x800, } } @@ -7818,6 +7851,7 @@ public sealed partial class MessageEntityBlockquote : MessageEntity [Flags] public enum Flags : uint { + /// Whether the quote is collapsed by default. collapsed = 0x1, } } @@ -9064,12 +9098,13 @@ public sealed partial class Auth_SentCodeTypeFirebaseSms : Auth_SentCodeTypeSms has_play_integrity_project_id = 0x4, } } - /// See + /// The code was sent via SMS as a secret word, starting with the letter specified in beginning See [TLDef(0xA416AC81)] public sealed partial class Auth_SentCodeTypeSmsWord : Auth_SentCodeType { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// The secret word in the sent SMS (which may contain multiple words) starts with this letter. [IfFlag(0)] public string beginning; [Flags] public enum Flags : uint @@ -9078,12 +9113,13 @@ public sealed partial class Auth_SentCodeTypeSmsWord : Auth_SentCodeType has_beginning = 0x1, } } - /// See + /// The code was sent via SMS as a secret phrase starting with the word specified in beginning, See [TLDef(0xB37794AF)] public sealed partial class Auth_SentCodeTypeSmsPhrase : Auth_SentCodeType { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// The secret phrase (and the SMS) starts with this word. [IfFlag(0)] public string beginning; [Flags] public enum Flags : uint @@ -11531,7 +11567,7 @@ public sealed partial class ChannelAdminLogEventActionChangeEmojiStatus : Channe /// New emoji status public EmojiStatus new_value; } - /// See + /// The supergroup's custom emoji stickerset was changed. See [TLDef(0x46D840AB)] public sealed partial class ChannelAdminLogEventActionChangeEmojiStickerSet : ChannelAdminLogEventActionChangeStickerSet { } @@ -14104,6 +14140,7 @@ public sealed partial class MessageReplyHeader : MessageReplyHeaderBase [TLDef(0x0E5AF939)] public sealed partial class MessageReplyStoryHeader : MessageReplyHeaderBase { + /// Sender of the story. public Peer peer; /// Story ID public int story_id; @@ -14879,6 +14916,7 @@ public sealed partial class MessageReactions : IObject has_recent_reactions = 0x2, /// Whether Messages_GetMessageReactionsList can be used to see how each specific peer reacted to the message can_see_list = 0x4, + /// If set or if there are no reactions, all present and future reactions should be treated as message tags, see here » for more info. reactions_as_tags = 0x8, } } @@ -16380,6 +16418,7 @@ public sealed partial class StoryItem : StoryItemBase public int id; /// When was the story posted. public DateTime date; + /// Sender of the story. [IfFlag(18)] public Peer from_id; /// For reposted stories », contains info about the original story. [IfFlag(17)] public StoryFwdHeader fwd_from; @@ -16497,6 +16536,7 @@ public sealed partial class Stories_Stories : IObject, IPeerResolver public int count; /// Stories public StoryItemBase[] stories; + /// IDs of pinned stories. [IfFlag(0)] public int[] pinned_to_top; /// Mentioned chats public Dictionary chats; @@ -16655,6 +16695,7 @@ public sealed partial class InputReplyToMessage : InputReplyTo [TLDef(0x5881323A)] public sealed partial class InputReplyToStory : InputReplyTo { + /// Sender of the story public InputPeer peer; /// ID of the story to reply to. public int story_id; @@ -17462,14 +17503,17 @@ public sealed partial class Messages_SavedDialogsNotModified : Messages_SavedDia public int count; } - /// See + /// Info about a saved message reaction tag ». See [TLDef(0xCB6FF828)] public sealed partial class SavedReactionTag : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Reaction associated to the tag. public Reaction reaction; + /// Custom tag name assigned by the user (max 12 UTF-8 chars). [IfFlag(0)] public string title; + /// Number of messages tagged with this tag. public int count; [Flags] public enum Flags : uint @@ -17479,11 +17523,12 @@ public sealed partial class SavedReactionTag : IObject } } - /// See + /// List of reaction tag » names assigned by the user. See /// a value means messages.savedReactionTagsNotModified [TLDef(0x3259950A)] public sealed partial class Messages_SavedReactionTags : IObject { + /// Saved reaction tags. public SavedReactionTag[] tags; /// Hash for pagination, for more info click here public long hash; @@ -17498,42 +17543,55 @@ public sealed partial class OutboxReadDate : IObject /// See Derived classes: public abstract partial class Smsjobs_EligibilityToJoin : IObject { } - /// See + /// SMS jobs eligibility See [TLDef(0xDC8B44CF)] public sealed partial class Smsjobs_EligibleToJoin : Smsjobs_EligibilityToJoin { + /// Terms of service URL public string terms_url; + /// Monthly sent SMSes public int monthly_sent_sms; } - /// See + /// Status See [TLDef(0x2AEE9191)] public sealed partial class Smsjobs_Status : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Recently sent public int recent_sent; + /// Since public int recent_since; + /// Remaining public int recent_remains; + /// Total sent public int total_sent; + /// Total since public int total_since; + /// Last gift deep link [IfFlag(1)] public string last_gift_slug; + /// Terms of service URL public string terms_url; [Flags] public enum Flags : uint { + /// Allow international numbers allow_international = 0x1, /// Field has a value has_last_gift_slug = 0x2, } } - /// See + /// Info about an SMS job. See [TLDef(0xE6A1EEB8)] public sealed partial class SmsJob : IObject { + /// Job ID public string job_id; + /// Destination phone number public string phone_number; + /// Text public string text; } @@ -17565,13 +17623,15 @@ public sealed partial class BusinessWorkHours : IObject } } - /// See + /// Represents the location of a Telegram Business ». See [TLDef(0xAC5C1AF7)] public sealed partial class BusinessLocation : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Geographical coordinates (optional). [IfFlag(0)] public GeoPoint geo_point; + /// Textual description of the address (mandatory). public string address; [Flags] public enum Flags : uint @@ -17715,83 +17775,102 @@ public sealed partial class BusinessAwayMessage : IObject } } - /// See + /// Timezone information. See [TLDef(0xFF9289F5)] public sealed partial class Timezone : IObject { + /// Unique timezone ID. public string id; + /// Human-readable and localized timezone name. public string name; + /// UTC offset in seconds, which may be displayed in hh:mm format by the client together with the human-readable name (i.e. $name UTC -01:00). public int utc_offset; } - /// See + /// Timezone information that may be used elsewhere in the API, such as to set Telegram Business opening hours ». See /// a value means help.timezonesListNotModified [TLDef(0x7B74ED71)] public sealed partial class Help_TimezonesList : IObject { + /// Timezones public Timezone[] timezones; /// Hash for pagination, for more info click here public int hash; } - /// See + /// A quick reply shortcut. See [TLDef(0x0697102B)] public sealed partial class QuickReply : IObject { + /// Unique shortcut ID. public int shortcut_id; + /// Shortcut name. public string shortcut; + /// ID of the last message in the shortcut. public int top_message; + /// Total number of messages in the shortcut. public int count; } /// See Derived classes: , public abstract partial class InputQuickReplyShortcutBase : IObject { } - /// See + /// Selects a quick reply shortcut by name. See [TLDef(0x24596D41)] public sealed partial class InputQuickReplyShortcut : InputQuickReplyShortcutBase { + /// Shortcut name. public string shortcut; } - /// See + /// Selects a quick reply shortcut by its numeric ID. See [TLDef(0x01190CF1)] public sealed partial class InputQuickReplyShortcutId : InputQuickReplyShortcutBase { + /// Shortcut ID. public int shortcut_id; } - /// See + /// Info about quick reply shortcuts ». See /// a value means messages.quickRepliesNotModified [TLDef(0xC68D6695)] public sealed partial class Messages_QuickReplies : IObject, IPeerResolver { + /// Quick reply shortcuts. public QuickReply[] quick_replies; + /// Messages mentioned in quick_replies. public MessageBase[] messages; + /// Mentioned chats public Dictionary chats; + /// Mentioned users public Dictionary users; /// returns a or for the given Peer public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats); } - /// See + /// Contains info about a connected business bot ». See [TLDef(0xBD068601)] public sealed partial class ConnectedBot : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// ID of the connected bot public long bot_id; + /// Specifies the private chats that a connected business bot » may receive messages and interact with.
public BusinessBotRecipients recipients; [Flags] public enum Flags : uint { + /// Whether the the bot can reply to messages it receives through the connection can_reply = 0x1, } } - /// See + /// Info about currently connected business bots. See [TLDef(0x17D7F87B)] public sealed partial class Account_ConnectedBots : IObject { + /// Info about the connected bots public ConnectedBot[] connected_bots; + /// Bot information public Dictionary users; } @@ -17809,14 +17888,17 @@ public sealed partial class Messages_DialogFilters : IObject } } - /// See + /// Birthday information for a user. See [TLDef(0x6C8E1E06)] public sealed partial class Birthday : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Birth day public int day; + /// Birth month public int month; + /// (Optional) birth year. [IfFlag(0)] public int year; [Flags] public enum Flags : uint @@ -17826,20 +17908,26 @@ public sealed partial class Birthday : IObject } } - /// See + /// Contains info about a bot business connection. See [TLDef(0x896433B4)] public sealed partial class BotBusinessConnection : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Business connection ID, used to identify messages coming from the connection and to reply to them as specified here ». public string connection_id; + /// ID of the user that the bot is connected to via this connection. public long user_id; + /// ID of the datacenter where to send queries wrapped in a InvokeWithBusinessConnection as specified here ». public int dc_id; + /// When was the connection created. public DateTime date; [Flags] public enum Flags : uint { + /// Whether the bot can reply on behalf of the user to messages it receives through the business connection can_reply = 0x1, + /// Whether this business connection is currently disabled disabled = 0x2, } } @@ -17913,100 +18001,125 @@ public sealed partial class Fragment_CollectibleInfo : IObject public string url; } - /// See + /// Specifies the private chats that a connected business bot » may interact with. See [TLDef(0xC4E5921E)] public sealed partial class InputBusinessBotRecipients : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Explicitly selected private chats. [IfFlag(4)] public InputUserBase[] users; + /// Identifiers of private chats that are always excluded. [IfFlag(6)] public InputUserBase[] exclude_users; [Flags] public enum Flags : uint { + /// Selects all existing private chats. existing_chats = 0x1, + /// Selects all new private chats. new_chats = 0x2, + /// Selects all private chats with contacts. contacts = 0x4, + /// Selects all private chats with non-contacts. non_contacts = 0x8, /// Field has a value has_users = 0x10, + /// If set, then all private chats except the ones selected by existing_chats, new_chats, contacts, non_contacts and users are chosen.
Note that if this flag is set, any values passed in exclude_users will be merged and moved into users by the server.
exclude_selected = 0x20, /// Field has a value has_exclude_users = 0x40, } } - ///
See + /// Specifies the private chats that a connected business bot » may receive messages and interact with. See [TLDef(0xB88CF373)] public sealed partial class BusinessBotRecipients : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Explicitly selected private chats. [IfFlag(4)] public long[] users; + /// Identifiers of private chats that are always excluded. [IfFlag(6)] public long[] exclude_users; [Flags] public enum Flags : uint { + /// Selects all existing private chats. existing_chats = 0x1, + /// Selects all new private chats. new_chats = 0x2, + /// Selects all private chats with contacts. contacts = 0x4, + /// Selects all private chats with non-contacts. non_contacts = 0x8, /// Field has a value has_users = 0x10, + /// If set, then all private chats except the ones selected by existing_chats, new_chats, contacts, non_contacts and users are chosen.
Note that if this flag is set, any values passed in exclude_users will be merged and moved into users by the server, thus exclude_users will always be empty.
exclude_selected = 0x20, /// Field has a value has_exclude_users = 0x40, } } - ///
See + /// Birthday information of a contact. See [TLDef(0x1D998733)] public sealed partial class ContactBirthday : IObject { + /// User ID. public long contact_id; + /// Birthday information. public Birthday birthday; } - /// See + /// Birthday information of our contacts. See [TLDef(0x114FF30D)] public sealed partial class Contacts_ContactBirthdays : IObject { + /// Birthday info public ContactBirthday[] contacts; + /// User information public Dictionary users; } - /// See + /// Info about why a specific user could not be invited ». See [TLDef(0x628C9224)] public sealed partial class MissingInvitee : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// ID of the user. If neither of the flags below are set, we could not add the user because of their privacy settings, and we can create and directly share an invite link with them using a normal message, instead. public long user_id; [Flags] public enum Flags : uint { + /// If set, we could not add the user only because the current account needs to purchase a Telegram Premium subscription to complete the operation. premium_would_allow_invite = 0x1, + /// If set, we could not add the user because of their privacy settings, and additionally, the current account needs to purchase a Telegram Premium subscription to directly share an invite link with the user via a private message. premium_required_for_pm = 0x2, } } - /// See + /// Contains info about successfully or unsuccessfully invited » users. See [TLDef(0x7F5DEFA6)] public sealed partial class Messages_InvitedUsers : IObject { + /// List of updates about successfully invited users (and eventually info about the created group) public UpdatesBase updates; + /// A list of users that could not be invited, along with the reason why they couldn't be invited. public MissingInvitee[] missing_invitees; } - /// See + /// Contains info about a business chat deep link » to be created by the current account. See [TLDef(0x11679FA7)] public sealed partial class InputBusinessChatLink : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Message to pre-fill in the message input field. public string message; /// Message entities for styled text [IfFlag(0)] public MessageEntity[] entities; + /// Human-readable name of the link, to simplify management in the UI (only visible to the creator of the link). [IfFlag(1)] public string title; [Flags] public enum Flags : uint @@ -18018,17 +18131,21 @@ public sealed partial class InputBusinessChatLink : IObject } } - /// See + /// Contains info about a business chat deep link » created by the current account. See [TLDef(0xB4AE666F)] public sealed partial class BusinessChatLink : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Business chat deep link. public string link; + /// Message to pre-fill in the message input field. public string message; /// Message entities for styled text [IfFlag(0)] public MessageEntity[] entities; + /// Human-readable name of the link, to simplify management in the UI (only visible to the creator of the link). [IfFlag(1)] public string title; + /// Number of times the link was resolved (clicked/scanned/etc...). public int views; [Flags] public enum Flags : uint @@ -18040,28 +18157,35 @@ public sealed partial class BusinessChatLink : IObject } } - /// See + /// Contains info about business chat deep links » created by the current account. See [TLDef(0xEC43A2D1)] public sealed partial class Account_BusinessChatLinks : IObject, IPeerResolver { + /// Links public BusinessChatLink[] links; + /// Mentioned chats public Dictionary chats; + /// Mentioned users public Dictionary users; /// returns a or for the given Peer public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats); } - /// See + /// Contains info about a single resolved business chat deep link ». See [TLDef(0x9A23AF21)] public sealed partial class Account_ResolvedBusinessChatLinks : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + /// Destination peer public Peer peer; + /// Message to pre-fill in the message input field. public string message; /// Message entities for styled text [IfFlag(0)] public MessageEntity[] entities; + /// Mentioned chats public Dictionary chats; + /// Mentioned users public Dictionary users; [Flags] public enum Flags : uint diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index cd6aa33..7c2f62d 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -92,7 +92,9 @@ public static Task InvokeWithTakeout(this Client client, long takeout_id, query = query, }); - /// See + /// Invoke a method using a Telegram Business Bot connection, see here » for more info, including a list of the methods that can be wrapped in this constructor. See + /// Business connection ID. + /// The actual query. public static Task InvokeWithBusinessConnection(this Client client, string connection_id, IMethod query) => client.Invoke(new InvokeWithBusinessConnection { @@ -332,6 +334,7 @@ public static Task Auth_ImportWebTokenAuthorization(this /// Phone number /// Phone code hash returned by Auth_SendCode /// On Android, a JWS object obtained as described in the auth documentation » + /// On Android, an object obtained as described in the auth documentation » /// Secret token received via an apple push notification public static Task Auth_RequestFirebaseSms(this Client client, string phone_number, string phone_code_hash, string safety_net_token = null, string ios_push_secret = null, string play_integrity_token = null) => client.Invoke(new Auth_RequestFirebaseSms @@ -1252,7 +1255,8 @@ public static Task Account_UpdateBusinessLocation(this Client client, stri address = address, }); - /// See + /// Set a list of Telegram Business greeting messages. See + /// Greeting message configuration and contents. public static Task Account_UpdateBusinessGreetingMessage(this Client client, InputBusinessGreetingMessage message = null) => client.Invoke(new Account_UpdateBusinessGreetingMessage { @@ -1260,7 +1264,8 @@ public static Task Account_UpdateBusinessGreetingMessage(this Client clien message = message, }); - /// See + /// Set a list of Telegram Business away messages. See + /// Away message configuration and contents. public static Task Account_UpdateBusinessAwayMessage(this Client client, InputBusinessAwayMessage message = null) => client.Invoke(new Account_UpdateBusinessAwayMessage { @@ -1268,7 +1273,11 @@ public static Task Account_UpdateBusinessAwayMessage(this Client client, I message = message, }); - /// See + /// Connect a business bot » to the current account, or to change the current connection settings. See + /// Whether the bot can reply to messages it receives from us, on behalf of us using the business connection. + /// Whether to fully disconnect the bot from the current account. + /// The bot to connect or disconnect + /// Configuration for the business connection public static Task Account_UpdateConnectedBot(this Client client, InputUserBase bot, InputBusinessBotRecipients recipients, bool can_reply = false, bool deleted = false) => client.Invoke(new Account_UpdateConnectedBot { @@ -1277,13 +1286,14 @@ public static Task Account_UpdateConnectedBot(this Client client, I recipients = recipients, }); - /// See + /// List all currently connected business bots » See public static Task Account_GetConnectedBots(this Client client) => client.Invoke(new Account_GetConnectedBots { }); - /// See [bots: ✓] Possible codes: 400 (details) + /// Bots may invoke this method to re-fetch the associated with a specific business connection_id, see here » for more info on connected business bots.
This is needed for example for freshly logged in bots that are receiving some , etc. updates because some users have already connected to the bot before it could login.
In this case, the bot is receiving messages from the business connection, but it hasn't cached the associated with info about the connection (can it reply to messages? etc.) yet, and cannot receive the old ones because they were sent when the bot wasn't logged into the session yet.
This method can be used to fetch info about a not-yet-cached business connection, and should not be invoked if the info is already cached or to fetch changes, as eventual changes will automatically be sent as new updates to the bot using the usual update delivery methods ». See [bots: ✓] Possible codes: 400 (details)
+ /// Business connection ID ». public static Task Account_GetBotBusinessConnection(this Client client, string connection_id) => client.Invoke(new Account_GetBotBusinessConnection { @@ -1298,7 +1308,9 @@ public static Task Account_UpdateBusinessIntro(this Client client, InputBu intro = intro, }); - /// See Possible codes: 400 (details) + /// Pause or unpause a specific chat, temporarily disconnecting it from all business bots ». See Possible codes: 400 (details) + /// The chat to pause + /// Whether to pause or unpause the chat public static Task Account_ToggleConnectedBotPaused(this Client client, InputPeer peer, bool paused) => client.Invoke(new Account_ToggleConnectedBotPaused { @@ -1306,14 +1318,16 @@ public static Task Account_ToggleConnectedBotPaused(this Client client, In paused = paused, }); - /// See Possible codes: 400 (details) + /// Permanently disconnect a specific chat from all business bots » (equivalent to specifying it in recipients.exclude_users during initial configuration with Account_UpdateConnectedBot); to reconnect of a chat disconnected using this method the user must reconnect the entire bot by invoking Account_UpdateConnectedBot. See Possible codes: 400 (details) + /// The chat to disconnect public static Task Account_DisablePeerConnectedBot(this Client client, InputPeer peer) => client.Invoke(new Account_DisablePeerConnectedBot { peer = peer, }); - /// See + /// Update our birthday, see here » for more info. See + /// Birthday. public static Task Account_UpdateBirthday(this Client client, Birthday birthday = null) => client.Invoke(new Account_UpdateBirthday { @@ -1321,14 +1335,17 @@ public static Task Account_UpdateBirthday(this Client client, Birthday bir birthday = birthday, }); - /// See + /// Create a business chat deep link ». See + /// Info about the link to create. public static Task Account_CreateBusinessChatLink(this Client client, InputBusinessChatLink link) => client.Invoke(new Account_CreateBusinessChatLink { link = link, }); - /// See Possible codes: 400 (details) + /// Edit a created business chat deep link ». See Possible codes: 400 (details) + /// Slug of the link, obtained as specified here ». + /// New link information. public static Task Account_EditBusinessChatLink(this Client client, string slug, InputBusinessChatLink link) => client.Invoke(new Account_EditBusinessChatLink { @@ -1336,27 +1353,30 @@ public static Task Account_EditBusinessChatLink(this Client cl link = link, }); - /// See Possible codes: 400 (details) + /// Delete a business chat deep link ». See Possible codes: 400 (details) + /// Slug of the link, obtained as specified here ». public static Task Account_DeleteBusinessChatLink(this Client client, string slug) => client.Invoke(new Account_DeleteBusinessChatLink { slug = slug, }); - /// See + /// List all created business chat deep links ». See public static Task Account_GetBusinessChatLinks(this Client client) => client.Invoke(new Account_GetBusinessChatLinks { }); - /// See Possible codes: 400 (details) + /// Resolve a business chat deep link ». See Possible codes: 400 (details) + /// Slug of the link, obtained as specified here ». public static Task Account_ResolveBusinessChatLink(this Client client, string slug) => client.Invoke(new Account_ResolveBusinessChatLink { slug = slug, }); - /// See + /// Associate (or remove) a personal channel », that will be listed on our personal profile page ». See + /// The channel, pass to remove it. public static Task Account_UpdatePersonalChannel(this Client client, InputChannelBase channel) => client.Invoke(new Account_UpdatePersonalChannel { @@ -1656,7 +1676,7 @@ public static Task Contacts_SetBlocked(this Client client, InputPeer[] id, limit = limit, }); - /// See + /// Fetch all users with birthdays that fall within +1/-1 days, relative to the current day: this method should be invoked by clients every 6-8 hours, and if the result is non-empty, it should be used to appropriately update locally cached birthday information in .birthday. See public static Task Contacts_GetBirthdays(this Client client) => client.Invoke(new Contacts_GetBirthdays { @@ -1822,6 +1842,7 @@ public static Task Messages_SetTyping(this Client client, InputPeer peer, /// Message entities for sending styled text /// Scheduled message date for scheduled messages /// Send this message as the specified peer + /// Add the message to the specified quick reply shortcut », instead. public static Task Messages_SendMessage(this Client client, InputPeer peer, string message, long random_id, InputReplyTo reply_to = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, DateTime? schedule_date = null, InputPeer send_as = null, InputQuickReplyShortcutBase quick_reply_shortcut = null, long? effect = null, bool no_webpage = false, bool silent = false, bool background = false, bool clear_draft = false, bool noforwards = false, bool update_stickersets_order = false, bool invert_media = false) => client.Invoke(new Messages_SendMessage { @@ -1854,6 +1875,7 @@ public static Task Messages_SendMessage(this Client client, InputPe /// Message entities for styled text /// Scheduled message date for scheduled messages /// Send this message as the specified peer + /// Add the message to the specified quick reply shortcut », instead. public static Task Messages_SendMedia(this Client client, InputPeer peer, InputMedia media, string message, long random_id, InputReplyTo reply_to = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, DateTime? schedule_date = null, InputPeer send_as = null, InputQuickReplyShortcutBase quick_reply_shortcut = null, long? effect = null, bool silent = false, bool background = false, bool clear_draft = false, bool noforwards = false, bool update_stickersets_order = false, bool invert_media = false) => client.Invoke(new Messages_SendMedia { @@ -1885,6 +1907,7 @@ public static Task Messages_SendMedia(this Client client, InputPeer /// Destination forum topic /// Scheduled message date for scheduled messages /// Forward the messages as the specified peer + /// Add the messages to the specified quick reply shortcut », instead. public static Task Messages_ForwardMessages(this Client client, InputPeer from_peer, int[] id, long[] random_id, InputPeer to_peer, int? top_msg_id = null, DateTime? schedule_date = null, InputPeer send_as = null, InputQuickReplyShortcutBase quick_reply_shortcut = null, bool silent = false, bool background = false, bool with_my_score = false, bool drop_author = false, bool drop_media_captions = false, bool noforwards = false) => client.Invoke(new Messages_ForwardMessages { @@ -2389,6 +2412,7 @@ public static Task Messages_SetInlineBotResults(this Client client, long q /// Result ID from Messages_GetInlineBotResults /// Scheduled message date for scheduled messages /// Send this message as the specified peer + /// Add the message to the specified quick reply shortcut », instead. public static Task Messages_SendInlineBotResult(this Client client, InputPeer peer, long random_id, long query_id, string id, InputReplyTo reply_to = null, DateTime? schedule_date = null, InputPeer send_as = null, InputQuickReplyShortcutBase quick_reply_shortcut = null, bool silent = false, bool background = false, bool clear_draft = false, bool hide_via = false) => client.Invoke(new Messages_SendInlineBotResult { @@ -2423,6 +2447,7 @@ public static Task Messages_GetMessageEditData(this Cl /// Reply markup for inline keyboards /// Message entities for styled text /// Scheduled message date for scheduled messages + /// If specified, edits a quick reply shortcut message, instead ». public static Task Messages_EditMessage(this Client client, InputPeer peer, int id, string message = null, InputMedia media = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, DateTime? schedule_date = null, int? quick_reply_shortcut_id = null, bool no_webpage = false, bool invert_media = false) => client.Invoke(new Messages_EditMessage { @@ -2731,6 +2756,7 @@ public static Task Messages_SetBotPrecheckoutResults(this Client client, l }); /// Upload a file and associate it to a chat (without actually sending it to the chat) See [bots: ✓] Possible codes: 400,403 (details) + /// Whether the media will be used only in the specified business connection », and not directly by the bot. /// The chat, can be for bots and for users. /// File uploaded in chunks as described in files » /// a null value means messageMediaEmpty @@ -2830,6 +2856,7 @@ public static Task Messages_GetRecentLocations(this Clien /// The medias to send: note that they must be separately uploaded using Messages_UploadMedia first, using raw inputMediaUploaded* constructors is not supported. /// Scheduled message date for scheduled messages /// Send this message as the specified peer + /// Add the message to the specified quick reply shortcut », instead. public static Task Messages_SendMultiMedia(this Client client, InputPeer peer, InputSingleMedia[] multi_media, InputReplyTo reply_to = null, DateTime? schedule_date = null, InputPeer send_as = null, InputQuickReplyShortcutBase quick_reply_shortcut = null, long? effect = null, bool silent = false, bool background = false, bool clear_draft = false, bool noforwards = false, bool update_stickersets_order = false, bool invert_media = false) => client.Invoke(new Messages_SendMultiMedia { @@ -4133,7 +4160,9 @@ public static Task Messages_DeleteQuickReplyShortcut(this Client client, i shortcut_id = shortcut_id, }); - /// This method is only for basic Chat. See Terminology in the README to understand what this means
Search for a similar method name starting with Channels_ if you're dealing with a
See Possible codes: 400 (details)
+ /// This method is only for basic Chat. See Terminology in the README to understand what this means
Search for a similar method name starting with Channels_ if you're dealing with a
Fetch (a subset or all) messages in a quick reply shortcut ». See Possible codes: 400 (details)
+ /// Quick reply shortcut ID. + /// IDs of the messages to fetch, if empty fetches all of them. /// Hash for pagination, for more info click here public static Task Messages_GetQuickReplyMessages(this Client client, int shortcut_id, long hash = default, int[] id = null) => client.Invoke(new Messages_GetQuickReplyMessages @@ -4144,8 +4173,11 @@ public static Task Messages_GetQuickReplyMessages(this Cl hash = hash, }); - /// See Possible codes: 400 (details) - /// You can use + /// Send a quick reply shortcut ». See Possible codes: 400 (details) + /// The peer where to send the shortcut (users only, for now). + /// The ID of the quick reply shortcut to send. + /// Specify a subset of messages from the shortcut to send; if empty, defaults to all of them. + /// Unique client IDs required to prevent message resending, one for each message we're sending, may be empty (but not recommended). You can use public static Task Messages_SendQuickReplyMessages(this Client client, InputPeer peer, int shortcut_id, int[] id, params long[] random_id) => client.Invoke(new Messages_SendQuickReplyMessages { @@ -4625,7 +4657,7 @@ public static Task Help_GetPeerProfileColors(this Client client hash = hash, }); - /// See + /// Returns timezone information that may be used elsewhere in the API, such as to set Telegram Business opening hours ». See /// Hash for pagination, for more info click here.
Note: the usual hash generation algorithm cannot be used in this case, please re-use the .hash field returned by a previous call to the method, or pass 0 if this is the first call. /// a null value means help.timezonesListNotModified public static Task Help_GetTimezonesList(this Client client, int hash = default) @@ -5296,7 +5328,9 @@ public static Task Channels_SetBoostsToUnblockRestrictions(this Cli boosts = boosts, }); - /// See Possible codes: 400 (details) + /// Set a custom emoji stickerset for supergroups. Only usable after reaching at least the boost level » specified in the group_emoji_stickers_level_min » config parameter. See Possible codes: 400 (details) + /// The supergroup + /// The custom emoji stickerset to associate to the supergroup public static Task Channels_SetEmojiStickers(this Client client, InputChannelBase channel, InputStickerSet stickerset) => client.Invoke(new Channels_SetEmojiStickers { @@ -5848,7 +5882,9 @@ public static Task Stickers_DeleteStickerSet(this Client client, InputStic stickerset = stickerset, }); - /// See [bots: ✓] Possible codes: 400 (details) + /// Replace a sticker in a stickerset ». See [bots: ✓] Possible codes: 400 (details) + /// Old sticker document. + /// New sticker. /// a null value means messages.stickerSetNotModified public static Task Stickers_ReplaceSticker(this Client client, InputDocument sticker, InputStickerSetItem new_sticker) => client.Invoke(new Stickers_ReplaceSticker @@ -6843,45 +6879,48 @@ public static Task Premium_GetUserBoosts(this Client client, user_id = user_id, }); - /// See Possible codes: 403 (details) + /// Check if we can process SMS jobs (official clients only). See Possible codes: 403 (details) public static Task Smsjobs_IsEligibleToJoin(this Client client) => client.Invoke(new Smsjobs_IsEligibleToJoin { }); - /// See Possible codes: 400 (details) + /// Enable SMS jobs (official clients only). See Possible codes: 400 (details) public static Task Smsjobs_Join(this Client client) => client.Invoke(new Smsjobs_Join { }); - /// See Possible codes: 400 (details) + /// Disable SMS jobs (official clients only). See Possible codes: 400 (details) public static Task Smsjobs_Leave(this Client client) => client.Invoke(new Smsjobs_Leave { }); - /// See Possible codes: 400 (details) + /// Update SMS job settings (official clients only). See Possible codes: 400 (details) + /// Allow international numbers? public static Task Smsjobs_UpdateSettings(this Client client, bool allow_international = false) => client.Invoke(new Smsjobs_UpdateSettings { flags = (Smsjobs_UpdateSettings.Flags)(allow_international ? 0x1 : 0), }); - /// See Possible codes: 400 (details) + /// Get SMS jobs status (official clients only). See Possible codes: 400 (details) public static Task Smsjobs_GetStatus(this Client client) => client.Invoke(new Smsjobs_GetStatus { }); - /// See Possible codes: 400 (details) + /// Get info about an SMS job (official clients only). See Possible codes: 400 (details) public static Task Smsjobs_GetSmsJob(this Client client, string job_id) => client.Invoke(new Smsjobs_GetSmsJob { job_id = job_id, }); - /// See Possible codes: 400 (details) + /// Finish an SMS job (official clients only). See Possible codes: 400 (details) + /// Job ID. + /// If failed, the error. public static Task Smsjobs_FinishJob(this Client client, string job_id, string error = null) => client.Invoke(new Smsjobs_FinishJob { diff --git a/src/TL.Table.cs b/src/TL.Table.cs index 9e04c7e..af84daf 100644 --- a/src/TL.Table.cs +++ b/src/TL.Table.cs @@ -6,7 +6,7 @@ namespace TL { public static partial class Layer { - public const int Version = 183; // fetched 01/07/2024 23:00:22 + public const int Version = 184; // fetched 07/07/2024 20:50:35 internal const int SecretChats = 144; internal const int MTProto2 = 73; internal const uint VectorCtor = 0x1CB5C415; @@ -209,6 +209,7 @@ public static partial class Layer [0x2A9FADC5] = typeof(MessageActionGiveawayResults), [0xCC02AA6D] = typeof(MessageActionBoostApply), [0x93B31848] = typeof(MessageActionRequestedPeerSentMe), + [0x41B3E202] = typeof(MessageActionPaymentRefunded), [0xD58A08C6] = typeof(Dialog), [0x71BD134C] = typeof(DialogFolder), [0x2331B22D] = typeof(PhotoEmpty), diff --git a/src/WTelegramClient.csproj b/src/WTelegramClient.csproj index 8239a31..c8d1dcc 100644 --- a/src/WTelegramClient.csproj +++ b/src/WTelegramClient.csproj @@ -13,7 +13,7 @@ WTelegramClient 0.0.0 Wizou - Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 183 + Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 184 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))