diff --git a/README.md b/README.md index 453c103..155f37f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![API Layer](https://img.shields.io/badge/API_Layer-174-blueviolet)](https://corefork.telegram.org/methods) +[![API Layer](https://img.shields.io/badge/API_Layer-176-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 855998b..60f58b6 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -1670,7 +1670,7 @@ namespace TL public override Peer Peer => peer_id; } /// A message See - [TLDef(0x1E4C8A69)] + [TLDef(0xA66C7EFC)] public partial class Message : MessageBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -1718,6 +1718,7 @@ namespace TL [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; + [IfFlag(30)] public int quick_reply_shortcut_id; [Flags] public enum Flags : uint { @@ -1777,6 +1778,8 @@ namespace TL has_saved_peer_id = 0x10000000, /// Field has a value has_from_boosts_applied = 0x20000000, + /// Field has a value + has_quick_reply_shortcut_id = 0x40000000, } /// ID of the message @@ -3195,11 +3198,12 @@ namespace TL } /// Extended user info See - [TLDef(0xB9B12C6C)] + [TLDef(0x22FF3E85)] public class UserFull : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; + public Flags2 flags2; /// User ID public long id; /// Bio of the user @@ -3238,6 +3242,10 @@ namespace TL [IfFlag(24)] public WallPaperBase wallpaper; /// Active stories » [IfFlag(25)] public PeerStories stories; + [IfFlag(32)] public BusinessWorkHours business_work_hours; + [IfFlag(33)] public BusinessLocation business_location; + [IfFlag(34)] public BusinessGreetingMessage business_greeting_message; + [IfFlag(35)] public BusinessAwayMessage business_away_message; [Flags] public enum Flags : uint { @@ -3296,6 +3304,18 @@ namespace TL contact_require_premium = 0x20000000, read_dates_private = 0x40000000, } + + [Flags] public enum Flags2 : uint + { + /// Field has a value + has_business_work_hours = 0x1, + /// Field has a value + has_business_location = 0x2, + /// Field has a value + has_business_greeting_message = 0x4, + /// Field has a value + has_business_away_message = 0x8, + } } /// A contact of the current user that is registered in the system. See @@ -5145,6 +5165,42 @@ namespace TL /// See [TLDef(0x39C67432)] public class UpdateSavedReactionTags : Update { } + /// See + [TLDef(0xF16269D4)] + public class UpdateSmsJob : Update + { + public string job_id; + } + /// See + [TLDef(0xF9470AB2)] + public class UpdateQuickReplies : Update + { + public QuickReply[] quick_replies; + } + /// See + [TLDef(0xF53DA717)] + public class UpdateNewQuickReply : Update + { + public QuickReply quick_reply; + } + /// See + [TLDef(0x53E6F1EC)] + public class UpdateDeleteQuickReply : Update + { + public int shortcut_id; + } + /// See + [TLDef(0x3E050D0F)] + public class UpdateQuickReplyMessage : Update + { + public MessageBase message; + } + /// See + [TLDef(0x566FE7CD, inheritBefore = true)] + public class UpdateDeleteQuickReplyMessages : UpdateDeleteQuickReply + { + public int[] messages; + } /// Updates state. See [TLDef(0xA56C2A3E)] @@ -13043,13 +13099,14 @@ namespace TL public virtual string Title => default; /// Emoji to use as icon for the folder. public virtual string Emoticon => default; + public virtual int Color => default; /// Pinned chats, folders can have unlimited pinned chats public virtual InputPeer[] PinnedPeers => default; /// Include the following chats in this folder public virtual InputPeer[] IncludePeers => default; } /// Dialog filter AKA folder See - [TLDef(0x7438F7E8)] + [TLDef(0x5FB5523B)] public class DialogFilter : DialogFilterBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -13060,6 +13117,7 @@ namespace TL public string title; /// Emoji to use as icon for the folder. [IfFlag(25)] public string emoticon; + [IfFlag(27)] public int color; /// Pinned chats, folders can have unlimited pinned chats public InputPeer[] pinned_peers; /// Include the following chats in this folder @@ -13087,6 +13145,8 @@ namespace TL exclude_archived = 0x2000, /// Field has a value has_emoticon = 0x2000000, + /// Field has a value + has_color = 0x8000000, } /// Folder ID @@ -13095,13 +13155,14 @@ namespace TL public override string Title => title; /// Emoji to use as icon for the folder. public override string Emoticon => emoticon; + public override int Color => color; /// Pinned chats, folders can have unlimited pinned chats public override InputPeer[] PinnedPeers => pinned_peers; /// Include the following chats in this folder public override InputPeer[] IncludePeers => include_peers; } /// A folder imported using a chat folder deep link ». See - [TLDef(0xD64A04A8)] + [TLDef(0x9FE28EA4)] public class DialogFilterChatlist : DialogFilterBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -13112,6 +13173,7 @@ namespace TL public string title; /// Emoji to use as icon for the folder. [IfFlag(25)] public string emoticon; + [IfFlag(27)] public int color; /// Pinned chats, folders can have unlimited pinned chats public InputPeer[] pinned_peers; /// Chats to include in the folder @@ -13123,6 +13185,8 @@ namespace TL has_emoticon = 0x2000000, /// Whether the current user has created some chat folder deep links » to share the folder as well. has_my_invites = 0x4000000, + /// Field has a value + has_color = 0x8000000, } /// ID of the folder @@ -13131,6 +13195,7 @@ namespace TL public override string Title => title; /// Emoji to use as icon for the folder. public override string Emoticon => emoticon; + public override int Color => color; /// Pinned chats, folders can have unlimited pinned chats public override InputPeer[] PinnedPeers => pinned_peers; /// Chats to include in the folder @@ -16988,4 +17053,270 @@ namespace TL { public DateTime date; } + + /// See + public abstract class Smsjobs_EligibilityToJoin : IObject { } + /// See + [TLDef(0xDC8B44CF)] + public class Smsjobs_EligibleToJoin : Smsjobs_EligibilityToJoin + { + public string terms_url; + public int monthly_sent_sms; + } + + /// See + [TLDef(0x2AEE9191)] + public class Smsjobs_Status : IObject + { + public Flags flags; + public int recent_sent; + public int recent_since; + public int recent_remains; + public int total_sent; + public int total_since; + [IfFlag(1)] public string last_gift_slug; + public string terms_url; + + [Flags] public enum Flags : uint + { + allow_international = 0x1, + has_last_gift_slug = 0x2, + } + } + + /// See + [TLDef(0xE6A1EEB8)] + public class SmsJob : IObject + { + public string job_id; + public string phone_number; + public string text; + } + + /// See + [TLDef(0x120B1AB9)] + public class BusinessWeeklyOpen : IObject + { + public int start_minute; + public int end_minute; + } + + /// See + [TLDef(0x8C92B098)] + public class BusinessWorkHours : IObject + { + public Flags flags; + public string timezone_id; + public BusinessWeeklyOpen[] weekly_open; + + [Flags] public enum Flags : uint + { + open_now = 0x1, + } + } + + /// See + [TLDef(0xAC5C1AF7)] + public class BusinessLocation : IObject + { + public Flags flags; + [IfFlag(0)] public GeoPoint geo_point; + public string address; + + [Flags] public enum Flags : uint + { + has_geo_point = 0x1, + } + } + + /// See + [TLDef(0x6F8B32AA)] + public class InputBusinessRecipients : IObject + { + public Flags flags; + [IfFlag(4)] public InputUserBase[] users; + + [Flags] public enum Flags : uint + { + existing_chats = 0x1, + new_chats = 0x2, + contacts = 0x4, + non_contacts = 0x8, + has_users = 0x10, + exclude_selected = 0x20, + } + } + + /// See + [TLDef(0x21108FF7)] + public class BusinessRecipients : IObject + { + public Flags flags; + [IfFlag(4)] public long[] users; + + [Flags] public enum Flags : uint + { + existing_chats = 0x1, + new_chats = 0x2, + contacts = 0x4, + non_contacts = 0x8, + has_users = 0x10, + exclude_selected = 0x20, + } + } + + /// See + public abstract class BusinessAwayMessageSchedule : IObject { } + /// See + [TLDef(0xC9B9E2B9)] + public class BusinessAwayMessageScheduleAlways : BusinessAwayMessageSchedule { } + /// See + [TLDef(0xC3F2F501)] + public class BusinessAwayMessageScheduleOutsideWorkHours : BusinessAwayMessageSchedule { } + /// See + [TLDef(0xCC4D9ECC)] + public class BusinessAwayMessageScheduleCustom : BusinessAwayMessageSchedule + { + public DateTime start_date; + public DateTime end_date; + } + + /// See + [TLDef(0x0194CB3B)] + public class InputBusinessGreetingMessage : IObject + { + public int shortcut_id; + public InputBusinessRecipients recipients; + public int no_activity_days; + } + + /// See + [TLDef(0xE519ABAB)] + public class BusinessGreetingMessage : IObject + { + public int shortcut_id; + public BusinessRecipients recipients; + public int no_activity_days; + } + + /// See + [TLDef(0x832175E0)] + public class InputBusinessAwayMessage : IObject + { + public Flags flags; + public int shortcut_id; + public BusinessAwayMessageSchedule schedule; + public InputBusinessRecipients recipients; + + [Flags] public enum Flags : uint + { + offline_only = 0x1, + } + } + + /// See + [TLDef(0xEF156A5C)] + public class BusinessAwayMessage : IObject + { + public Flags flags; + public int shortcut_id; + public BusinessAwayMessageSchedule schedule; + public BusinessRecipients recipients; + + [Flags] public enum Flags : uint + { + offline_only = 0x1, + } + } + + /// See + [TLDef(0xFF9289F5)] + public class Timezone : IObject + { + public string id; + public string name; + public int utc_offset; + } + + /// See + /// a value means help.timezonesListNotModified + [TLDef(0x7B74ED71)] + public class Help_TimezonesList : IObject + { + public Timezone[] timezones; + public int hash; + } + + /// See + [TLDef(0x0697102B)] + public class QuickReply : IObject + { + public int shortcut_id; + public string shortcut; + public int top_message; + public int count; + } + + /// See + public abstract class InputQuickReplyShortcutBase : IObject { } + /// See + [TLDef(0x24596D41)] + public class InputQuickReplyShortcut : InputQuickReplyShortcutBase + { + public string shortcut; + } + /// See + [TLDef(0x01190CF1)] + public class InputQuickReplyShortcutId : InputQuickReplyShortcutBase + { + public int shortcut_id; + } + + /// See + /// a value means messages.quickRepliesNotModified + [TLDef(0xC68D6695)] + public class Messages_QuickReplies : IObject, IPeerResolver + { + public QuickReply[] quick_replies; + public MessageBase[] messages; + public Dictionary chats; + public Dictionary users; + /// returns a or for the given Peer + public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats); + } + + /// See + [TLDef(0xE7E999E7)] + public class ConnectedBot : IObject + { + public Flags flags; + public long bot_id; + public BusinessRecipients recipients; + + [Flags] public enum Flags : uint + { + can_reply = 0x1, + } + } + + /// See + [TLDef(0x17D7F87B)] + public class Account_ConnectedBots : IObject + { + public ConnectedBot[] connected_bots; + public Dictionary users; + } + + /// See + [TLDef(0x2AD93719)] + public class Messages_DialogFilters : IObject + { + public Flags flags; + public DialogFilterBase[] filters; + + [Flags] public enum Flags : uint + { + tags_enabled = 0x1, + } + } } diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index dbbc531..ad0376d 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -1194,6 +1194,54 @@ namespace TL hash = hash, }); + /// See + public static Task Account_UpdateBusinessWorkHours(this Client client, BusinessWorkHours business_work_hours = null) + => client.Invoke(new Account_UpdateBusinessWorkHours + { + flags = (Account_UpdateBusinessWorkHours.Flags)(business_work_hours != null ? 0x1 : 0), + business_work_hours = business_work_hours, + }); + + /// See + public static Task Account_UpdateBusinessLocation(this Client client, string address = null, InputGeoPoint geo_point = null) + => client.Invoke(new Account_UpdateBusinessLocation + { + flags = (Account_UpdateBusinessLocation.Flags)((address != null ? 0x1 : 0) | (geo_point != null ? 0x2 : 0)), + geo_point = geo_point, + address = address, + }); + + /// See + public static Task Account_UpdateBusinessGreetingMessage(this Client client, InputBusinessGreetingMessage message = null) + => client.Invoke(new Account_UpdateBusinessGreetingMessage + { + flags = (Account_UpdateBusinessGreetingMessage.Flags)(message != null ? 0x1 : 0), + message = message, + }); + + /// See + public static Task Account_UpdateBusinessAwayMessage(this Client client, InputBusinessAwayMessage message = null) + => client.Invoke(new Account_UpdateBusinessAwayMessage + { + flags = (Account_UpdateBusinessAwayMessage.Flags)(message != null ? 0x1 : 0), + message = message, + }); + + /// See + public static Task Account_UpdateConnectedBot(this Client client, InputUserBase bot, InputBusinessRecipients recipients, bool can_reply = false, bool deleted = false) + => client.Invoke(new Account_UpdateConnectedBot + { + flags = (Account_UpdateConnectedBot.Flags)((can_reply ? 0x1 : 0) | (deleted ? 0x2 : 0)), + bot = bot, + recipients = recipients, + }); + + /// See + public static Task Account_GetConnectedBots(this Client client) + => client.Invoke(new Account_GetConnectedBots + { + }); + /// Returns basic user info according to their identifiers. See [bots: ✓] Possible codes: 400 (details) /// List of user identifiers public static Task Users_GetUsers(this Client client, params InputUserBase[] id) @@ -1626,10 +1674,10 @@ namespace TL /// Message entities for sending styled text /// Scheduled message date for scheduled messages /// Send this message as the specified peer - 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, 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) + 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, 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 { - flags = (Messages_SendMessage.Flags)((reply_to != null ? 0x1 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (no_webpage ? 0x2 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (noforwards ? 0x4000 : 0) | (update_stickersets_order ? 0x8000 : 0) | (invert_media ? 0x10000 : 0)), + flags = (Messages_SendMessage.Flags)((reply_to != null ? 0x1 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (quick_reply_shortcut != null ? 0x20000 : 0) | (no_webpage ? 0x2 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (noforwards ? 0x4000 : 0) | (update_stickersets_order ? 0x8000 : 0) | (invert_media ? 0x10000 : 0)), peer = peer, reply_to = reply_to, message = message, @@ -1638,6 +1686,7 @@ namespace TL entities = entities, schedule_date = schedule_date.GetValueOrDefault(), send_as = send_as, + quick_reply_shortcut = quick_reply_shortcut, }); /// Send a media See [bots: ✓] Possible codes: 400,403,406,420,500 (details) @@ -1656,10 +1705,10 @@ namespace TL /// Message entities for styled text /// Scheduled message date for scheduled messages /// Send this message as the specified peer - 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, bool silent = false, bool background = false, bool clear_draft = false, bool noforwards = false, bool update_stickersets_order = false, bool invert_media = false) + 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, 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 { - flags = (Messages_SendMedia.Flags)((reply_to != null ? 0x1 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (noforwards ? 0x4000 : 0) | (update_stickersets_order ? 0x8000 : 0) | (invert_media ? 0x10000 : 0)), + flags = (Messages_SendMedia.Flags)((reply_to != null ? 0x1 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (quick_reply_shortcut != null ? 0x20000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (noforwards ? 0x4000 : 0) | (update_stickersets_order ? 0x8000 : 0) | (invert_media ? 0x10000 : 0)), peer = peer, reply_to = reply_to, media = media, @@ -1669,6 +1718,7 @@ namespace TL entities = entities, schedule_date = schedule_date.GetValueOrDefault(), send_as = send_as, + quick_reply_shortcut = quick_reply_shortcut, }); /// Forwards messages by their IDs. See [bots: ✓] Possible codes: 400,403,406,420,500 (details) @@ -1685,10 +1735,10 @@ namespace TL /// Destination forum topic /// Scheduled message date for scheduled messages /// Forward the messages as the specified peer - 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, bool silent = false, bool background = false, bool with_my_score = false, bool drop_author = false, bool drop_media_captions = false, bool noforwards = false) + 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 { - flags = (Messages_ForwardMessages.Flags)((top_msg_id != null ? 0x200 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (with_my_score ? 0x100 : 0) | (drop_author ? 0x800 : 0) | (drop_media_captions ? 0x1000 : 0) | (noforwards ? 0x4000 : 0)), + flags = (Messages_ForwardMessages.Flags)((top_msg_id != null ? 0x200 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (quick_reply_shortcut != null ? 0x20000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (with_my_score ? 0x100 : 0) | (drop_author ? 0x800 : 0) | (drop_media_captions ? 0x1000 : 0) | (noforwards ? 0x4000 : 0)), from_peer = from_peer, id = id, random_id = random_id, @@ -1696,6 +1746,7 @@ namespace TL top_msg_id = top_msg_id.GetValueOrDefault(), schedule_date = schedule_date.GetValueOrDefault(), send_as = send_as, + quick_reply_shortcut = quick_reply_shortcut, }); /// Report a new incoming chat for spam, if the of the chat allow us to do that See Possible codes: 400 (details) @@ -2188,10 +2239,10 @@ namespace TL /// Result ID from Messages_GetInlineBotResults /// Scheduled message date for scheduled messages /// Send this message as the specified peer - 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, bool silent = false, bool background = false, bool clear_draft = false, bool hide_via = false) + 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 { - flags = (Messages_SendInlineBotResult.Flags)((reply_to != null ? 0x1 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (hide_via ? 0x800 : 0)), + flags = (Messages_SendInlineBotResult.Flags)((reply_to != null ? 0x1 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (quick_reply_shortcut != null ? 0x20000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (hide_via ? 0x800 : 0)), peer = peer, reply_to = reply_to, random_id = random_id, @@ -2199,6 +2250,7 @@ namespace TL id = id, schedule_date = schedule_date.GetValueOrDefault(), send_as = send_as, + quick_reply_shortcut = quick_reply_shortcut, }); /// Find out if a media message's caption can be edited See Possible codes: 400,403 (details) @@ -2221,10 +2273,10 @@ namespace TL /// Reply markup for inline keyboards /// Message entities for styled text /// Scheduled message date for scheduled messages - 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, bool no_webpage = false, bool invert_media = false) + 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 { - flags = (Messages_EditMessage.Flags)((message != null ? 0x800 : 0) | (media != null ? 0x4000 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x8000 : 0) | (no_webpage ? 0x2 : 0) | (invert_media ? 0x10000 : 0)), + flags = (Messages_EditMessage.Flags)((message != null ? 0x800 : 0) | (media != null ? 0x4000 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x8000 : 0) | (quick_reply_shortcut_id != null ? 0x20000 : 0) | (no_webpage ? 0x2 : 0) | (invert_media ? 0x10000 : 0)), peer = peer, id = id, message = message, @@ -2232,6 +2284,7 @@ namespace TL reply_markup = reply_markup, entities = entities, schedule_date = schedule_date.GetValueOrDefault(), + quick_reply_shortcut_id = quick_reply_shortcut_id.GetValueOrDefault(), }); /// Edit an inline bot message See [bots: ✓] Possible codes: 400 (details) @@ -2624,15 +2677,16 @@ namespace TL /// 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 - 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, bool silent = false, bool background = false, bool clear_draft = false, bool noforwards = false, bool update_stickersets_order = false, bool invert_media = false) + 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, 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 { - flags = (Messages_SendMultiMedia.Flags)((reply_to != null ? 0x1 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (noforwards ? 0x4000 : 0) | (update_stickersets_order ? 0x8000 : 0) | (invert_media ? 0x10000 : 0)), + flags = (Messages_SendMultiMedia.Flags)((reply_to != null ? 0x1 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (quick_reply_shortcut != null ? 0x20000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (noforwards ? 0x4000 : 0) | (update_stickersets_order ? 0x8000 : 0) | (invert_media ? 0x10000 : 0)), peer = peer, reply_to = reply_to, multi_media = multi_media, schedule_date = schedule_date.GetValueOrDefault(), send_as = send_as, + quick_reply_shortcut = quick_reply_shortcut, }); /// Upload encrypted file and associate it to a secret chat See @@ -2911,7 +2965,7 @@ namespace TL }); /// Get folders See - public static Task Messages_GetDialogFilters(this Client client) + public static Task Messages_GetDialogFilters(this Client client) => client.Invoke(new Messages_GetDialogFilters { }); @@ -3875,6 +3929,76 @@ namespace TL msg_id = msg_id, }); + /// See + /// a null value means messages.quickRepliesNotModified + public static Task Messages_GetQuickReplies(this Client client, long hash = default) + => client.Invoke(new Messages_GetQuickReplies + { + hash = hash, + }); + + /// See + public static Task Messages_ReorderQuickReplies(this Client client, params int[] order) + => client.Invoke(new Messages_ReorderQuickReplies + { + order = order, + }); + + /// See + public static Task Messages_CheckQuickReplyShortcut(this Client client, string shortcut) + => client.Invoke(new Messages_CheckQuickReplyShortcut + { + shortcut = shortcut, + }); + + /// See + public static Task Messages_EditQuickReplyShortcut(this Client client, int shortcut_id, string shortcut) + => client.Invoke(new Messages_EditQuickReplyShortcut + { + shortcut_id = shortcut_id, + shortcut = shortcut, + }); + + /// See + public static Task Messages_DeleteQuickReplyShortcut(this Client client, int shortcut_id) + => client.Invoke(new Messages_DeleteQuickReplyShortcut + { + 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
+ public static Task Messages_GetQuickReplyMessages(this Client client, int shortcut_id, long hash = default, int[] id = null) + => client.Invoke(new Messages_GetQuickReplyMessages + { + flags = (Messages_GetQuickReplyMessages.Flags)(id != null ? 0x1 : 0), + shortcut_id = shortcut_id, + id = id, + hash = hash, + }); + + /// See + public static Task Messages_SendQuickReplyMessages(this Client client, InputPeer peer, int shortcut_id) + => client.Invoke(new Messages_SendQuickReplyMessages + { + peer = peer, + 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
+ public static Task Messages_DeleteQuickReplyMessages(this Client client, int shortcut_id, params int[] id) + => client.Invoke(new Messages_DeleteQuickReplyMessages + { + shortcut_id = shortcut_id, + id = id, + }); + + /// See + public static Task Messages_ToggleDialogFilterTags(this Client client, bool enabled) + => client.Invoke(new Messages_ToggleDialogFilterTags + { + enabled = enabled, + }); + /// Returns a current state of updates. See [bots: ✓] public static Task Updates_GetState(this Client client) => client.Invoke(new Updates_GetState @@ -4275,6 +4399,14 @@ namespace TL hash = hash, }); + /// See + /// a null value means help.timezonesListNotModified + public static Task Help_GetTimezonesList(this Client client, int hash = default) + => client.Invoke(new Help_GetTimezonesList + { + hash = hash, + }); + /// Mark channel/supergroup history as read See Possible codes: 400,406 (details) /// Channel/supergroup /// ID of message up to which messages should be marked as read @@ -6328,6 +6460,53 @@ namespace TL peer = peer, user_id = user_id, }); + + /// See + public static Task Smsjobs_IsEligibleToJoin(this Client client) + => client.Invoke(new Smsjobs_IsEligibleToJoin + { + }); + + /// See + public static Task Smsjobs_Join(this Client client) + => client.Invoke(new Smsjobs_Join + { + }); + + /// See + public static Task Smsjobs_Leave(this Client client) + => client.Invoke(new Smsjobs_Leave + { + }); + + /// See + 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 + public static Task Smsjobs_GetStatus(this Client client) + => client.Invoke(new Smsjobs_GetStatus + { + }); + + /// See + public static Task Smsjobs_GetSmsJob(this Client client, string job_id) + => client.Invoke(new Smsjobs_GetSmsJob + { + job_id = job_id, + }); + + /// See + public static Task Smsjobs_FinishJob(this Client client, string job_id, string error = null) + => client.Invoke(new Smsjobs_FinishJob + { + flags = (Smsjobs_FinishJob.Flags)(error != null ? 0x1 : 0), + job_id = job_id, + error = error, + }); } } @@ -7250,6 +7429,73 @@ namespace TL.Methods public long hash; } + [TLDef(0x4B00E066)] + public class Account_UpdateBusinessWorkHours : IMethod + { + public Flags flags; + [IfFlag(0)] public BusinessWorkHours business_work_hours; + + [Flags] public enum Flags : uint + { + has_business_work_hours = 0x1, + } + } + + [TLDef(0x9E6B131A)] + public class Account_UpdateBusinessLocation : IMethod + { + public Flags flags; + [IfFlag(1)] public InputGeoPoint geo_point; + [IfFlag(0)] public string address; + + [Flags] public enum Flags : uint + { + has_address = 0x1, + has_geo_point = 0x2, + } + } + + [TLDef(0x66CDAFC4)] + public class Account_UpdateBusinessGreetingMessage : IMethod + { + public Flags flags; + [IfFlag(0)] public InputBusinessGreetingMessage message; + + [Flags] public enum Flags : uint + { + has_message = 0x1, + } + } + + [TLDef(0xA26A7FA5)] + public class Account_UpdateBusinessAwayMessage : IMethod + { + public Flags flags; + [IfFlag(0)] public InputBusinessAwayMessage message; + + [Flags] public enum Flags : uint + { + has_message = 0x1, + } + } + + [TLDef(0x9C2D527D)] + public class Account_UpdateConnectedBot : IMethod + { + public Flags flags; + public InputUserBase bot; + public InputBusinessRecipients recipients; + + [Flags] public enum Flags : uint + { + can_reply = 0x1, + deleted = 0x2, + } + } + + [TLDef(0x4EA4C80F)] + public class Account_GetConnectedBots : IMethod { } + [TLDef(0x0D91A548)] public class Users_GetUsers : IMethod { @@ -7604,7 +7850,7 @@ namespace TL.Methods } } - [TLDef(0x280D096F)] + [TLDef(0xDFF8042C)] public class Messages_SendMessage : IMethod { public Flags flags; @@ -7616,6 +7862,7 @@ namespace TL.Methods [IfFlag(3)] public MessageEntity[] entities; [IfFlag(10)] public DateTime schedule_date; [IfFlag(13)] public InputPeer send_as; + [IfFlag(17)] public InputQuickReplyShortcutBase quick_reply_shortcut; [Flags] public enum Flags : uint { @@ -7631,10 +7878,11 @@ namespace TL.Methods noforwards = 0x4000, update_stickersets_order = 0x8000, invert_media = 0x10000, + has_quick_reply_shortcut = 0x20000, } } - [TLDef(0x72CCC23D)] + [TLDef(0x7BD66041)] public class Messages_SendMedia : IMethod { public Flags flags; @@ -7647,6 +7895,7 @@ namespace TL.Methods [IfFlag(3)] public MessageEntity[] entities; [IfFlag(10)] public DateTime schedule_date; [IfFlag(13)] public InputPeer send_as; + [IfFlag(17)] public InputQuickReplyShortcutBase quick_reply_shortcut; [Flags] public enum Flags : uint { @@ -7661,10 +7910,11 @@ namespace TL.Methods noforwards = 0x4000, update_stickersets_order = 0x8000, invert_media = 0x10000, + has_quick_reply_shortcut = 0x20000, } } - [TLDef(0xC661BBC4)] + [TLDef(0xD5039208)] public class Messages_ForwardMessages : IMethod { public Flags flags; @@ -7675,6 +7925,7 @@ namespace TL.Methods [IfFlag(9)] public int top_msg_id; [IfFlag(10)] public DateTime schedule_date; [IfFlag(13)] public InputPeer send_as; + [IfFlag(17)] public InputQuickReplyShortcutBase quick_reply_shortcut; [Flags] public enum Flags : uint { @@ -7687,6 +7938,7 @@ namespace TL.Methods drop_media_captions = 0x1000, has_send_as = 0x2000, noforwards = 0x4000, + has_quick_reply_shortcut = 0x20000, } } @@ -8075,7 +8327,7 @@ namespace TL.Methods } } - [TLDef(0xF7BC68BA)] + [TLDef(0x3EBEE86A)] public class Messages_SendInlineBotResult : IMethod { public Flags flags; @@ -8086,6 +8338,7 @@ namespace TL.Methods public string id; [IfFlag(10)] public DateTime schedule_date; [IfFlag(13)] public InputPeer send_as; + [IfFlag(17)] public InputQuickReplyShortcutBase quick_reply_shortcut; [Flags] public enum Flags : uint { @@ -8096,6 +8349,7 @@ namespace TL.Methods has_schedule_date = 0x400, hide_via = 0x800, has_send_as = 0x2000, + has_quick_reply_shortcut = 0x20000, } } @@ -8106,7 +8360,7 @@ namespace TL.Methods public int id; } - [TLDef(0x48F71778)] + [TLDef(0xDFD14005)] public class Messages_EditMessage : IMethod { public Flags flags; @@ -8117,6 +8371,7 @@ namespace TL.Methods [IfFlag(2)] public ReplyMarkup reply_markup; [IfFlag(3)] public MessageEntity[] entities; [IfFlag(15)] public DateTime schedule_date; + [IfFlag(17)] public int quick_reply_shortcut_id; [Flags] public enum Flags : uint { @@ -8127,6 +8382,7 @@ namespace TL.Methods has_media = 0x4000, has_schedule_date = 0x8000, invert_media = 0x10000, + has_quick_reply_shortcut_id = 0x20000, } } @@ -8476,7 +8732,7 @@ namespace TL.Methods public long hash; } - [TLDef(0x456E8987)] + [TLDef(0x0C964709)] public class Messages_SendMultiMedia : IMethod { public Flags flags; @@ -8485,6 +8741,7 @@ namespace TL.Methods public InputSingleMedia[] multi_media; [IfFlag(10)] public DateTime schedule_date; [IfFlag(13)] public InputPeer send_as; + [IfFlag(17)] public InputQuickReplyShortcutBase quick_reply_shortcut; [Flags] public enum Flags : uint { @@ -8497,6 +8754,7 @@ namespace TL.Methods noforwards = 0x4000, update_stickersets_order = 0x8000, invert_media = 0x10000, + has_quick_reply_shortcut = 0x20000, } } @@ -8730,8 +8988,8 @@ namespace TL.Methods } } - [TLDef(0xF19ED96D)] - public class Messages_GetDialogFilters : IMethod { } + [TLDef(0xEFD48C89)] + public class Messages_GetDialogFilters : IMethod { } [TLDef(0xA29CD42C)] public class Messages_GetSuggestedDialogFilters : IMethod { } @@ -9543,6 +9801,71 @@ namespace TL.Methods public int msg_id; } + [TLDef(0xD483F2A8)] + public class Messages_GetQuickReplies : IMethod + { + public long hash; + } + + [TLDef(0x60331907)] + public class Messages_ReorderQuickReplies : IMethod + { + public int[] order; + } + + [TLDef(0xF1D0FBD3)] + public class Messages_CheckQuickReplyShortcut : IMethod + { + public string shortcut; + } + + [TLDef(0x5C003CEF)] + public class Messages_EditQuickReplyShortcut : IMethod + { + public int shortcut_id; + public string shortcut; + } + + [TLDef(0x3CC04740)] + public class Messages_DeleteQuickReplyShortcut : IMethod + { + public int shortcut_id; + } + + [TLDef(0x94A495C3)] + public class Messages_GetQuickReplyMessages : IMethod + { + public Flags flags; + public int shortcut_id; + [IfFlag(0)] public int[] id; + public long hash; + + [Flags] public enum Flags : uint + { + has_id = 0x1, + } + } + + [TLDef(0x33153AD4)] + public class Messages_SendQuickReplyMessages : IMethod + { + public InputPeer peer; + public int shortcut_id; + } + + [TLDef(0xE105E910)] + public class Messages_DeleteQuickReplyMessages : IMethod + { + public int shortcut_id; + public int[] id; + } + + [TLDef(0xFD2DDA49)] + public class Messages_ToggleDialogFilterTags : IMethod + { + public bool enabled; + } + [TLDef(0xEDD4882A)] public class Updates_GetState : IMethod { } @@ -9842,6 +10165,12 @@ namespace TL.Methods public int hash; } + [TLDef(0x49B30240)] + public class Help_GetTimezonesList : IMethod + { + public int hash; + } + [TLDef(0xCC104937)] public class Channels_ReadHistory : IMethod { @@ -11507,4 +11836,46 @@ namespace TL.Methods public InputPeer peer; public InputUserBase user_id; } + + [TLDef(0x0EDC39D0)] + public class Smsjobs_IsEligibleToJoin : IMethod { } + + [TLDef(0xA74ECE2D)] + public class Smsjobs_Join : IMethod { } + + [TLDef(0x9898AD73)] + public class Smsjobs_Leave : IMethod { } + + [TLDef(0x093FA0BF)] + public class Smsjobs_UpdateSettings : IMethod + { + public Flags flags; + + [Flags] public enum Flags : uint + { + allow_international = 0x1, + } + } + + [TLDef(0x10A698E8)] + public class Smsjobs_GetStatus : IMethod { } + + [TLDef(0x778D902F)] + public class Smsjobs_GetSmsJob : IMethod + { + public string job_id; + } + + [TLDef(0x4F1EBF24)] + public class Smsjobs_FinishJob : IMethod + { + public Flags flags; + public string job_id; + [IfFlag(0)] public string error; + + [Flags] public enum Flags : uint + { + has_error = 0x1, + } + } } diff --git a/src/TL.Table.cs b/src/TL.Table.cs index 6f7bf7b..ed185a2 100644 --- a/src/TL.Table.cs +++ b/src/TL.Table.cs @@ -6,7 +6,7 @@ namespace TL { public static class Layer { - public const int Version = 174; // fetched 18/02/2024 15:53:49 + public const int Version = 176; // fetched 08/03/2024 11:12:00 internal const int SecretChats = 144; internal const int MTProto2 = 73; internal const uint VectorCtor = 0x1CB5C415; @@ -145,7 +145,7 @@ namespace TL [0x37C1011C] = null,//ChatPhotoEmpty [0x1C6E1C11] = typeof(ChatPhoto), [0x90A6CA84] = typeof(MessageEmpty), - [0x1E4C8A69] = typeof(Message), + [0xA66C7EFC] = typeof(Message), [0x2B085862] = typeof(MessageService), [0x3DED6320] = null,//MessageMediaEmpty [0x695150D7] = typeof(MessageMediaPhoto), @@ -232,7 +232,7 @@ namespace TL [0xA518110D] = typeof(PeerSettings), [0xA437C3ED] = typeof(WallPaper), [0xE0804116] = typeof(WallPaperNoFile), - [0xB9B12C6C] = typeof(UserFull), + [0x22FF3E85] = typeof(UserFull), [0x145ADE0B] = typeof(Contact), [0xC13E3C50] = typeof(ImportedContact), [0x16D9703B] = typeof(ContactStatus), @@ -394,6 +394,12 @@ namespace TL [0xAEAF9E74] = typeof(UpdateSavedDialogPinned), [0x686C85A6] = typeof(UpdatePinnedSavedDialogs), [0x39C67432] = typeof(UpdateSavedReactionTags), + [0xF16269D4] = typeof(UpdateSmsJob), + [0xF9470AB2] = typeof(UpdateQuickReplies), + [0xF53DA717] = typeof(UpdateNewQuickReply), + [0x53E6F1EC] = typeof(UpdateDeleteQuickReply), + [0x3E050D0F] = typeof(UpdateQuickReplyMessage), + [0x566FE7CD] = typeof(UpdateDeleteQuickReplyMessages), [0xA56C2A3E] = typeof(Updates_State), [0x5D75A138] = typeof(Updates_DifferenceEmpty), [0x00F49CA0] = typeof(Updates_Difference), @@ -945,9 +951,9 @@ namespace TL [0x4899484E] = typeof(Messages_VotesList), [0xF568028A] = typeof(BankCardOpenUrl), [0x3E24E573] = typeof(Payments_BankCardData), - [0x7438F7E8] = typeof(DialogFilter), + [0x5FB5523B] = typeof(DialogFilter), [0x363293AE] = null,//DialogFilterDefault - [0xD64A04A8] = typeof(DialogFilterChatlist), + [0x9FE28EA4] = typeof(DialogFilterChatlist), [0x77744D4A] = typeof(DialogFilterSuggested), [0xB637EDAF] = typeof(StatsDateRangeDays), [0xCB43ACDE] = typeof(StatsAbsValueAndPrev), @@ -1191,6 +1197,32 @@ namespace TL [0x889B59EF] = null,//Messages_SavedReactionTagsNotModified [0x3259950A] = typeof(Messages_SavedReactionTags), [0x3BB842AC] = typeof(OutboxReadDate), + [0xDC8B44CF] = typeof(Smsjobs_EligibleToJoin), + [0x2AEE9191] = typeof(Smsjobs_Status), + [0xE6A1EEB8] = typeof(SmsJob), + [0x120B1AB9] = typeof(BusinessWeeklyOpen), + [0x8C92B098] = typeof(BusinessWorkHours), + [0xAC5C1AF7] = typeof(BusinessLocation), + [0x6F8B32AA] = typeof(InputBusinessRecipients), + [0x21108FF7] = typeof(BusinessRecipients), + [0xC9B9E2B9] = typeof(BusinessAwayMessageScheduleAlways), + [0xC3F2F501] = typeof(BusinessAwayMessageScheduleOutsideWorkHours), + [0xCC4D9ECC] = typeof(BusinessAwayMessageScheduleCustom), + [0x0194CB3B] = typeof(InputBusinessGreetingMessage), + [0xE519ABAB] = typeof(BusinessGreetingMessage), + [0x832175E0] = typeof(InputBusinessAwayMessage), + [0xEF156A5C] = typeof(BusinessAwayMessage), + [0xFF9289F5] = typeof(Timezone), + [0x970708CC] = null,//Help_TimezonesListNotModified + [0x7B74ED71] = typeof(Help_TimezonesList), + [0x0697102B] = typeof(QuickReply), + [0x24596D41] = typeof(InputQuickReplyShortcut), + [0x01190CF1] = typeof(InputQuickReplyShortcutId), + [0xC68D6695] = typeof(Messages_QuickReplies), + [0x5F91EB5B] = null,//Messages_QuickRepliesNotModified + [0xE7E999E7] = typeof(ConnectedBot), + [0x17D7F87B] = typeof(Account_ConnectedBots), + [0x2AD93719] = typeof(Messages_DialogFilters), // from TL.Secret: [0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument), [0x91CC4674] = typeof(Layer73.DecryptedMessage), @@ -1315,6 +1347,8 @@ namespace TL [typeof(BotApp)] = 0x5DA674B7, //botAppNotModified [typeof(Help_PeerColors)] = 0x2BA1F5CE, //help.peerColorsNotModified [typeof(Messages_SavedReactionTags)] = 0x889B59EF, //messages.savedReactionTagsNotModified + [typeof(Help_TimezonesList)] = 0x970708CC, //help.timezonesListNotModified + [typeof(Messages_QuickReplies)] = 0x5F91EB5B, //messages.quickRepliesNotModified [typeof(DecryptedMessageMedia)] = 0x089F5C4A, //decryptedMessageMediaEmpty }; } diff --git a/src/WTelegramClient.csproj b/src/WTelegramClient.csproj index bead803..25acdfb 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: 174 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A")) + Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 176 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A")) Copyright © Olivier Marcoux 2021-2024 MIT https://github.com/wiz0u/WTelegramClient