diff --git a/src/Client.Helpers.cs b/src/Client.Helpers.cs index 505003e..c0d0b2a 100644 --- a/src/Client.Helpers.cs +++ b/src/Client.Helpers.cs @@ -122,7 +122,7 @@ namespace WTelegram } } - /// Search messages with filter and text See + /// Search messages in chat with filter and text See /// See for a list of possible filter types /// User or chat, histories with which are searched, or constructor for global search /// Text search request @@ -131,6 +131,14 @@ namespace WTelegram public Task Messages_Search(InputPeer peer, string text = null, int offset_id = 0, int limit = int.MaxValue) where T : MessagesFilter, new() => this.Messages_Search(peer, text, new T(), offset_id: offset_id, limit: limit); + /// Search messages globally with filter and text See + /// See for a list of possible filter types + /// Text search request + /// Only return messages starting from the specified message ID + /// Number of results to return + public Task Messages_SearchGlobal(string text = null, int offset_id = 0, int limit = int.MaxValue) where T : MessagesFilter, new() + => this.Messages_SearchGlobal(text, new T(), offset_id: offset_id, limit: limit); + /// Helper function to send a media message more easily /// Destination of message (chat group, channel, user chat, etc..) /// Caption for the media (in plain text) or diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index 924911e..1417301 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -50,7 +50,7 @@ namespace TL { /// User identifier public long user_id; - /// REQUIRED FIELD. See how to obtain it
access_hash value from the constructor
+ /// REQUIRED FIELD. See how to obtain it
access_hash value from the
public long access_hash; } /// Defines a channel for further interaction. See @@ -59,7 +59,7 @@ namespace TL { /// Channel identifier public long channel_id; - /// REQUIRED FIELD. See how to obtain it
access_hash value from the constructor
+ /// REQUIRED FIELD. See how to obtain it
access_hash value from the
public long access_hash; } ///
Defines a min user that was seen in a certain message of a certain chat. See @@ -97,7 +97,7 @@ namespace TL { /// User identifier public long user_id; - /// REQUIRED FIELD. See how to obtain it
access_hash value from the constructor
+ /// REQUIRED FIELD. See how to obtain it
access_hash value from the
public long access_hash; } ///
Defines a min user that was seen in a certain message of a certain chat. See @@ -501,7 +501,7 @@ namespace TL { /// Photo identifier public long id; - /// REQUIRED FIELD. See how to obtain it
access_hash value from the constructor
+ /// REQUIRED FIELD. See how to obtain it
access_hash value from the
public long access_hash; ///
File reference public byte[] file_reference; @@ -537,7 +537,7 @@ namespace TL { /// Document ID public long id; - /// REQUIRED FIELD. See how to obtain it
access_hash parameter from the constructor
+ /// REQUIRED FIELD. See how to obtain it
access_hash parameter from the
public long access_hash; /// File reference public byte[] file_reference; @@ -3099,9 +3099,9 @@ namespace TL { /// User identifier public long user_id; - /// New first name. Corresponds to the new value of real_first_name field of the constructor. + /// New first name. Corresponds to the new value of real_first_name field of the . public string first_name; - /// New last name. Corresponds to the new value of real_last_name field of the constructor. + /// New last name. Corresponds to the new value of real_last_name field of the . public string last_name; /// New username.
Parameter added in Layer 18.
public string username; @@ -5086,7 +5086,7 @@ namespace TL { /// Document ID public long id; - /// REQUIRED FIELD. See how to obtain it
access_hash parameter from the constructor
+ /// REQUIRED FIELD. See how to obtain it
access_hash parameter from the
public long access_hash; /// File reference public byte[] file_reference; @@ -6394,7 +6394,7 @@ namespace TL /// Identifier of the user that was mentioned public long user_id; } - /// Message entity that can be used to create a user user mention: received mentions use the constructor, instead. See + /// Message entity that can be used to create a user user mention: received mentions use the , instead. See [TLDef(0x208E68C9, inheritBefore = true)] public class InputMessageEntityMentionName : MessageEntity { @@ -6436,7 +6436,7 @@ namespace TL { /// Channel ID public long channel_id; - /// REQUIRED FIELD. See how to obtain it
Access hash taken from the constructor
+ /// REQUIRED FIELD. See how to obtain it
Access hash taken from the
public long access_hash; /// Channel ID @@ -8266,7 +8266,7 @@ namespace TL [TLDef(0x804361EA)] public class PageBlockAudio : PageBlock { - /// Audio ID (to be fetched from the container constructor + /// Audio ID (to be fetched from the container public long audio_id; /// Audio caption public PageCaption caption; @@ -12581,7 +12581,7 @@ namespace TL public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats); } - ///
Information about found messages sent on a specific day, used to split the messages in constructors by days. See + /// Information about found messages sent on a specific day, used to split the messages in s by days. See [TLDef(0xC9B0539F)] public class SearchResultsCalendarPeriod : IObject { diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index 6e3ffeb..7e6b6a8 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -961,7 +961,7 @@ namespace TL }); /// Change authorization settings See Possible codes: 400 (details) - /// Session ID from the constructor, fetchable using account.getAuthorizations + /// Session ID from the , fetchable using account.getAuthorizations /// Whether to enable or disable receiving encrypted chats: if the flag is not set, the previous setting is not changed /// Whether to enable or disable receiving calls: if the flag is not set, the previous setting is not changed public static Task Account_ChangeAuthorizationSettings(this Client client, long hash, bool? encrypted_requests_disabled = default, bool? call_requests_disabled = default) @@ -1274,7 +1274,7 @@ namespace TL }); /// Gets back found messages See Possible codes: 400 (details) - /// User or chat, histories with which are searched, or constructor for global search + /// User or chat, histories with which are searched, or for global search /// Text search request /// Only return messages sent by the specified user ID /// Thread ID @@ -1287,7 +1287,7 @@ namespace TL /// Maximum message ID to return /// Minimum message ID to return /// Hash - public static Task Messages_Search(this Client client, InputPeer peer, string q, MessagesFilter filter, DateTime min_date = default, DateTime max_date = default, int offset_id = default, int add_offset = default, int limit = int.MaxValue, int max_id = default, int min_id = default, long hash = default, InputPeer from_id = null, int? top_msg_id = null) + public static Task Messages_Search(this Client client, InputPeer peer, string q, MessagesFilter filter = null, DateTime min_date = default, DateTime max_date = default, int offset_id = default, int add_offset = default, int limit = int.MaxValue, int max_id = default, int min_id = default, long hash = default, InputPeer from_id = null, int? top_msg_id = null) => client.Invoke(new Messages_Search { flags = (Messages_Search.Flags)((from_id != null ? 0x1 : 0) | (top_msg_id != null ? 0x2 : 0)), @@ -1826,7 +1826,7 @@ namespace TL /// Offsets for pagination, for more info click here /// Offsets for pagination, for more info click here /// Offsets for pagination, for more info click here - public static Task Messages_SearchGlobal(this Client client, string q, MessagesFilter filter, DateTime min_date = default, DateTime max_date = default, int offset_rate = default, InputPeer offset_peer = null, int offset_id = default, int limit = int.MaxValue, int? folder_id = null) + public static Task Messages_SearchGlobal(this Client client, string q, MessagesFilter filter = null, DateTime min_date = default, DateTime max_date = default, int offset_rate = default, InputPeer offset_peer = null, int offset_id = default, int limit = int.MaxValue, int? folder_id = null) => client.Invoke(new Messages_SearchGlobal { flags = (Messages_SearchGlobal.Flags)(folder_id != null ? 0x1 : 0), @@ -2936,7 +2936,7 @@ namespace TL /// Message filter, , filters are not supported by this method. /// Offsets for pagination, for more info click here /// Offsets for pagination, for more info click here - public static Task Messages_GetSearchResultsCalendar(this Client client, InputPeer peer, MessagesFilter filter, int offset_id = default, DateTime offset_date = default) + public static Task Messages_GetSearchResultsCalendar(this Client client, InputPeer peer, MessagesFilter filter = null, int offset_id = default, DateTime offset_date = default) => client.Invoke(new Messages_GetSearchResultsCalendar { peer = peer, @@ -2950,7 +2950,7 @@ namespace TL /// Message filter, , filters are not supported by this method. /// Offsets for pagination, for more info click here /// Maximum number of results to return, see pagination - public static Task Messages_GetSearchResultsPositions(this Client client, InputPeer peer, MessagesFilter filter, int offset_id = default, int limit = int.MaxValue) + public static Task Messages_GetSearchResultsPositions(this Client client, InputPeer peer, MessagesFilter filter = null, int offset_id = default, int limit = int.MaxValue) => client.Invoke(new Messages_GetSearchResultsPositions { peer = peer, @@ -3118,7 +3118,7 @@ namespace TL /// Optional search query /// Message filter /// Maximum number of results to return (max 100). - public static Task Messages_SearchSentMedia(this Client client, string q, MessagesFilter filter, int limit = int.MaxValue) + public static Task Messages_SearchSentMedia(this Client client, string q, MessagesFilter filter = null, int limit = int.MaxValue) => client.Invoke(new Messages_SearchSentMedia { q = q, @@ -3429,7 +3429,7 @@ namespace TL { }); - /// Get changelog of current app.
Typically, an constructor will be returned, containing one or more updates with app-specific changelogs. See
+ /// Get changelog of current app.
Typically, an will be returned, containing one or more updates with app-specific changelogs. See
/// Previous app version public static Task Help_GetAppChangelog(this Client client, string prev_app_version) => client.Invoke(new Help_GetAppChangelog @@ -4708,7 +4708,7 @@ namespace TL }); /// Load channel statistics graph asynchronously See Possible codes: 400 (details) - /// Graph token from constructor + /// Graph token from /// Zoom value, if required public static Task Stats_LoadAsyncGraph(this Client client, string token, long? x = null) => client.Invoke(new Stats_LoadAsyncGraph