From 7616625ac3e4d4acee474a1fa9bf82c82821331d Mon Sep 17 00:00:00 2001 From: Wizou Date: Sun, 31 Oct 2021 03:55:03 +0100 Subject: [PATCH] Upgrade to layer 134 --- .github/dev.yml | 2 +- README.md | 1 + src/Generator.cs | 13 ++- src/TL.Schema.cs | 288 ++++++++++++++++++++++++++++++++--------------- src/TL.Table.cs | 34 +++--- 5 files changed, 228 insertions(+), 110 deletions(-) diff --git a/.github/dev.yml b/.github/dev.yml index 2f0e0a4..3bc260a 100644 --- a/.github/dev.yml +++ b/.github/dev.yml @@ -2,7 +2,7 @@ pr: none trigger: - master -name: 1.6.1-dev.$(Rev:r) +name: 1.6.2-dev.$(Rev:r) pool: vmImage: ubuntu-latest diff --git a/README.md b/README.md index 17d519f..f861167 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build Status](https://img.shields.io/azure-devops/build/wiz0u/WTelegramClient/7)](https://dev.azure.com/wiz0u/WTelegramClient/_build?definitionId=7) [![API Layer](https://img.shields.io/badge/API_Layer-133-blueviolet)](https://corefork.telegram.org/methods) [![Support Chat](https://img.shields.io/badge/Chat_with_us-on_Telegram-0088cc)](https://t.me/WTelegramClient) +[![Donate](https://img.shields.io/badge/Help_this_project:-Donate-ff4444)](http://wizou.fr/donate.html) # WTelegramClient ### _Telegram Client API library written 100% in C# and .NET Standard_ diff --git a/src/Generator.cs b/src/Generator.cs index 2c7bde8..49207d9 100644 --- a/src/Generator.cs +++ b/src/Generator.cs @@ -627,8 +627,10 @@ namespace WTelegram } else { - sw.Write($"{MapOptionalType(parm.type[(qm + 1)..], parm.name)} {parmName} = null"); - flagExpr += $" | ({parmName} != null ? 0x{1 << bit:X} : 0)"; + var parmType = parm.type[(qm + 1)..]; + var nullValue = enumTypes.Contains(parmType) ? "default" : "null"; + sw.Write($"{MapOptionalType(parmType, parm.name)} {parmName} = {nullValue}"); + flagExpr += $" | ({parmName} != {nullValue} ? 0x{1 << bit:X} : 0)"; } } if (flagExpr != null) flagExpr = flagExpr.IndexOf('|', 3) >= 0 ? flagExpr[3..] : flagExpr[4..^1]; @@ -647,7 +649,8 @@ namespace WTelegram if (parmType.EndsWith("?true")) continue; int qm = parmType.IndexOf('?'); parmType = parmType[(qm + 1)..]; - sw.WriteLine($"{tabIndent}\tif ({parmName} != null)"); + var nullValue = enumTypes.Contains(parmType) ? "default" : "null"; + sw.WriteLine($"{tabIndent}\tif ({parmName} != {nullValue})"); sw.Write('\t'); if (MapOptionalType(parmType, parm.name).EndsWith("?")) parmName += ".Value"; @@ -710,8 +713,8 @@ namespace WTelegram string line; while ((line = sr.ReadLine()) != null) { - if (currentLayer != 0 && line.StartsWith("\t\tpublic const int Layer")) - sw.WriteLine($"\t\tpublic const int Layer = {currentLayer};\t\t\t\t\t// fetched {DateTime.UtcNow}"); + if (currentLayer != 0 && line.StartsWith("\t\tpublic const int Version")) + sw.WriteLine($"\t\tpublic const int Version = {currentLayer};\t\t\t\t\t// fetched {DateTime.UtcNow}"); else sw.WriteLine(line); if (line == myTag) diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index c2b5aa4..5f46265 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -587,12 +587,12 @@ namespace TL public abstract int Folder { get; } } ///See - [TLDef(0x4DBDC099)] + [TLDef(0x46A6FFB4)] public partial class ChatFull : ChatFullBase { [Flags] public enum Flags { has_chat_photo = 0x4, has_bot_info = 0x8, has_pinned_msg_id = 0x40, can_set_username = 0x80, has_scheduled = 0x100, has_folder_id = 0x800, has_call = 0x1000, has_exported_invite = 0x2000, has_ttl_period = 0x4000, - has_groupcall_default_join_as = 0x8000, has_theme_emoticon = 0x10000 } + has_groupcall_default_join_as = 0x8000, has_theme_emoticon = 0x10000, has_requests_pending = 0x20000 } public Flags flags; public long id; public string about; @@ -607,6 +607,8 @@ namespace TL [IfFlag(14)] public int ttl_period; [IfFlag(15)] public Peer groupcall_default_join_as; [IfFlag(16)] public string theme_emoticon; + [IfFlag(17)] public int requests_pending; + [IfFlag(17)] public long[] recent_requesters; public override long ID => id; public override string About => about; @@ -614,7 +616,7 @@ namespace TL public override int Folder => folder_id; } ///See - [TLDef(0xE9B27A17)] + [TLDef(0x59CFF963)] public partial class ChannelFull : ChatFullBase { [Flags] public enum Flags { has_participants_count = 0x1, has_admins_count = 0x2, has_kicked_count = 0x4, @@ -624,7 +626,7 @@ namespace TL can_set_location = 0x10000, has_slowmode_seconds = 0x20000, has_slowmode_next_send_date = 0x40000, has_scheduled = 0x80000, can_view_stats = 0x100000, has_call = 0x200000, blocked = 0x400000, has_exported_invite = 0x800000, has_ttl_period = 0x1000000, has_pending_suggestions = 0x2000000, has_groupcall_default_join_as = 0x4000000, - has_theme_emoticon = 0x8000000 } + has_theme_emoticon = 0x8000000, has_requests_pending = 0x10000000 } public Flags flags; public long id; public string about; @@ -657,6 +659,8 @@ namespace TL [IfFlag(25)] public string[] pending_suggestions; [IfFlag(26)] public Peer groupcall_default_join_as; [IfFlag(27)] public string theme_emoticon; + [IfFlag(28)] public int requests_pending; + [IfFlag(28)] public long[] recent_requesters; public override long ID => id; public override string About => about; @@ -1055,6 +1059,9 @@ namespace TL ///See [TLDef(0xAA786345)] public partial class MessageActionSetChatTheme : MessageAction { public string emoticon; } + ///See + [TLDef(0xEBBCA3CB)] + public partial class MessageActionChatJoinedByRequest : MessageAction { } ///See public abstract partial class DialogBase : ITLObject @@ -2249,6 +2256,25 @@ namespace TL public long bot_id; public BotCommand[] commands; } + ///See + [TLDef(0x7063C3DB)] + public partial class UpdatePendingJoinRequests : Update + { + public Peer peer; + public int requests_pending; + public long[] recent_requesters; + } + ///See + [TLDef(0x11DFA986)] + public partial class UpdateBotChatInviteRequester : Update + { + public Peer peer; + public DateTime date; + public long user_id; + public string about; + public ExportedChatInvite invite; + public int qts; + } ///See [TLDef(0xA56C2A3E)] @@ -2858,10 +2884,11 @@ namespace TL [TLDef(0xB05AC6B1)] public partial class SendMessageChooseStickerAction : SendMessageAction { } ///See - [TLDef(0x6A3233B6)] + [TLDef(0x25972BCB)] public partial class SendMessageEmojiInteraction : SendMessageAction { public string emoticon; + public int msg_id; public DataJSON interaction; } ///See @@ -3215,11 +3242,11 @@ namespace TL ///See public abstract partial class ExportedChatInvite : ITLObject { } ///See - [TLDef(0xB18105E8)] + [TLDef(0x0AB4A819)] public partial class ChatInviteExported : ExportedChatInvite { [Flags] public enum Flags { revoked = 0x1, has_expire_date = 0x2, has_usage_limit = 0x4, has_usage = 0x8, - has_start_date = 0x10, permanent = 0x20 } + has_start_date = 0x10, permanent = 0x20, request_needed = 0x40, has_requested = 0x80, has_title = 0x100 } public Flags flags; public string link; public long admin_id; @@ -3228,6 +3255,8 @@ namespace TL [IfFlag(1)] public DateTime expire_date; [IfFlag(2)] public int usage_limit; [IfFlag(3)] public int usage; + [IfFlag(7)] public int requested; + [IfFlag(8)] public string title; } ///See @@ -3236,12 +3265,14 @@ namespace TL [TLDef(0x5A686D7C)] public partial class ChatInviteAlready : ChatInviteBase { public ChatBase chat; } ///See - [TLDef(0xDFC2F58E)] + [TLDef(0x300C44C1)] public partial class ChatInvite : ChatInviteBase { - [Flags] public enum Flags { channel = 0x1, broadcast = 0x2, public_ = 0x4, megagroup = 0x8, has_participants = 0x10 } + [Flags] public enum Flags { channel = 0x1, broadcast = 0x2, public_ = 0x4, megagroup = 0x8, has_participants = 0x10, + has_about = 0x20, request_needed = 0x40 } public Flags flags; public string title; + [IfFlag(5)] public string about; public PhotoBase photo; public int participants_count; [IfFlag(4)] public UserBase[] participants; @@ -3273,6 +3304,9 @@ namespace TL ///See [TLDef(0xE67F520E)] public partial class InputStickerSetDice : InputStickerSet { public string emoticon; } + ///See + [TLDef(0x0CDE3739)] + public partial class InputStickerSetAnimatedEmojiAnimations : InputStickerSet { } ///See [TLDef(0xD7DF217A)] @@ -3620,9 +3654,11 @@ namespace TL public DateTime date; } ///See - [TLDef(0x28A8BC67)] + [TLDef(0x35A8BFA7)] public partial class ChannelParticipantSelf : ChannelParticipantBase { + [Flags] public enum Flags { via_invite = 0x1 } + public Flags flags; public long user_id; public long inviter_id; public DateTime date; @@ -5280,12 +5316,12 @@ namespace TL public int prev_value; public int new_value; } - ///See - [TLDef(0xFE69018D)] - public partial class ChannelAdminLogEventActionChangeTheme : ChannelAdminLogEventAction + ///See + [TLDef(0xAFB6144A)] + public partial class ChannelAdminLogEventActionParticipantJoinByRequest : ChannelAdminLogEventAction { - public string prev_value; - public string new_value; + public ExportedChatInvite invite; + public long approved_by; } ///See @@ -6236,18 +6272,19 @@ namespace TL public partial class InputThemeSlug : InputThemeBase { public string slug; } ///See - [TLDef(0xE802B8DC)] + [TLDef(0xA00E67D6)] public partial class Theme : ITLObject { [Flags] public enum Flags { creator = 0x1, default_ = 0x2, has_document = 0x4, has_settings = 0x8, has_installs_count = 0x10, - for_chat = 0x20 } + for_chat = 0x20, has_emoticon = 0x40 } public Flags flags; public long id; public long access_hash; public string slug; public string title; [IfFlag(2)] public DocumentBase document; - [IfFlag(3)] public ThemeSettings settings; + [IfFlag(3)] public ThemeSettings[] settings; + [IfFlag(6)] public string emoticon; [IfFlag(4)] public int installs_count; } @@ -6845,11 +6882,15 @@ namespace TL } ///See - [TLDef(0x0B5CD5F4)] + [TLDef(0x8C5ADFD9)] public partial class ChatInviteImporter : ITLObject { + [Flags] public enum Flags { requested = 0x1, has_approved_by = 0x2, has_about = 0x4 } + public Flags flags; public long user_id; public DateTime date; + [IfFlag(2)] public string about; + [IfFlag(1)] public long approved_by; } ///See @@ -6992,32 +7033,15 @@ namespace TL [TLDef(0xE926D63E)] public partial class Account_ResetPasswordOk : Account_ResetPasswordResult { } - ///See - [TLDef(0xED0B5C33)] - public partial class ChatTheme : ITLObject - { - public string emoticon; - public Theme theme; - public Theme dark_theme; - } - - ///See - ///a null value means account.chatThemesNotModified - [TLDef(0xFE4CBEBD)] - public partial class Account_ChatThemes : ITLObject - { - public int hash; - public ChatTheme[] themes; - } - ///See - [TLDef(0x2A3C381F)] + [TLDef(0xD151E19A)] public partial class SponsoredMessage : ITLObject { - [Flags] public enum Flags { has_start_param = 0x1, has_entities = 0x2 } + [Flags] public enum Flags { has_start_param = 0x1, has_entities = 0x2, has_channel_post = 0x4 } public Flags flags; public byte[] random_id; public Peer from_id; + [IfFlag(2)] public int channel_post; [IfFlag(0)] public string start_param; public string message; [IfFlag(1)] public MessageEntity[] entities; @@ -7033,6 +7057,52 @@ namespace TL public IPeerInfo UserOrChat(Peer peer) => peer.UserOrChat(users, chats); } + ///See + [TLDef(0xC9B0539F)] + public partial class SearchResultsCalendarPeriod : ITLObject + { + public DateTime date; + public int min_msg_id; + public int max_msg_id; + public int count; + } + + ///See + [TLDef(0x147EE23C)] + public partial class Messages_SearchResultsCalendar : ITLObject + { + [Flags] public enum Flags { inexact = 0x1, has_offset_id_offset = 0x2 } + public Flags flags; + public int count; + public DateTime min_date; + public int min_msg_id; + [IfFlag(1)] public int offset_id_offset; + public SearchResultsCalendarPeriod[] periods; + public MessageBase[] messages; + public Dictionary chats; + public Dictionary users; + public IPeerInfo UserOrChat(Peer peer) => peer.UserOrChat(users, chats); + } + + ///See + public abstract partial class SearchResultsPosition : ITLObject { } + ///See + [TLDef(0x7F648B67)] + public partial class SearchResultPosition : SearchResultsPosition + { + public int msg_id; + public DateTime date; + public int offset; + } + + ///See + [TLDef(0x53B22BAF)] + public partial class Messages_SearchResultsPositions : ITLObject + { + public int count; + public SearchResultsPosition[] positions; + } + // ---functions--- public static class Schema @@ -7850,25 +7920,25 @@ namespace TL }); ///See - public static Task Account_CreateTheme(this Client client, string slug, string title, InputDocument document = null, InputThemeSettings settings = null) + public static Task Account_CreateTheme(this Client client, string slug, string title, InputDocument document = null, InputThemeSettings[] settings = null) => client.CallAsync(writer => { - writer.Write(0x8432C21F); + writer.Write(0x652E4400); writer.Write((document != null ? 0x4 : 0) | (settings != null ? 0x8 : 0)); writer.WriteTLString(slug); writer.WriteTLString(title); if (document != null) writer.WriteTLObject(document); if (settings != null) - writer.WriteTLObject(settings); + writer.WriteTLVector(settings); return "Account_CreateTheme"; }); ///See - public static Task Account_UpdateTheme(this Client client, string format, InputThemeBase theme, string slug = null, string title = null, InputDocument document = null, InputThemeSettings settings = null) + public static Task Account_UpdateTheme(this Client client, string format, InputThemeBase theme, string slug = null, string title = null, InputDocument document = null, InputThemeSettings[] settings = null) => client.CallAsync(writer => { - writer.Write(0x5CB367D5); + writer.Write(0x2BF40CCC); writer.Write((slug != null ? 0x1 : 0) | (title != null ? 0x2 : 0) | (document != null ? 0x4 : 0) | (settings != null ? 0x8 : 0)); writer.WriteTLString(format); writer.WriteTLObject(theme); @@ -7879,7 +7949,7 @@ namespace TL if (document != null) writer.WriteTLObject(document); if (settings != null) - writer.WriteTLObject(settings); + writer.WriteTLVector(settings); return "Account_UpdateTheme"; }); @@ -7894,15 +7964,17 @@ namespace TL }); ///See - public static Task Account_InstallTheme(this Client client, bool dark = false, string format = null, InputThemeBase theme = null) + public static Task Account_InstallTheme(this Client client, bool dark = false, InputThemeBase theme = null, string format = null, BaseTheme base_theme = default) => client.CallAsync(writer => { - writer.Write(0x7AE43737); - writer.Write((dark ? 0x1 : 0) | (format != null ? 0x2 : 0) | (theme != null ? 0x2 : 0)); - if (format != null) - writer.WriteTLString(format); + writer.Write(0xC727BB3B); + writer.Write((dark ? 0x1 : 0) | (theme != null ? 0x2 : 0) | (format != null ? 0x4 : 0) | (base_theme != default ? 0x8 : 0)); if (theme != null) writer.WriteTLObject(theme); + if (format != null) + writer.WriteTLString(format); + if (base_theme != default) + writer.Write((uint)base_theme); return "Account_InstallTheme"; }); @@ -7999,10 +8071,10 @@ namespace TL }); ///See - public static Task Account_GetChatThemes(this Client client, int hash) - => client.CallAsync(writer => + public static Task Account_GetChatThemes(this Client client, long hash) + => client.CallAsync(writer => { - writer.Write(0xD6D71D7B); + writer.Write(0xD638DE89); writer.Write(hash); return "Account_GetChatThemes"; }); @@ -8302,13 +8374,17 @@ namespace TL }); ///See - public static Task Messages_DeleteHistory(this Client client, InputPeer peer, int max_id, bool just_clear = false, bool revoke = false) + public static Task Messages_DeleteHistory(this Client client, InputPeer peer, int max_id, bool just_clear = false, bool revoke = false, DateTime? min_date = null, DateTime? max_date = null) => client.CallAsync(writer => { - writer.Write(0x1C015B09); - writer.Write((just_clear ? 0x1 : 0) | (revoke ? 0x2 : 0)); + writer.Write(0xB08F922A); + writer.Write((just_clear ? 0x1 : 0) | (revoke ? 0x2 : 0) | (min_date != null ? 0x4 : 0) | (max_date != null ? 0x8 : 0)); writer.WriteTLObject(peer); writer.Write(max_id); + if (min_date != null) + writer.WriteTLStamp(min_date.Value); + if (max_date != null) + writer.WriteTLStamp(max_date.Value); return "Messages_DeleteHistory"; }); @@ -8657,16 +8733,18 @@ namespace TL }); ///See - public static Task Messages_ExportChatInvite(this Client client, InputPeer peer, bool legacy_revoke_permanent = false, DateTime? expire_date = null, int? usage_limit = null) + public static Task Messages_ExportChatInvite(this Client client, InputPeer peer, bool legacy_revoke_permanent = false, bool request_needed = false, DateTime? expire_date = null, int? usage_limit = null, string title = null) => client.CallAsync(writer => { - writer.Write(0x14B9BCD7); - writer.Write((legacy_revoke_permanent ? 0x4 : 0) | (expire_date != null ? 0x1 : 0) | (usage_limit != null ? 0x2 : 0)); + writer.Write(0xA02CE5D5); + writer.Write((legacy_revoke_permanent ? 0x4 : 0) | (request_needed ? 0x8 : 0) | (expire_date != null ? 0x1 : 0) | (usage_limit != null ? 0x2 : 0) | (title != null ? 0x10 : 0)); writer.WriteTLObject(peer); if (expire_date != null) writer.WriteTLStamp(expire_date.Value); if (usage_limit != null) writer.Write(usage_limit.Value); + if (title != null) + writer.WriteTLString(title); return "Messages_ExportChatInvite"; }); @@ -9371,17 +9449,6 @@ namespace TL return "Messages_GetOnlines"; }); - ///See - public static Task Messages_GetStatsURL(this Client client, InputPeer peer, string params_, bool dark = false) - => client.CallAsync(writer => - { - writer.Write(0x812C2AE6); - writer.Write(dark ? 0x1 : 0); - writer.WriteTLObject(peer); - writer.WriteTLString(params_); - return "Messages_GetStatsURL"; - }); - ///See public static Task Messages_EditChatAbout(this Client client, InputPeer peer, string about) => client.CallAsync(writer => @@ -9740,17 +9807,21 @@ namespace TL }); ///See - public static Task Messages_EditExportedChatInvite(this Client client, InputPeer peer, string link, bool revoked = false, DateTime? expire_date = null, int? usage_limit = null) + public static Task Messages_EditExportedChatInvite(this Client client, InputPeer peer, string link, bool revoked = false, DateTime? expire_date = null, int? usage_limit = null, bool? request_needed = default, string title = null) => client.CallAsync(writer => { - writer.Write(0x02E4FFBE); - writer.Write((revoked ? 0x4 : 0) | (expire_date != null ? 0x1 : 0) | (usage_limit != null ? 0x2 : 0)); + writer.Write(0xBDCA2F75); + writer.Write((revoked ? 0x4 : 0) | (expire_date != null ? 0x1 : 0) | (usage_limit != null ? 0x2 : 0) | (request_needed != default ? 0x8 : 0) | (title != null ? 0x10 : 0)); writer.WriteTLObject(peer); writer.WriteTLString(link); if (expire_date != null) writer.WriteTLStamp(expire_date.Value); if (usage_limit != null) writer.Write(usage_limit.Value); + if (request_needed != default) + writer.Write(request_needed.Value ? 0x997275B5 : 0xBC799737); + if (title != null) + writer.WriteTLString(title); return "Messages_EditExportedChatInvite"; }); @@ -9784,12 +9855,16 @@ namespace TL }); ///See - public static Task Messages_GetChatInviteImporters(this Client client, InputPeer peer, string link, DateTime offset_date, InputUserBase offset_user, int limit) + public static Task Messages_GetChatInviteImporters(this Client client, InputPeer peer, DateTime offset_date, InputUserBase offset_user, int limit, bool requested = false, string link = null, string q = null) => client.CallAsync(writer => { - writer.Write(0x26FB7289); + writer.Write(0xDF04DD4E); + writer.Write((requested ? 0x1 : 0) | (link != null ? 0x2 : 0) | (q != null ? 0x4 : 0)); writer.WriteTLObject(peer); - writer.WriteTLString(link); + if (link != null) + writer.WriteTLString(link); + if (q != null) + writer.WriteTLString(q); writer.WriteTLStamp(offset_date); writer.WriteTLObject(offset_user); writer.Write(limit); @@ -9835,6 +9910,41 @@ namespace TL return "Messages_GetMessageReadParticipants"; }); + ///See + public static Task Messages_GetSearchResultsCalendar(this Client client, InputPeer peer, MessagesFilter filter, int offset_id, DateTime offset_date) + => client.CallAsync(writer => + { + writer.Write(0x49F0BDE9); + writer.WriteTLObject(peer); + writer.WriteTLObject(filter); + writer.Write(offset_id); + writer.WriteTLStamp(offset_date); + return "Messages_GetSearchResultsCalendar"; + }); + + ///See + public static Task Messages_GetSearchResultsPositions(this Client client, InputPeer peer, MessagesFilter filter, int offset_id, int limit) + => client.CallAsync(writer => + { + writer.Write(0x6E9583A3); + writer.WriteTLObject(peer); + writer.WriteTLObject(filter); + writer.Write(offset_id); + writer.Write(limit); + return "Messages_GetSearchResultsPositions"; + }); + + ///See + public static Task Messages_HideChatJoinRequest(this Client client, InputPeer peer, InputUserBase user_id, bool approved = false) + => client.CallAsync(writer => + { + writer.Write(0x7FE7E815); + writer.Write(approved ? 0x1 : 0); + writer.WriteTLObject(peer); + writer.WriteTLObject(user_id); + return "Messages_HideChatJoinRequest"; + }); + ///See public static Task Updates_GetState(this Client client) => client.CallAsync(writer => @@ -10948,13 +11058,13 @@ namespace TL }); ///See - public static Task Phone_ToggleGroupCallSettings(this Client client, InputGroupCall call, bool reset_invite_hash = false, bool? join_muted = null) + public static Task Phone_ToggleGroupCallSettings(this Client client, InputGroupCall call, bool reset_invite_hash = false, bool? join_muted = default) => client.CallAsync(writer => { writer.Write(0x74BBB43D); - writer.Write((reset_invite_hash ? 0x2 : 0) | (join_muted != null ? 0x1 : 0)); + writer.Write((reset_invite_hash ? 0x2 : 0) | (join_muted != default ? 0x1 : 0)); writer.WriteTLObject(call); - if (join_muted != null) + if (join_muted != default) writer.Write(join_muted.Value ? 0x997275B5 : 0xBC799737); return "Phone_ToggleGroupCallSettings"; }); @@ -10993,38 +11103,38 @@ namespace TL }); ///See - public static Task Phone_ToggleGroupCallRecord(this Client client, InputGroupCall call, bool start = false, bool video = false, string title = null, bool? video_portrait = null) + public static Task Phone_ToggleGroupCallRecord(this Client client, InputGroupCall call, bool start = false, bool video = false, string title = null, bool? video_portrait = default) => client.CallAsync(writer => { writer.Write(0xF128C708); - writer.Write((start ? 0x1 : 0) | (video ? 0x4 : 0) | (title != null ? 0x2 : 0) | (video_portrait != null ? 0x4 : 0)); + writer.Write((start ? 0x1 : 0) | (video ? 0x4 : 0) | (title != null ? 0x2 : 0) | (video_portrait != default ? 0x4 : 0)); writer.WriteTLObject(call); if (title != null) writer.WriteTLString(title); - if (video_portrait != null) + if (video_portrait != default) writer.Write(video_portrait.Value ? 0x997275B5 : 0xBC799737); return "Phone_ToggleGroupCallRecord"; }); ///See - public static Task Phone_EditGroupCallParticipant(this Client client, InputGroupCall call, InputPeer participant, bool? muted = null, int? volume = null, bool? raise_hand = null, bool? video_stopped = null, bool? video_paused = null, bool? presentation_paused = null) + public static Task Phone_EditGroupCallParticipant(this Client client, InputGroupCall call, InputPeer participant, bool? muted = default, int? volume = null, bool? raise_hand = default, bool? video_stopped = default, bool? video_paused = default, bool? presentation_paused = default) => client.CallAsync(writer => { writer.Write(0xA5273ABF); - writer.Write((muted != null ? 0x1 : 0) | (volume != null ? 0x2 : 0) | (raise_hand != null ? 0x4 : 0) | (video_stopped != null ? 0x8 : 0) | (video_paused != null ? 0x10 : 0) | (presentation_paused != null ? 0x20 : 0)); + writer.Write((muted != default ? 0x1 : 0) | (volume != null ? 0x2 : 0) | (raise_hand != default ? 0x4 : 0) | (video_stopped != default ? 0x8 : 0) | (video_paused != default ? 0x10 : 0) | (presentation_paused != default ? 0x20 : 0)); writer.WriteTLObject(call); writer.WriteTLObject(participant); - if (muted != null) + if (muted != default) writer.Write(muted.Value ? 0x997275B5 : 0xBC799737); if (volume != null) writer.Write(volume.Value); - if (raise_hand != null) + if (raise_hand != default) writer.Write(raise_hand.Value ? 0x997275B5 : 0xBC799737); - if (video_stopped != null) + if (video_stopped != default) writer.Write(video_stopped.Value ? 0x997275B5 : 0xBC799737); - if (video_paused != null) + if (video_paused != default) writer.Write(video_paused.Value ? 0x997275B5 : 0xBC799737); - if (presentation_paused != null) + if (presentation_paused != default) writer.Write(presentation_paused.Value ? 0x997275B5 : 0xBC799737); return "Phone_EditGroupCallParticipant"; }); diff --git a/src/TL.Table.cs b/src/TL.Table.cs index 2bfd892..127554e 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 = 133; // fetched 17/09/2021 02:47:02 + public const int Version = 134; // fetched 31/10/2021 02:19:13 internal const uint VectorCtor = 0x1CB5C415; internal const uint NullCtor = 0x56730BCC; internal const uint RpcResultCtor = 0xF35C6D01; @@ -127,8 +127,8 @@ namespace TL [0x6592A1A7] = typeof(ChatForbidden), [0x8261AC61] = typeof(Channel), [0x17D493D5] = typeof(ChannelForbidden), - [0x4DBDC099] = typeof(ChatFull), - [0xE9B27A17] = typeof(ChannelFull), + [0x46A6FFB4] = typeof(ChatFull), + [0x59CFF963] = typeof(ChannelFull), [0xC02D4007] = typeof(ChatParticipant), [0xE46BCEE4] = typeof(ChatParticipantCreator), [0xA0933F5B] = typeof(ChatParticipantAdmin), @@ -181,6 +181,7 @@ namespace TL [0xAA1AFBFD] = typeof(MessageActionSetMessagesTTL), [0xB3A07661] = typeof(MessageActionGroupCallScheduled), [0xAA786345] = typeof(MessageActionSetChatTheme), + [0xEBBCA3CB] = typeof(MessageActionChatJoinedByRequest), [0x2C171F72] = typeof(Dialog), [0x71BD134C] = typeof(DialogFolder), [0x2331B22D] = typeof(PhotoEmpty), @@ -336,6 +337,8 @@ namespace TL [0xC4870A49] = typeof(UpdateBotStopped), [0x0B783982] = typeof(UpdateGroupCallConnection), [0x4D712F2E] = typeof(UpdateBotCommands), + [0x7063C3DB] = typeof(UpdatePendingJoinRequests), + [0x11DFA986] = typeof(UpdateBotChatInviteRequester), [0xA56C2A3E] = typeof(Updates_State), [0x5D75A138] = typeof(Updates_DifferenceEmpty), [0x00F49CA0] = typeof(Updates_Difference), @@ -402,7 +405,7 @@ namespace TL [0xD92C2285] = typeof(SpeakingInGroupCallAction), [0xDBDA9246] = typeof(SendMessageHistoryImportAction), [0xB05AC6B1] = typeof(SendMessageChooseStickerAction), - [0x6A3233B6] = typeof(SendMessageEmojiInteraction), + [0x25972BCB] = typeof(SendMessageEmojiInteraction), [0xB665902E] = typeof(SendMessageEmojiInteractionSeen), [0xB3134D9D] = typeof(Contacts_Found), [0x0D09E07B] = typeof(InputPrivacyValueAllowContacts), @@ -447,15 +450,16 @@ namespace TL [0xC23727C9] = typeof(Account_PasswordInputSettings), [0x137948A5] = typeof(Auth_PasswordRecovery), [0xA384B779] = typeof(ReceivedNotifyMessage), - [0xB18105E8] = typeof(ChatInviteExported), + [0x0AB4A819] = typeof(ChatInviteExported), [0x5A686D7C] = typeof(ChatInviteAlready), - [0xDFC2F58E] = typeof(ChatInvite), + [0x300C44C1] = typeof(ChatInvite), [0x61695CB0] = typeof(ChatInvitePeek), [0xFFB62B95] = null,//InputStickerSetEmpty [0x9DE7A269] = typeof(InputStickerSetID), [0x861CC8A0] = typeof(InputStickerSetShortName), [0x028703C8] = typeof(InputStickerSetAnimatedEmoji), [0xE67F520E] = typeof(InputStickerSetDice), + [0x0CDE3739] = typeof(InputStickerSetAnimatedEmojiAnimations), [0xD7DF217A] = typeof(StickerSet), [0xB60A24A6] = typeof(Messages_StickerSet), [0xC27AC8C7] = typeof(BotCommand), @@ -506,7 +510,7 @@ namespace TL [0x94D42EE7] = null,//ChannelMessagesFilterEmpty [0xCD77D957] = typeof(ChannelMessagesFilter), [0xC00C07C0] = typeof(ChannelParticipant), - [0x28A8BC67] = typeof(ChannelParticipantSelf), + [0x35A8BFA7] = typeof(ChannelParticipantSelf), [0x2FE601D3] = typeof(ChannelParticipantCreator), [0x34C3BB53] = typeof(ChannelParticipantAdmin), [0x6DF8014E] = typeof(ChannelParticipantBanned), @@ -704,7 +708,7 @@ namespace TL [0xE90EBB59] = typeof(ChannelAdminLogEventActionExportedInviteEdit), [0x3E7F6847] = typeof(ChannelAdminLogEventActionParticipantVolume), [0x6E941A38] = typeof(ChannelAdminLogEventActionChangeHistoryTTL), - [0xFE69018D] = typeof(ChannelAdminLogEventActionChangeTheme), + [0xAFB6144A] = typeof(ChannelAdminLogEventActionParticipantJoinByRequest), [0x1FAD68CD] = typeof(ChannelAdminLogEvent), [0xED8AF74D] = typeof(Channels_AdminLogResults), [0xEA107AE4] = typeof(ChannelAdminLogEventsFilter), @@ -828,7 +832,7 @@ namespace TL [0xD072ACB4] = typeof(RestrictionReason), [0x3C5693E9] = typeof(InputTheme), [0xF5890DF1] = typeof(InputThemeSlug), - [0xE802B8DC] = typeof(Theme), + [0xA00E67D6] = typeof(Theme), [0xF41EB622] = null,//Account_ThemesNotModified [0x9A3D8C6D] = typeof(Account_Themes), [0x629F1980] = typeof(Auth_LoginToken), @@ -883,7 +887,7 @@ namespace TL [0x1662AF0B] = typeof(Messages_HistoryImport), [0x5E0FB7B9] = typeof(Messages_HistoryImportParsed), [0xEF8D3E6C] = typeof(Messages_AffectedFoundMessages), - [0x0B5CD5F4] = typeof(ChatInviteImporter), + [0x8C5ADFD9] = typeof(ChatInviteImporter), [0xBDC62DCC] = typeof(Messages_ExportedChatInvites), [0x1871BE50] = typeof(Messages_ExportedChatInvite), [0x222600EF] = typeof(Messages_ExportedChatInviteReplaced), @@ -906,11 +910,12 @@ namespace TL [0xE3779861] = typeof(Account_ResetPasswordFailedWait), [0xE9EFFC7D] = typeof(Account_ResetPasswordRequestedWait), [0xE926D63E] = typeof(Account_ResetPasswordOk), - [0xED0B5C33] = typeof(ChatTheme), - [0xE011E1C4] = null,//Account_ChatThemesNotModified - [0xFE4CBEBD] = typeof(Account_ChatThemes), - [0x2A3C381F] = typeof(SponsoredMessage), + [0xD151E19A] = typeof(SponsoredMessage), [0x65A4C7D5] = typeof(Messages_SponsoredMessages), + [0xC9B0539F] = typeof(SearchResultsCalendarPeriod), + [0x147EE23C] = typeof(Messages_SearchResultsCalendar), + [0x7F648B67] = typeof(SearchResultPosition), + [0x53B22BAF] = typeof(Messages_SearchResultsPositions), // from TL.Secret: [0xBB718624] = typeof(Layer66.SendMessageUploadRoundAction), [0xE50511D8] = typeof(Layer45.DecryptedMessageMediaWebPage), @@ -1010,7 +1015,6 @@ namespace TL [typeof(ChannelLocation)] = 0xBFB5AD8B, //channelLocationEmpty [typeof(Account_Themes)] = 0xF41EB622, //account.themesNotModified [typeof(Help_CountriesList)] = 0x93CC1F32, //help.countriesListNotModified - [typeof(Account_ChatThemes)] = 0xE011E1C4, //account.chatThemesNotModified // from TL.Secret: [typeof(DecryptedMessageMedia)] = 0x089F5C4A, //decryptedMessageMediaEmpty // The End