XML comments: add URLs to API pages

This commit is contained in:
Wizou 2021-08-12 11:01:15 +02:00
parent 424e582446
commit 83c0991770
6 changed files with 2338 additions and 1259 deletions

2
ci.yml
View file

@ -2,7 +2,7 @@ pr: none
trigger: trigger:
- master - master
name: 0.7.1-alpha.$(Rev:r) name: 0.7.5-alpha.$(Rev:r)
pool: pool:
vmImage: ubuntu-latest vmImage: ubuntu-latest

View file

@ -19,16 +19,21 @@ namespace WTelegram
Dictionary<string, TypeInfo> typeInfos; Dictionary<string, TypeInfo> typeInfos;
int currentLayer; int currentLayer;
string tabIndent; string tabIndent;
private string currentJson;
public async Task FromWeb() public async Task FromWeb()
{ {
Console.WriteLine("Fetch web pages..."); Console.WriteLine("Fetch web pages...");
#if DEBUG
currentLayer = await Task.FromResult(0);
#else
using var http = new HttpClient(); using var http = new HttpClient();
var html = await http.GetStringAsync("https://core.telegram.org/api/layers"); var html = await http.GetStringAsync("https://core.telegram.org/api/layers");
currentLayer = int.Parse(Regex.Match(html, @"#layer-(\d+)").Groups[1].Value); currentLayer = int.Parse(Regex.Match(html, @"#layer-(\d+)").Groups[1].Value);
await File.WriteAllBytesAsync("TL.MTProto.json", await http.GetByteArrayAsync("https://core.telegram.org/schema/mtproto-json")); await File.WriteAllBytesAsync("TL.MTProto.json", await http.GetByteArrayAsync("https://core.telegram.org/schema/mtproto-json"));
await File.WriteAllBytesAsync("TL.Schema.json", await http.GetByteArrayAsync("https://core.telegram.org/schema/json")); await File.WriteAllBytesAsync("TL.Schema.json", await http.GetByteArrayAsync("https://core.telegram.org/schema/json"));
await File.WriteAllBytesAsync("TL.Secret.json", await http.GetByteArrayAsync("https://core.telegram.org/schema/end-to-end-json")); await File.WriteAllBytesAsync("TL.Secret.json", await http.GetByteArrayAsync("https://core.telegram.org/schema/end-to-end-json"));
#endif
FromJson("TL.MTProto.json", "TL.MTProto.cs", @"TL.Table.cs"); FromJson("TL.MTProto.json", "TL.MTProto.cs", @"TL.Table.cs");
FromJson("TL.Schema.json", "TL.Schema.cs", @"TL.Table.cs"); FromJson("TL.Schema.json", "TL.Schema.cs", @"TL.Table.cs");
FromJson("TL.Secret.json", "TL.Secret.cs", @"TL.Table.cs"); FromJson("TL.Secret.json", "TL.Secret.cs", @"TL.Table.cs");
@ -37,6 +42,7 @@ namespace WTelegram
public void FromJson(string jsonPath, string outputCs, string tableCs = null) public void FromJson(string jsonPath, string outputCs, string tableCs = null)
{ {
Console.WriteLine("Parsing " + jsonPath); Console.WriteLine("Parsing " + jsonPath);
currentJson = Path.GetFileNameWithoutExtension(jsonPath);
var schema = JsonSerializer.Deserialize<SchemaJson>(File.ReadAllText(jsonPath)); var schema = JsonSerializer.Deserialize<SchemaJson>(File.ReadAllText(jsonPath));
using var sw = File.CreateText(outputCs); using var sw = File.CreateText(outputCs);
sw.WriteLine("// This file is (mainly) generated automatically using the Generator class"); sw.WriteLine("// This file is (mainly) generated automatically using the Generator class");
@ -61,7 +67,7 @@ namespace WTelegram
foreach (var ctor in layer) foreach (var ctor in layer)
{ {
if (ctorToTypes.ContainsKey(ctor.ID)) continue; if (ctorToTypes.ContainsKey(ctor.ID)) continue;
if (ctor.type is "Bool" or "Vector t") continue; if (ctor.type == "Vector t") continue;
var structName = CSharpName(ctor.predicate); var structName = CSharpName(ctor.predicate);
ctorToTypes[ctor.ID] = layerPrefix + structName; ctorToTypes[ctor.ID] = layerPrefix + structName;
var typeInfo = typeInfos.GetOrCreate(ctor.type); var typeInfo = typeInfos.GetOrCreate(ctor.type);
@ -143,7 +149,7 @@ namespace WTelegram
} }
sw.WriteLine("}"); sw.WriteLine("}");
if (tableCs != null) UpdateTable(jsonPath, tableCs, methods); if (tableCs != null) UpdateTable(tableCs, methods);
} }
void WriteTypeInfo(StreamWriter sw, TypeInfo typeInfo, string layerPrefix, bool isMethod) void WriteTypeInfo(StreamWriter sw, TypeInfo typeInfo, string layerPrefix, bool isMethod)
@ -156,6 +162,8 @@ namespace WTelegram
{ {
needNewLine = false; needNewLine = false;
sw.WriteLine(); sw.WriteLine();
if (currentJson != "TL.MTProto")
sw.WriteLine($"{tabIndent}///<summary>See <a href=\"https://core.telegram.org/type/{typeInfo.Structs[0].type}\"/></summary>");
sw.WriteLine($"{tabIndent}public abstract partial class {parentClass} : ITLObject {{ }}"); sw.WriteLine($"{tabIndent}public abstract partial class {parentClass} : ITLObject {{ }}");
} }
int skipParams = 0; int skipParams = 0;
@ -167,13 +175,25 @@ namespace WTelegram
if (!allTypes.Add(layerPrefix + className)) continue; if (!allTypes.Add(layerPrefix + className)) continue;
if (needNewLine) { needNewLine = false; sw.WriteLine(); } if (needNewLine) { needNewLine = false; sw.WriteLine(); }
if (ctor.id == null) if (ctor.id == null)
{
if (currentJson != "TL.MTProto")
sw.WriteLine($"{tabIndent}///<summary>See <a href=\"https://core.telegram.org/type/{typeInfo.Structs[0].type}\"/></summary>");
sw.Write($"{tabIndent}public abstract partial class {className} : ITLObject"); sw.Write($"{tabIndent}public abstract partial class {className} : ITLObject");
}
else else
{ {
sw.Write($"{tabIndent}[TLDef(0x{ctor.ID:X8})] //{ctor.predicate}#{ctor.ID:x8} "); if (currentJson != "TL.MTProto")
if (genericType != null) sw.Write($"{{{typeInfo.ReturnName}:Type}} "); {
foreach (var parm in ctor.@params) sw.Write($"{parm.name}:{parm.type} "); sw.WriteLine($"{tabIndent}///<summary>See <a href=\"https://core.telegram.org/constructor/{ctor.predicate}\"/></summary>");
sw.WriteLine($"= {ctor.type}"); sw.WriteLine($"{tabIndent}[TLDef(0x{ctor.ID:X8})]");
}
else
{
sw.Write($"{tabIndent}[TLDef(0x{ctor.ID:X8})] //{ctor.predicate}#{ctor.ID:x8} ");
if (genericType != null) sw.Write($"{{{typeInfo.ReturnName}:Type}} ");
foreach (var parm in ctor.@params) sw.Write($"{parm.name}:{parm.type} ");
sw.WriteLine($"= {ctor.type}");
}
sw.Write($"{tabIndent}public partial class {className} : "); sw.Write($"{tabIndent}public partial class {className} : ");
sw.Write(skipParams == 0 && typeInfo.NeedAbstract > 0 ? "ITLObject" : parentClass); sw.Write(skipParams == 0 && typeInfo.NeedAbstract > 0 ? "ITLObject" : parentClass);
} }
@ -325,10 +345,16 @@ namespace WTelegram
if (style == -1) return; if (style == -1) return;
sw.WriteLine(); sw.WriteLine();
sw.Write($"{tabIndent}//{method.method}#{ctorNb:x8} "); if (method.type.Length == 1) funcName += $"<{returnType}>";
if (method.type.Length == 1) { sw.Write($"{{{method.type}:Type}} "); funcName += $"<{returnType}>"; } if (currentJson != "TL.MTProto")
foreach (var parm in method.@params) sw.Write($"{parm.name}:{parm.type} "); sw.WriteLine($"{tabIndent}///<summary>See <a href=\"https://core.telegram.org/method/{method.method}\"/></summary>");
sw.WriteLine($"= {method.type}"); else
{
sw.Write($"{tabIndent}//{method.method}#{ctorNb:x8} ");
if (method.type.Length == 1) sw.Write($"{{{method.type}:Type}} ");
foreach (var parm in method.@params) sw.Write($"{parm.name}:{parm.type} ");
sw.WriteLine($"= {method.type}");
}
if (style == 0) sw.WriteLine($"{tabIndent}public Task<{returnType}> {funcName}() => CallAsync<{returnType}>({funcName});"); if (style == 0) sw.WriteLine($"{tabIndent}public Task<{returnType}> {funcName}() => CallAsync<{returnType}>({funcName});");
if (style == 0) sw.Write($"{tabIndent}public static string {funcName}(BinaryWriter writer"); if (style == 0) sw.Write($"{tabIndent}public static string {funcName}(BinaryWriter writer");
@ -425,9 +451,9 @@ namespace WTelegram
if (style != 0) tabIndent = tabIndent[0..^1]; if (style != 0) tabIndent = tabIndent[0..^1];
} }
void UpdateTable(string jsonPath, string tableCs, List<TypeInfo> methods) void UpdateTable(string tableCs, List<TypeInfo> methods)
{ {
var myTag = $"\t\t\t// from {Path.GetFileNameWithoutExtension(jsonPath)}:"; var myTag = $"\t\t\t// from {currentJson}:";
var seen_ids = new HashSet<int>(); var seen_ids = new HashSet<int>();
using (var sr = new StreamReader(tableCs)) using (var sr = new StreamReader(tableCs))
using (var sw = new StreamWriter(tableCs + ".new")) using (var sw = new StreamWriter(tableCs + ".new"))

View file

@ -82,8 +82,8 @@ namespace TL
[TLDef(0xF35C6D01)] //rpc_result#f35c6d01 req_msg_id:long result:Object = RpcResult [TLDef(0xF35C6D01)] //rpc_result#f35c6d01 req_msg_id:long result:Object = RpcResult
public partial class RpcResult : ITLObject public partial class RpcResult : ITLObject
{ {
internal long req_msg_id; public long req_msg_id;
internal object result; public object result;
} }
[TLDef(0x2144CA19)] //rpc_error#2144ca19 error_code:int error_message:string = RpcError [TLDef(0x2144CA19)] //rpc_error#2144ca19 error_code:int error_message:string = RpcError

File diff suppressed because it is too large Load diff

View file

@ -5,8 +5,10 @@ namespace TL
{ {
namespace Layer8 namespace Layer8
{ {
///<summary>See <a href="https://core.telegram.org/type/DecryptedMessage"/></summary>
public abstract partial class DecryptedMessageBase : ITLObject { } public abstract partial class DecryptedMessageBase : ITLObject { }
[TLDef(0x1F814F1F)] //decryptedMessage#1f814f1f random_id:long random_bytes:bytes message:string media:DecryptedMessageMedia = DecryptedMessage ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessage"/></summary>
[TLDef(0x1F814F1F)]
public partial class DecryptedMessage : DecryptedMessageBase public partial class DecryptedMessage : DecryptedMessageBase
{ {
public long random_id; public long random_id;
@ -14,7 +16,8 @@ namespace TL
public string message; public string message;
public DecryptedMessageMedia media; public DecryptedMessageMedia media;
} }
[TLDef(0xAA48327D)] //decryptedMessageService#aa48327d random_id:long random_bytes:bytes action:DecryptedMessageAction = DecryptedMessage ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageService"/></summary>
[TLDef(0xAA48327D)]
public partial class DecryptedMessageService : DecryptedMessageBase public partial class DecryptedMessageService : DecryptedMessageBase
{ {
public long random_id; public long random_id;
@ -22,10 +25,13 @@ namespace TL
public DecryptedMessageAction action; public DecryptedMessageAction action;
} }
///<summary>See <a href="https://core.telegram.org/type/DecryptedMessageMedia"/></summary>
public abstract partial class DecryptedMessageMedia : ITLObject { } public abstract partial class DecryptedMessageMedia : ITLObject { }
[TLDef(0x089F5C4A)] //decryptedMessageMediaEmpty#089f5c4a = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaEmpty"/></summary>
[TLDef(0x089F5C4A)]
public partial class DecryptedMessageMediaEmpty : DecryptedMessageMedia { } public partial class DecryptedMessageMediaEmpty : DecryptedMessageMedia { }
[TLDef(0x32798A8C)] //decryptedMessageMediaPhoto#32798a8c thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaPhoto"/></summary>
[TLDef(0x32798A8C)]
public partial class DecryptedMessageMediaPhoto : DecryptedMessageMedia public partial class DecryptedMessageMediaPhoto : DecryptedMessageMedia
{ {
public byte[] thumb; public byte[] thumb;
@ -37,7 +43,8 @@ namespace TL
public byte[] key; public byte[] key;
public byte[] iv; public byte[] iv;
} }
[TLDef(0x4CEE6EF3)] //decryptedMessageMediaVideo#4cee6ef3 thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaVideo"/></summary>
[TLDef(0x4CEE6EF3)]
public partial class DecryptedMessageMediaVideo : DecryptedMessageMedia public partial class DecryptedMessageMediaVideo : DecryptedMessageMedia
{ {
public byte[] thumb; public byte[] thumb;
@ -50,13 +57,15 @@ namespace TL
public byte[] key; public byte[] key;
public byte[] iv; public byte[] iv;
} }
[TLDef(0x35480A59)] //decryptedMessageMediaGeoPoint#35480a59 lat:double long:double = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaGeoPoint"/></summary>
[TLDef(0x35480A59)]
public partial class DecryptedMessageMediaGeoPoint : DecryptedMessageMedia public partial class DecryptedMessageMediaGeoPoint : DecryptedMessageMedia
{ {
public double lat; public double lat;
public double long_; public double long_;
} }
[TLDef(0x588A0A97)] //decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaContact"/></summary>
[TLDef(0x588A0A97)]
public partial class DecryptedMessageMediaContact : DecryptedMessageMedia public partial class DecryptedMessageMediaContact : DecryptedMessageMedia
{ {
public string phone_number; public string phone_number;
@ -64,7 +73,8 @@ namespace TL
public string last_name; public string last_name;
public int user_id; public int user_id;
} }
[TLDef(0xB095434B)] //decryptedMessageMediaDocument#b095434b thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaDocument"/></summary>
[TLDef(0xB095434B)]
public partial class DecryptedMessageMediaDocument : DecryptedMessageMedia public partial class DecryptedMessageMediaDocument : DecryptedMessageMedia
{ {
public byte[] thumb; public byte[] thumb;
@ -76,7 +86,8 @@ namespace TL
public byte[] key; public byte[] key;
public byte[] iv; public byte[] iv;
} }
[TLDef(0x6080758F)] //decryptedMessageMediaAudio#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaAudio"/></summary>
[TLDef(0x6080758F)]
public partial class DecryptedMessageMediaAudio : DecryptedMessageMedia public partial class DecryptedMessageMediaAudio : DecryptedMessageMedia
{ {
public int duration; public int duration;
@ -85,23 +96,31 @@ namespace TL
public byte[] iv; public byte[] iv;
} }
///<summary>See <a href="https://core.telegram.org/type/DecryptedMessageAction"/></summary>
public abstract partial class DecryptedMessageAction : ITLObject { } public abstract partial class DecryptedMessageAction : ITLObject { }
[TLDef(0xA1733AEC)] //decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageActionSetMessageTTL"/></summary>
[TLDef(0xA1733AEC)]
public partial class DecryptedMessageActionSetMessageTTL : DecryptedMessageAction { public int ttl_seconds; } public partial class DecryptedMessageActionSetMessageTTL : DecryptedMessageAction { public int ttl_seconds; }
[TLDef(0x0C4F40BE)] //decryptedMessageActionReadMessages#0c4f40be random_ids:Vector<long> = DecryptedMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageActionReadMessages"/></summary>
[TLDef(0x0C4F40BE)]
public partial class DecryptedMessageActionReadMessages : DecryptedMessageAction { public long[] random_ids; } public partial class DecryptedMessageActionReadMessages : DecryptedMessageAction { public long[] random_ids; }
[TLDef(0x65614304)] //decryptedMessageActionDeleteMessages#65614304 random_ids:Vector<long> = DecryptedMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageActionDeleteMessages"/></summary>
[TLDef(0x65614304)]
public partial class DecryptedMessageActionDeleteMessages : DecryptedMessageAction { public long[] random_ids; } public partial class DecryptedMessageActionDeleteMessages : DecryptedMessageAction { public long[] random_ids; }
[TLDef(0x8AC1F475)] //decryptedMessageActionScreenshotMessages#8ac1f475 random_ids:Vector<long> = DecryptedMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageActionScreenshotMessages"/></summary>
[TLDef(0x8AC1F475)]
public partial class DecryptedMessageActionScreenshotMessages : DecryptedMessageAction { public long[] random_ids; } public partial class DecryptedMessageActionScreenshotMessages : DecryptedMessageAction { public long[] random_ids; }
[TLDef(0x6719E45C)] //decryptedMessageActionFlushHistory#6719e45c = DecryptedMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageActionFlushHistory"/></summary>
[TLDef(0x6719E45C)]
public partial class DecryptedMessageActionFlushHistory : DecryptedMessageAction { } public partial class DecryptedMessageActionFlushHistory : DecryptedMessageAction { }
} }
namespace Layer17 namespace Layer17
{ {
///<summary>See <a href="https://core.telegram.org/type/DecryptedMessage"/></summary>
public abstract partial class DecryptedMessageBase : ITLObject { } public abstract partial class DecryptedMessageBase : ITLObject { }
[TLDef(0x204D3878)] //decryptedMessage#204d3878 random_id:long ttl:int message:string media:DecryptedMessageMedia = DecryptedMessage ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessage"/></summary>
[TLDef(0x204D3878)]
public partial class DecryptedMessage : DecryptedMessageBase public partial class DecryptedMessage : DecryptedMessageBase
{ {
public long random_id; public long random_id;
@ -109,15 +128,18 @@ namespace TL
public string message; public string message;
public DecryptedMessageMedia media; public DecryptedMessageMedia media;
} }
[TLDef(0x73164160)] //decryptedMessageService#73164160 random_id:long action:DecryptedMessageAction = DecryptedMessage ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageService"/></summary>
[TLDef(0x73164160)]
public partial class DecryptedMessageService : DecryptedMessageBase public partial class DecryptedMessageService : DecryptedMessageBase
{ {
public long random_id; public long random_id;
public DecryptedMessageAction action; public DecryptedMessageAction action;
} }
///<summary>See <a href="https://core.telegram.org/type/DecryptedMessageMedia"/></summary>
public abstract partial class DecryptedMessageMedia : ITLObject { } public abstract partial class DecryptedMessageMedia : ITLObject { }
[TLDef(0x524A415D)] //decryptedMessageMediaVideo#524a415d thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaVideo"/></summary>
[TLDef(0x524A415D)]
public partial class DecryptedMessageMediaVideo : DecryptedMessageMedia public partial class DecryptedMessageMediaVideo : DecryptedMessageMedia
{ {
public byte[] thumb; public byte[] thumb;
@ -131,7 +153,8 @@ namespace TL
public byte[] key; public byte[] key;
public byte[] iv; public byte[] iv;
} }
[TLDef(0x57E0A9CB)] //decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaAudio"/></summary>
[TLDef(0x57E0A9CB)]
public partial class DecryptedMessageMediaAudio : DecryptedMessageMedia public partial class DecryptedMessageMediaAudio : DecryptedMessageMedia
{ {
public int duration; public int duration;
@ -141,7 +164,8 @@ namespace TL
public byte[] iv; public byte[] iv;
} }
[TLDef(0x1BE31789)] //decryptedMessageLayer#1be31789 random_bytes:bytes layer:int in_seq_no:int out_seq_no:int message:DecryptedMessage = DecryptedMessageLayer ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageLayer"/></summary>
[TLDef(0x1BE31789)]
public partial class DecryptedMessageLayer : ITLObject public partial class DecryptedMessageLayer : ITLObject
{ {
public byte[] random_bytes; public byte[] random_bytes;
@ -151,78 +175,97 @@ namespace TL
public DecryptedMessageBase message; public DecryptedMessageBase message;
} }
[TLDef(0x92042FF7)] //sendMessageUploadVideoAction#92042ff7 = SendMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/sendMessageUploadVideoAction"/></summary>
[TLDef(0x92042FF7)]
public partial class SendMessageUploadVideoAction : SendMessageAction { } public partial class SendMessageUploadVideoAction : SendMessageAction { }
[TLDef(0xE6AC8A6F)] //sendMessageUploadAudioAction#e6ac8a6f = SendMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/sendMessageUploadAudioAction"/></summary>
[TLDef(0xE6AC8A6F)]
public partial class SendMessageUploadAudioAction : SendMessageAction { } public partial class SendMessageUploadAudioAction : SendMessageAction { }
[TLDef(0x990A3C1A)] //sendMessageUploadPhotoAction#990a3c1a = SendMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/sendMessageUploadPhotoAction"/></summary>
[TLDef(0x990A3C1A)]
public partial class SendMessageUploadPhotoAction : SendMessageAction { } public partial class SendMessageUploadPhotoAction : SendMessageAction { }
[TLDef(0x8FAEE98E)] //sendMessageUploadDocumentAction#8faee98e = SendMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/sendMessageUploadDocumentAction"/></summary>
[TLDef(0x8FAEE98E)]
public partial class SendMessageUploadDocumentAction : SendMessageAction { } public partial class SendMessageUploadDocumentAction : SendMessageAction { }
///<summary>See <a href="https://core.telegram.org/type/DecryptedMessageAction"/></summary>
public abstract partial class DecryptedMessageAction : ITLObject { } public abstract partial class DecryptedMessageAction : ITLObject { }
[TLDef(0x511110B0)] //decryptedMessageActionResend#511110b0 start_seq_no:int end_seq_no:int = DecryptedMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageActionResend"/></summary>
[TLDef(0x511110B0)]
public partial class DecryptedMessageActionResend : DecryptedMessageAction public partial class DecryptedMessageActionResend : DecryptedMessageAction
{ {
public int start_seq_no; public int start_seq_no;
public int end_seq_no; public int end_seq_no;
} }
[TLDef(0xF3048883)] //decryptedMessageActionNotifyLayer#f3048883 layer:int = DecryptedMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageActionNotifyLayer"/></summary>
[TLDef(0xF3048883)]
public partial class DecryptedMessageActionNotifyLayer : DecryptedMessageAction { public int layer; } public partial class DecryptedMessageActionNotifyLayer : DecryptedMessageAction { public int layer; }
[TLDef(0xCCB27641)] //decryptedMessageActionTyping#ccb27641 action:SendMessageAction = DecryptedMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageActionTyping"/></summary>
[TLDef(0xCCB27641)]
public partial class DecryptedMessageActionTyping : DecryptedMessageAction { public SendMessageAction action; } public partial class DecryptedMessageActionTyping : DecryptedMessageAction { public SendMessageAction action; }
} }
namespace Layer20 namespace Layer20
{ {
///<summary>See <a href="https://core.telegram.org/type/DecryptedMessageAction"/></summary>
public abstract partial class DecryptedMessageAction : ITLObject { } public abstract partial class DecryptedMessageAction : ITLObject { }
[TLDef(0xF3C9611B)] //decryptedMessageActionRequestKey#f3c9611b exchange_id:long g_a:bytes = DecryptedMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageActionRequestKey"/></summary>
[TLDef(0xF3C9611B)]
public partial class DecryptedMessageActionRequestKey : DecryptedMessageAction public partial class DecryptedMessageActionRequestKey : DecryptedMessageAction
{ {
public long exchange_id; public long exchange_id;
public byte[] g_a; public byte[] g_a;
} }
[TLDef(0x6FE1735B)] //decryptedMessageActionAcceptKey#6fe1735b exchange_id:long g_b:bytes key_fingerprint:long = DecryptedMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageActionAcceptKey"/></summary>
[TLDef(0x6FE1735B)]
public partial class DecryptedMessageActionAcceptKey : DecryptedMessageAction public partial class DecryptedMessageActionAcceptKey : DecryptedMessageAction
{ {
public long exchange_id; public long exchange_id;
public byte[] g_b; public byte[] g_b;
public long key_fingerprint; public long key_fingerprint;
} }
[TLDef(0xDD05EC6B)] //decryptedMessageActionAbortKey#dd05ec6b exchange_id:long = DecryptedMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageActionAbortKey"/></summary>
[TLDef(0xDD05EC6B)]
public partial class DecryptedMessageActionAbortKey : DecryptedMessageAction { public long exchange_id; } public partial class DecryptedMessageActionAbortKey : DecryptedMessageAction { public long exchange_id; }
[TLDef(0xEC2E0B9B)] //decryptedMessageActionCommitKey#ec2e0b9b exchange_id:long key_fingerprint:long = DecryptedMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageActionCommitKey"/></summary>
[TLDef(0xEC2E0B9B)]
public partial class DecryptedMessageActionCommitKey : DecryptedMessageAction public partial class DecryptedMessageActionCommitKey : DecryptedMessageAction
{ {
public long exchange_id; public long exchange_id;
public long key_fingerprint; public long key_fingerprint;
} }
[TLDef(0xA82FDD63)] //decryptedMessageActionNoop#a82fdd63 = DecryptedMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageActionNoop"/></summary>
[TLDef(0xA82FDD63)]
public partial class DecryptedMessageActionNoop : DecryptedMessageAction { } public partial class DecryptedMessageActionNoop : DecryptedMessageAction { }
} }
namespace Layer23 namespace Layer23
{ {
[TLDef(0xFB0A5727)] //documentAttributeSticker#fb0a5727 = DocumentAttribute ///<summary>See <a href="https://core.telegram.org/constructor/documentAttributeSticker"/></summary>
[TLDef(0xFB0A5727)]
public partial class DocumentAttributeSticker : DocumentAttribute { } public partial class DocumentAttributeSticker : DocumentAttribute { }
[TLDef(0x5910CCCB)] //documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute ///<summary>See <a href="https://core.telegram.org/constructor/documentAttributeVideo"/></summary>
[TLDef(0x5910CCCB)]
public partial class DocumentAttributeVideo : DocumentAttribute public partial class DocumentAttributeVideo : DocumentAttribute
{ {
public int duration; public int duration;
public int w; public int w;
public int h; public int h;
} }
[TLDef(0x051448E5)] //documentAttributeAudio#051448e5 duration:int = DocumentAttribute ///<summary>See <a href="https://core.telegram.org/constructor/documentAttributeAudio"/></summary>
[TLDef(0x051448E5)]
public partial class DocumentAttributeAudio : DocumentAttribute { public int duration; } public partial class DocumentAttributeAudio : DocumentAttribute { public int duration; }
[TLDef(0x7C596B46)] //fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation ///<summary>See <a href="https://core.telegram.org/constructor/fileLocationUnavailable"/></summary>
[TLDef(0x7C596B46)]
public partial class FileLocationUnavailable : FileLocation public partial class FileLocationUnavailable : FileLocation
{ {
public long volume_id; public long volume_id;
public int local_id; public int local_id;
public long secret; public long secret;
} }
[TLDef(0x53D69076)] //fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation ///<summary>See <a href="https://core.telegram.org/constructor/fileLocation"/></summary>
[TLDef(0x53D69076)]
public partial class FileLocation_ : FileLocation public partial class FileLocation_ : FileLocation
{ {
public int dc_id; public int dc_id;
@ -231,8 +274,10 @@ namespace TL
public long secret; public long secret;
} }
///<summary>See <a href="https://core.telegram.org/type/DecryptedMessageMedia"/></summary>
public abstract partial class DecryptedMessageMedia : ITLObject { } public abstract partial class DecryptedMessageMedia : ITLObject { }
[TLDef(0xFA95B0DD)] //decryptedMessageMediaExternalDocument#fa95b0dd id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaExternalDocument"/></summary>
[TLDef(0xFA95B0DD)]
public partial class DecryptedMessageMediaExternalDocument : DecryptedMessageMedia public partial class DecryptedMessageMediaExternalDocument : DecryptedMessageMedia
{ {
public long id; public long id;
@ -248,7 +293,8 @@ namespace TL
namespace Layer45 namespace Layer45
{ {
[TLDef(0x36B091DE)] //decryptedMessage#36b091de flags:# random_id:long ttl:int message:string media:flags.9?DecryptedMessageMedia entities:flags.7?Vector<MessageEntity> via_bot_name:flags.11?string reply_to_random_id:flags.3?long = DecryptedMessage ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessage"/></summary>
[TLDef(0x36B091DE)]
public partial class DecryptedMessage : ITLObject public partial class DecryptedMessage : ITLObject
{ {
[Flags] public enum Flags { has_reply_to_random_id = 0x8, has_entities = 0x80, has_media = 0x200, has_via_bot_name = 0x800 } [Flags] public enum Flags { has_reply_to_random_id = 0x8, has_entities = 0x80, has_media = 0x200, has_via_bot_name = 0x800 }
@ -262,8 +308,10 @@ namespace TL
[IfFlag(3)] public long reply_to_random_id; [IfFlag(3)] public long reply_to_random_id;
} }
///<summary>See <a href="https://core.telegram.org/type/DecryptedMessageMedia"/></summary>
public abstract partial class DecryptedMessageMedia : ITLObject { } public abstract partial class DecryptedMessageMedia : ITLObject { }
[TLDef(0xF1FA8D78)] //decryptedMessageMediaPhoto#f1fa8d78 thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes caption:string = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaPhoto"/></summary>
[TLDef(0xF1FA8D78)]
public partial class DecryptedMessageMediaPhoto : DecryptedMessageMedia public partial class DecryptedMessageMediaPhoto : DecryptedMessageMedia
{ {
public byte[] thumb; public byte[] thumb;
@ -276,7 +324,8 @@ namespace TL
public byte[] iv; public byte[] iv;
public string caption; public string caption;
} }
[TLDef(0x970C8C0E)] //decryptedMessageMediaVideo#970c8c0e thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes caption:string = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaVideo"/></summary>
[TLDef(0x970C8C0E)]
public partial class DecryptedMessageMediaVideo : DecryptedMessageMedia public partial class DecryptedMessageMediaVideo : DecryptedMessageMedia
{ {
public byte[] thumb; public byte[] thumb;
@ -291,7 +340,8 @@ namespace TL
public byte[] iv; public byte[] iv;
public string caption; public string caption;
} }
[TLDef(0x7AFE8AE2)] //decryptedMessageMediaDocument#7afe8ae2 thumb:bytes thumb_w:int thumb_h:int mime_type:string size:int key:bytes iv:bytes attributes:Vector<DocumentAttribute> caption:string = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaDocument"/></summary>
[TLDef(0x7AFE8AE2)]
public partial class DecryptedMessageMediaDocument : DecryptedMessageMedia public partial class DecryptedMessageMediaDocument : DecryptedMessageMedia
{ {
public byte[] thumb; public byte[] thumb;
@ -304,7 +354,8 @@ namespace TL
public DocumentAttribute[] attributes; public DocumentAttribute[] attributes;
public string caption; public string caption;
} }
[TLDef(0x8A0DF56F)] //decryptedMessageMediaVenue#8a0df56f lat:double long:double title:string address:string provider:string venue_id:string = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaVenue"/></summary>
[TLDef(0x8A0DF56F)]
public partial class DecryptedMessageMediaVenue : DecryptedMessageMedia public partial class DecryptedMessageMediaVenue : DecryptedMessageMedia
{ {
public double lat; public double lat;
@ -314,16 +365,19 @@ namespace TL
public string provider; public string provider;
public string venue_id; public string venue_id;
} }
[TLDef(0xE50511D8)] //decryptedMessageMediaWebPage#e50511d8 url:string = DecryptedMessageMedia ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessageMediaWebPage"/></summary>
[TLDef(0xE50511D8)]
public partial class DecryptedMessageMediaWebPage : DecryptedMessageMedia { public string url; } public partial class DecryptedMessageMediaWebPage : DecryptedMessageMedia { public string url; }
[TLDef(0x3A556302)] //documentAttributeSticker#3a556302 alt:string stickerset:InputStickerSet = DocumentAttribute ///<summary>See <a href="https://core.telegram.org/constructor/documentAttributeSticker"/></summary>
[TLDef(0x3A556302)]
public partial class DocumentAttributeSticker : DocumentAttribute public partial class DocumentAttributeSticker : DocumentAttribute
{ {
public string alt; public string alt;
public InputStickerSet stickerset; public InputStickerSet stickerset;
} }
[TLDef(0xDED218E0)] //documentAttributeAudio#ded218e0 duration:int title:string performer:string = DocumentAttribute ///<summary>See <a href="https://core.telegram.org/constructor/documentAttributeAudio"/></summary>
[TLDef(0xDED218E0)]
public partial class DocumentAttributeAudio : DocumentAttribute public partial class DocumentAttributeAudio : DocumentAttribute
{ {
public int duration; public int duration;
@ -337,13 +391,15 @@ namespace TL
namespace Layer66 namespace Layer66
{ {
[TLDef(0xBB718624)] //sendMessageUploadRoundAction#bb718624 = SendMessageAction ///<summary>See <a href="https://core.telegram.org/constructor/sendMessageUploadRoundAction"/></summary>
[TLDef(0xBB718624)]
public partial class SendMessageUploadRoundAction : SendMessageAction { } public partial class SendMessageUploadRoundAction : SendMessageAction { }
} }
namespace Layer73 namespace Layer73
{ {
[TLDef(0x91CC4674)] //decryptedMessage#91cc4674 flags:# random_id:long ttl:int message:string media:flags.9?DecryptedMessageMedia entities:flags.7?Vector<MessageEntity> via_bot_name:flags.11?string reply_to_random_id:flags.3?long grouped_id:flags.17?long = DecryptedMessage ///<summary>See <a href="https://core.telegram.org/constructor/decryptedMessage"/></summary>
[TLDef(0x91CC4674)]
public partial class DecryptedMessage : ITLObject public partial class DecryptedMessage : ITLObject
{ {
[Flags] public enum Flags { has_reply_to_random_id = 0x8, has_entities = 0x80, has_media = 0x200, has_via_bot_name = 0x800, [Flags] public enum Flags { has_reply_to_random_id = 0x8, has_entities = 0x80, has_media = 0x200, has_via_bot_name = 0x800,

View file

@ -51,6 +51,8 @@ namespace TL
[0x0A9F2259] = typeof(DestroyAuthKeyNone), [0x0A9F2259] = typeof(DestroyAuthKeyNone),
[0xEA109B13] = typeof(DestroyAuthKeyFail), [0xEA109B13] = typeof(DestroyAuthKeyFail),
// from TL.Schema: // from TL.Schema:
[0xBC799737] = typeof(BoolFalse),
[0x997275B5] = typeof(BoolTrue),
[0x3FEDD339] = typeof(True), [0x3FEDD339] = typeof(True),
[0xC4B9F9BB] = typeof(Error), [0xC4B9F9BB] = typeof(Error),
[0x56730BCC] = typeof(Null), [0x56730BCC] = typeof(Null),