Skip to content

Commit c56554d

Browse files
committed
Update to Telegram API layer 227.2
- Add InputRichFile, InputRichFilePhoto, InputRichFileDocument types - Refactor InputRichMessageHTML/Markdown to use InputRichFile[]
1 parent 6b83761 commit c56554d

4 files changed

Lines changed: 57 additions & 62 deletions

File tree

.github/workflows/autolock.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
action:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: dessant/lock-threads@v5
20+
- uses: dessant/lock-threads@v6
2121
with:
2222
issue-inactive-days: '60'
2323
pr-inactive-days: '60'

src/TL.Schema.cs

Lines changed: 38 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6415,7 +6415,7 @@ public sealed partial class UpdateGroupCallChainBlocks : Update
64156415
public int sub_chain_id;
64166416
/// <summary>Blocks.</summary>
64176417
public byte[][] blocks;
6418-
/// <summary>Offset of the next block.</summary>
6418+
/// <summary>Height of the block located <em>after</em> the last block in <c>blocks</c>.</summary>
64196419
public int next_offset;
64206420
}
64216421
/// <summary>Incoming messages in a <a href="https://corefork.telegram.org/api/monoforum">monoforum topic</a> were read <para>See <a href="https://corefork.telegram.org/constructor/updateReadMonoForumInbox"/></para></summary>
@@ -23589,29 +23589,26 @@ public sealed partial class Account_WebBrowserSettings : IObject
2358923589
}
2359023590
}
2359123591

23592-
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/richMessage"/></para></summary>
23593-
[TLDef(0xBAF39D8B)]
23594-
public sealed partial class RichMessage : IObject
23592+
/// <summary><para>See <a href="https://corefork.telegram.org/type/InputRichFile"/></para></summary>
23593+
public abstract partial class InputRichFile : IObject
2359523594
{
23596-
public Flags flags;
23597-
public PageBlock[] blocks;
23598-
public PhotoBase[] photos;
23599-
public DocumentBase[] documents;
23600-
23601-
[Flags] public enum Flags : uint
23602-
{
23603-
rtl = 0x1,
23604-
part = 0x2,
23605-
}
23595+
public string id;
2360623596
}
23607-
23608-
/// <summary><para>See <a href="https://corefork.telegram.org/type/InputRichMessage"/></para></summary>
23609-
public abstract partial class InputRichMessageBase : IObject
23597+
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/inputRichFilePhoto"/></para></summary>
23598+
[TLDef(0x9B00622B, inheritAt = 0)]
23599+
public sealed partial class InputRichFilePhoto : InputRichFile
2361023600
{
23611-
public abstract InputPhoto[] Photos { get; set; }
23612-
public abstract InputDocument[] Documents { get; set; }
23613-
public abstract InputUserBase[] Users { get; set; }
23601+
public InputPhoto photo;
23602+
}
23603+
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/inputRichFileDocument"/></para></summary>
23604+
[TLDef(0x83281DBD, inheritAt = 0)]
23605+
public sealed partial class InputRichFileDocument : InputRichFile
23606+
{
23607+
public InputDocument document;
2361423608
}
23609+
23610+
/// <summary><para>See <a href="https://corefork.telegram.org/type/InputRichMessage"/></para></summary>
23611+
public abstract partial class InputRichMessageBase : IObject { }
2361523612
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/inputRichMessage"/></para></summary>
2361623613
[TLDef(0xE4C449FC)]
2361723614
public sealed partial class InputRichMessage : InputRichMessageBase
@@ -23630,55 +23627,51 @@ public sealed partial class InputRichMessage : InputRichMessageBase
2363023627
has_documents = 0x8,
2363123628
has_users = 0x10,
2363223629
}
23633-
23634-
public override InputPhoto[] Photos { get => photos; set => photos = value; }
23635-
public override InputDocument[] Documents { get => documents; set => documents = value; }
23636-
public override InputUserBase[] Users { get => users; set => users = value; }
2363723630
}
2363823631
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/inputRichMessageHTML"/></para></summary>
23639-
[TLDef(0xD4EAB551)]
23632+
[TLDef(0xDACB836A)]
2364023633
public sealed partial class InputRichMessageHTML : InputRichMessageBase
2364123634
{
2364223635
public Flags flags;
2364323636
public string html;
23644-
[IfFlag(2)] public InputPhoto[] photos;
23645-
[IfFlag(3)] public InputDocument[] documents;
23646-
[IfFlag(4)] public InputUserBase[] users;
23637+
[IfFlag(2)] public InputRichFile[] files;
2364723638

2364823639
[Flags] public enum Flags : uint
2364923640
{
2365023641
rtl = 0x1,
2365123642
noautolink = 0x2,
23652-
has_photos = 0x4,
23653-
has_documents = 0x8,
23654-
has_users = 0x10,
23643+
has_files = 0x4,
2365523644
}
23656-
23657-
public override InputPhoto[] Photos { get => photos; set => photos = value; }
23658-
public override InputDocument[] Documents { get => documents; set => documents = value; }
23659-
public override InputUserBase[] Users { get => users; set => users = value; }
2366023645
}
2366123646
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/inputRichMessageMarkdown"/></para></summary>
23662-
[TLDef(0x09AC8186)]
23647+
[TLDef(0x004B572C)]
2366323648
public sealed partial class InputRichMessageMarkdown : InputRichMessageBase
2366423649
{
2366523650
public Flags flags;
2366623651
public string markdown;
23667-
[IfFlag(2)] public InputPhoto[] photos;
23668-
[IfFlag(3)] public InputDocument[] documents;
23669-
[IfFlag(4)] public InputUserBase[] users;
23652+
[IfFlag(2)] public InputRichFile[] files;
2367023653

2367123654
[Flags] public enum Flags : uint
2367223655
{
2367323656
rtl = 0x1,
2367423657
noautolink = 0x2,
23675-
has_photos = 0x4,
23676-
has_documents = 0x8,
23677-
has_users = 0x10,
23658+
has_files = 0x4,
2367823659
}
23660+
}
2367923661

23680-
public override InputPhoto[] Photos { get => photos; set => photos = value; }
23681-
public override InputDocument[] Documents { get => documents; set => documents = value; }
23682-
public override InputUserBase[] Users { get => users; set => users = value; }
23662+
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/richMessage"/></para></summary>
23663+
[TLDef(0xBAF39D8B)]
23664+
public sealed partial class RichMessage : IObject
23665+
{
23666+
public Flags flags;
23667+
public PageBlock[] blocks;
23668+
public PhotoBase[] photos;
23669+
public DocumentBase[] documents;
23670+
23671+
[Flags] public enum Flags : uint
23672+
{
23673+
rtl = 0x1,
23674+
part = 0x2,
23675+
}
2368323676
}
2368423677
}

src/TL.SchemaFuncs.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7487,10 +7487,10 @@ public static Task<UpdatesBase> Phone_CreateGroupCall(this Client client, InputP
74877487
/// <param name="muted">If set, the user will be muted by default upon joining.</param>
74887488
/// <param name="video_stopped">If set, the user's video will be disabled by default upon joining.</param>
74897489
/// <param name="call">The group call</param>
7490-
/// <param name="join_as">Join the group call, presenting yourself as the specified user/channel</param>
7491-
/// <param name="invite_hash">The invitation hash from the <a href="https://corefork.telegram.org/api/links#video-chat-livestream-links">invite link »</a>, if provided allows speaking in a livestream or muted group chat.</param>
7492-
/// <param name="public_key">For conference calls, your public key.</param>
7493-
/// <param name="block">The <a href="https://corefork.telegram.org/api/end-to-end/group-calls">block containing an appropriate e2e.chain.changeSetGroupState event</a>.</param>
7490+
/// <param name="join_as">Join the group call, presenting yourself as the specified user/channel (<a href="https://corefork.telegram.org/api/group-calls#video-chatslivestreams">video chats/livestreams »</a> only, must be equal to <see cref="InputPeerSelf"/> when joining <a href="https://corefork.telegram.org/api/group-calls#live-stories">live stories »</a> or <a href="https://corefork.telegram.org/api/group-calls#conference-calls">conference calls »</a>).</param>
7491+
/// <param name="invite_hash">The invitation hash from the <a href="https://corefork.telegram.org/api/links#video-chat-livestream-links">invite link »</a>, if provided allows speaking in a livestream or muted group call (<a href="https://corefork.telegram.org/api/group-calls#video-chatslivestreams">video chats/livestreams »</a> only, cannot be used by <a href="https://corefork.telegram.org/api/group-calls#live-stories">live stories »</a> or <a href="https://corefork.telegram.org/api/group-calls#conference-calls">conference calls »</a>).</param>
7492+
/// <param name="public_key">For <a href="https://corefork.telegram.org/api/group-calls#conference-calls">conference calls »</a> only, your public key.</param>
7493+
/// <param name="block">The <a href="https://corefork.telegram.org/api/end-to-end/group-calls">block containing an appropriate e2e.chain.changeSetGroupState event</a>, only for <a href="https://corefork.telegram.org/api/group-calls#conference-calls">conference calls »</a>.</param>
74947494
/// <param name="params_">WebRTC parameters</param>
74957495
public static Task<UpdatesBase> Phone_JoinGroupCall(this Client client, InputGroupCallBase call, InputPeer join_as, DataJSON params_, string invite_hash = null, Int256? public_key = null, byte[] block = null, bool muted = false, bool video_stopped = false)
74967496
=> client.Invoke(new Phone_JoinGroupCall
@@ -7514,8 +7514,8 @@ public static Task<UpdatesBase> Phone_LeaveGroupCall(this Client client, InputGr
75147514
source = source,
75157515
});
75167516

7517-
/// <summary>Invite a set of users to a <a href="https://corefork.telegram.org/api/group-calls">group call</a>. <para>See <a href="https://corefork.telegram.org/method/phone.inviteToGroupCall"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403 (<a href="https://corefork.telegram.org/method/phone.inviteToGroupCall#possible-errors">details</a>)</para></summary>
7518-
/// <param name="call">The group call</param>
7517+
/// <summary>Invite a set of users to a <a href="https://corefork.telegram.org/api/group-calls#video-chatslivestreams">video chat/livestream »</a>; cannot be used for <a href="https://corefork.telegram.org/api/group-calls#live-stories">live stories »</a> or <a href="https://corefork.telegram.org/api/group-calls#conference-calls">conference calls »</a>. <para>See <a href="https://corefork.telegram.org/method/phone.inviteToGroupCall"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403 (<a href="https://corefork.telegram.org/method/phone.inviteToGroupCall#possible-errors">details</a>)</para></summary>
7518+
/// <param name="call">The <a href="https://corefork.telegram.org/api/group-calls#video-chatslivestreams">video chat/livestream »</a></param>
75197519
/// <param name="users">The users to invite.</param>
75207520
public static Task<UpdatesBase> Phone_InviteToGroupCall(this Client client, InputGroupCallBase call, params InputUserBase[] users)
75217521
=> client.Invoke(new Phone_InviteToGroupCall
@@ -7638,9 +7638,9 @@ public static Task<Phone_JoinAsPeers> Phone_GetGroupCallJoinAs(this Client clien
76387638
peer = peer,
76397639
});
76407640

7641-
/// <summary>Get an <a href="https://corefork.telegram.org/api/links#video-chat-livestream-links">invite link</a> for a group call or livestream <para>See <a href="https://corefork.telegram.org/method/phone.exportGroupCallInvite"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403 (<a href="https://corefork.telegram.org/method/phone.exportGroupCallInvite#possible-errors">details</a>)</para></summary>
7642-
/// <param name="can_self_unmute">For livestreams or muted group chats, if set, users that join using this link will be able to speak without explicitly requesting permission by (for example by raising their hand).</param>
7643-
/// <param name="call">The group call</param>
7641+
/// <summary>Get an <a href="https://corefork.telegram.org/api/links#video-chat-livestream-links">invite link</a> for a <a href="https://corefork.telegram.org/api/group-calls#video-chatslivestreams">video chat/livestream »</a>; cannot be used for <a href="https://corefork.telegram.org/api/group-calls#live-stories">live stories »</a> or <a href="https://corefork.telegram.org/api/group-calls#conference-calls">conference calls »</a>. <para>See <a href="https://corefork.telegram.org/method/phone.exportGroupCallInvite"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403 (<a href="https://corefork.telegram.org/method/phone.exportGroupCallInvite#possible-errors">details</a>)</para></summary>
7642+
/// <param name="can_self_unmute">For livestreams or muted group chats, if set, users that join using this link will be able to speak without explicitly requesting permission, for example by raising their hand.</param>
7643+
/// <param name="call">The <a href="https://corefork.telegram.org/api/group-calls#video-chatslivestreams">video chat/livestream »</a></param>
76447644
public static Task<Phone_ExportedGroupCallInvite> Phone_ExportGroupCallInvite(this Client client, InputGroupCallBase call, bool can_self_unmute = false)
76457645
=> client.Invoke(new Phone_ExportGroupCallInvite
76467646
{
@@ -7786,11 +7786,11 @@ public static Task<UpdatesBase> Phone_DeclineConferenceCallInvite(this Client cl
77867786
msg_id = msg_id,
77877787
});
77887788

7789-
/// <summary>Fetch the blocks of a <a href="https://corefork.telegram.org/api/end-to-end/group-calls">conference blockchain »</a>. <para>See <a href="https://corefork.telegram.org/method/phone.getGroupCallChainBlocks"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/phone.getGroupCallChainBlocks#possible-errors">details</a>)</para></summary>
7789+
/// <summary>Fetch the blocks of a <a href="https://corefork.telegram.org/api/end-to-end/group-calls">conference blockchain »</a>, returns an <see cref="UpdateGroupCallChainBlocks"/> to be handled as <a href="https://corefork.telegram.org/api/end-to-end/group-calls#handling-updates">specifiede here »</a>. <para>See <a href="https://corefork.telegram.org/method/phone.getGroupCallChainBlocks"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/phone.getGroupCallChainBlocks#possible-errors">details</a>)</para></summary>
77907790
/// <param name="call">The conference.</param>
77917791
/// <param name="sub_chain_id">Subchain ID.</param>
7792-
/// <param name="offset">Offset for pagination.</param>
7793-
/// <param name="limit">Maximum number of blocks to return in this call, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
7792+
/// <param name="offset">Start fetching blocks starting from the specified height.</param>
7793+
/// <param name="limit">Maximum number of blocks to return in this call, <a href="https://corefork.telegram.org/api/offsets">see pagination</a>, max 100.</param>
77947794
public static Task<UpdatesBase> Phone_GetGroupCallChainBlocks(this Client client, InputGroupCallBase call, int sub_chain_id, int offset = default, int limit = int.MaxValue)
77957795
=> client.Invoke(new Phone_GetGroupCallChainBlocks
77967796
{

src/TL.Table.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace TL
66
{
77
public static partial class Layer
88
{
9-
public const int Version = 227; // fetched 06/09/2026 14:47:17
9+
public const int Version = 227; // fetched 06/12/2026 00:35:17
1010
internal const int SecretChats = 144;
1111
internal const int MTProto2 = 73;
1212
internal const uint VectorCtor = 0x1CB5C415;
@@ -1579,10 +1579,12 @@ public static partial class Layer
15791579
[0x933CA597] = typeof(WebDomainException),
15801580
[0xC31C8F4E] = null,//Account_WebBrowserSettingsNotModified
15811581
[0x79EB8CB3] = typeof(Account_WebBrowserSettings),
1582-
[0xBAF39D8B] = typeof(RichMessage),
1582+
[0x9B00622B] = typeof(InputRichFilePhoto),
1583+
[0x83281DBD] = typeof(InputRichFileDocument),
15831584
[0xE4C449FC] = typeof(InputRichMessage),
1584-
[0xD4EAB551] = typeof(InputRichMessageHTML),
1585-
[0x09AC8186] = typeof(InputRichMessageMarkdown),
1585+
[0xDACB836A] = typeof(InputRichMessageHTML),
1586+
[0x004B572C] = typeof(InputRichMessageMarkdown),
1587+
[0xBAF39D8B] = typeof(RichMessage),
15861588
// from TL.Secret:
15871589
[0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument),
15881590
[0x020DF5D0] = typeof(Layer101.MessageEntityBlockquote),

0 commit comments

Comments
 (0)