mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-04-21 06:13:57 +00:00
Compare commits
13 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24dbbcf66b | ||
|
|
6611e8675b | ||
|
|
f8b0fd48b1 | ||
|
|
59425a910a | ||
|
|
bd311a3a4f | ||
|
|
42fed13205 | ||
|
|
3d4be8ee9a | ||
|
|
c60c9cb7af | ||
|
|
0c5f589c54 | ||
|
|
8fe9a485ee | ||
|
|
3f531f4966 | ||
|
|
1912632722 | ||
|
|
9c839128bb |
14 changed files with 1149 additions and 301 deletions
|
|
@ -365,7 +365,7 @@ await Task.Delay(5000);
|
|||
```csharp
|
||||
// • Sending a message with custom emojies in Markdown to ourself:
|
||||
var text = "Vicksy says Hi! ";
|
||||
var entities = client.MarkdownToEntities(ref text, premium: true);
|
||||
var entities = client.MarkdownToEntities(ref text);
|
||||
await client.SendMessageAsync(InputPeer.Self, text, entities: entities);
|
||||
// also available in HTML: <tg-emoji emoji-id="5190875290439525089">👋</tg-emoji>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
[](https://corefork.telegram.org/methods)
|
||||
[](https://corefork.telegram.org/methods)
|
||||
[](https://www.nuget.org/packages/WTelegramClient/)
|
||||
[](https://www.nuget.org/packages/WTelegramClient/absoluteLatest)
|
||||
[](https://buymeacoffee.com/wizou)
|
||||
|
||||
## *_Telegram Client API library written 100% in C# and .NET_*
|
||||
## *Telegram Client API library written 100% in C# and .NET*
|
||||
|
||||
This library allows you to connect to Telegram and control a user programmatically (or a bot, but [WTelegramBot](https://www.nuget.org/packages/WTelegramBot) is much easier for that).
|
||||
All the Telegram Client APIs (MTProto) are supported so you can do everything the user could do with a full Telegram GUI client.
|
||||
|
|
@ -206,4 +206,4 @@ the [Examples codes](https://wiz0u.github.io/WTelegramClient/EXAMPLES) and still
|
|||
|
||||
If you like this library, you can [buy me a coffee](https://buymeacoffee.com/wizou) ❤ This will help the project keep going.
|
||||
|
||||
© 2021-2025 Olivier Marcoux
|
||||
© 2021-2026 Olivier Marcoux
|
||||
|
|
|
|||
|
|
@ -112,11 +112,12 @@ public class MTProtoGenerator : IIncrementalGenerator
|
|||
.AppendLine("\t\t{")
|
||||
.AppendLine($"\t\t\twriter.Write(0x{id:X8});");
|
||||
var members = symbol.GetMembers().ToList();
|
||||
int inheritIndex = 0;
|
||||
for (var parent = symbol.BaseType; parent != object_; parent = parent.BaseType)
|
||||
{
|
||||
var inheritBefore = (bool?)tldef.NamedArguments.FirstOrDefault(k => k.Key == "inheritBefore").Value.Value ?? false;
|
||||
if (inheritBefore) members.InsertRange(0, parent.GetMembers());
|
||||
else members.AddRange(parent.GetMembers());
|
||||
var inheritAt = (int?)tldef.NamedArguments.FirstOrDefault(k => k.Key == "inheritAt").Value.Value ?? -1;
|
||||
if (inheritAt >= 0) members.InsertRange(inheritIndex += inheritAt, parent.GetMembers());
|
||||
else { inheritIndex = members.Count; members.AddRange(parent.GetMembers()); }
|
||||
tldef = parent.GetAttributes().FirstOrDefault(a => a.AttributeClass == tlDefAttribute);
|
||||
}
|
||||
foreach (var member in members.OfType<IFieldSymbol>())
|
||||
|
|
|
|||
|
|
@ -899,8 +899,8 @@ namespace WTelegram
|
|||
var mc = await this.Channels_GetChannels(new InputChannel(chatId, 0));
|
||||
if (!mc.chats.TryGetValue(chatId, out chat))
|
||||
throw new WTException($"Channel {chatId} not found");
|
||||
else if (chats != null)
|
||||
chats[chatId] = chat;
|
||||
else
|
||||
chats?[chatId] = chat;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -391,7 +391,9 @@ namespace WTelegram
|
|||
_reactorReconnects = 0;
|
||||
if (_reactorReconnects == 0)
|
||||
throw;
|
||||
#pragma warning disable CA2016
|
||||
await Task.Delay(5000);
|
||||
#pragma warning restore CA2016
|
||||
if (_networkStream == null) return; // Dispose has been called in-between
|
||||
await ConnectAsync(); // start a new reactor after 5 secs
|
||||
lock (_pendingRpcs) // retry all pending requests
|
||||
|
|
@ -871,6 +873,7 @@ namespace WTelegram
|
|||
{
|
||||
_cts = new();
|
||||
IPEndPoint endpoint = null;
|
||||
bool needMigrate = false;
|
||||
byte[] preamble, secret = null;
|
||||
int dcId = _dcSession?.DcID ?? 0;
|
||||
if (dcId == 0) dcId = 2;
|
||||
|
|
@ -943,6 +946,7 @@ namespace WTelegram
|
|||
{
|
||||
endpoint = GetDefaultEndpoint(out defaultDc); // re-ask callback for an address
|
||||
if (!triedEndpoints.Add(endpoint)) throw;
|
||||
needMigrate = _dcSession.DataCenter.id == _session.MainDC && defaultDc != _session.MainDC;
|
||||
_dcSession.Client = null;
|
||||
// is it address for a known DCSession?
|
||||
_dcSession = _session.DCSessions.Values.FirstOrDefault(dcs => dcs.EndPoint.Equals(endpoint));
|
||||
|
|
@ -1001,6 +1005,7 @@ namespace WTelegram
|
|||
_session.DCSessions[TLConfig.this_dc] = _dcSession;
|
||||
}
|
||||
if (_session.MainDC == 0) _session.MainDC = TLConfig.this_dc;
|
||||
else if (needMigrate) await MigrateToDC(_session.MainDC);
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
|
@ -1579,7 +1584,7 @@ namespace WTelegram
|
|||
/// <typeparam name="T">Expected type of the returned object</typeparam>
|
||||
/// <param name="query">TL method structure</param>
|
||||
/// <returns>Wait for the reply and return the resulting object, or throws an RpcException if an error was replied</returns>
|
||||
public async Task<T> Invoke<T>(IMethod<T> query)
|
||||
public virtual async Task<T> Invoke<T>(IMethod<T> query)
|
||||
{
|
||||
if (_dcSession.withoutUpdates && query is not IMethod<Pong> and not IMethod<FutureSalts>)
|
||||
query = new TL.Methods.InvokeWithoutUpdates<T> { query = query };
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace WTelegram
|
|||
static class Convert
|
||||
{
|
||||
internal static string ToHexString(byte[] data) => BitConverter.ToString(data).Replace("-", "");
|
||||
internal static byte[] FromHexString(string hex) => Enumerable.Range(0, hex.Length / 2).Select(i => System.Convert.ToByte(hex.Substring(i * 2, 2), 16)).ToArray();
|
||||
internal static byte[] FromHexString(string hex) => [.. Enumerable.Range(0, hex.Length / 2).Select(i => System.Convert.ToByte(hex.Substring(i * 2, 2), 16))];
|
||||
}
|
||||
public class RandomNumberGenerator
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,12 +32,17 @@ namespace TL
|
|||
{ // update previously full user from min user:
|
||||
// see https://github.com/tdlib/td/blob/master/td/telegram/UserManager.cpp#L2689
|
||||
// and https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/SourceFiles/data/data_session.cpp#L515
|
||||
const User.Flags updated_flags = (User.Flags)0x5DAFE000;
|
||||
const User.Flags2 updated_flags2 = (User.Flags2)0x711;
|
||||
const User.Flags updated_flags = User.Flags.deleted | User.Flags.bot | User.Flags.bot_chat_history |
|
||||
User.Flags.bot_nochats | User.Flags.verified | User.Flags.restricted | User.Flags.has_bot_inline_placeholder |
|
||||
User.Flags.bot_inline_geo | User.Flags.support | User.Flags.scam | User.Flags.fake | User.Flags.bot_attach_menu |
|
||||
User.Flags.premium | User.Flags.has_emoji_status;
|
||||
const User.Flags2 updated_flags2 = User.Flags2.has_usernames | User.Flags2.stories_unavailable |
|
||||
User.Flags2.has_color | User.Flags2.has_profile_color | User.Flags2.contact_require_premium |
|
||||
User.Flags2.bot_business | User.Flags2.bot_has_main_app | User.Flags2.bot_forum_view;
|
||||
// tdlib updated flags: deleted | bot | bot_chat_history | bot_nochats | verified | bot_inline_geo
|
||||
// | support | scam | fake | bot_attach_menu | premium
|
||||
// tdesktop non-updated flags: bot | bot_chat_history | bot_nochats | bot_attach_menu
|
||||
// updated flags2: stories_unavailable (tdlib) | contact_require_premium (tdesktop)
|
||||
// updated flags2: stories_unavailable | main_app | bot_business | bot_forum_view (tdlib) | contact_require_premium (tdesktop)
|
||||
prevUser.flags = (prevUser.flags & ~updated_flags) | (user.flags & updated_flags);
|
||||
prevUser.flags2 = (prevUser.flags2 & ~updated_flags2) | (user.flags2 & updated_flags2);
|
||||
prevUser.first_name ??= user.first_name; // tdlib: not updated ; tdesktop: updated only if unknown
|
||||
|
|
@ -126,10 +131,9 @@ namespace TL
|
|||
/// <summary>Converts a <a href="https://core.telegram.org/bots/api/#markdownv2-style">Markdown text</a> into the (plain text + entities) format used by Telegram messages</summary>
|
||||
/// <param name="_">not used anymore, you can pass null</param>
|
||||
/// <param name="text">[in] The Markdown text<br/>[out] The same (plain) text, stripped of all Markdown notation</param>
|
||||
/// <param name="premium">Generate premium entities if any</param>
|
||||
/// <param name="users">Dictionary used for <c>tg://user?id=</c> notation</param>
|
||||
/// <returns>The array of formatting entities that you can pass (along with the plain text) to <see cref="Client.SendMessageAsync">SendMessageAsync</see> or <see cref="Client.SendMediaAsync">SendMediaAsync</see></returns>
|
||||
public static MessageEntity[] MarkdownToEntities(this Client _, ref string text, bool premium = false, IReadOnlyDictionary<long, User> users = null)
|
||||
public static MessageEntity[] MarkdownToEntities(this Client _, ref string text, IReadOnlyDictionary<long, User> users = null)
|
||||
{
|
||||
var entities = new List<MessageEntity>();
|
||||
MessageEntityBlockquote lastBlockQuote = null;
|
||||
|
|
@ -212,12 +216,18 @@ namespace TL
|
|||
else if (c == ')') break;
|
||||
}
|
||||
textUrl.url = sb.ToString(offset + 2, offset2 - offset - 3);
|
||||
sb.Remove(offset, offset2 - offset);
|
||||
if (textUrl.url.StartsWith("tg://user?id=") && long.TryParse(textUrl.url[13..], out var id) && users?.GetValueOrDefault(id)?.access_hash is long hash)
|
||||
entities[lastIndex] = new InputMessageEntityMentionName { offset = textUrl.offset, length = textUrl.length, user_id = new InputUser(id, hash) };
|
||||
else if ((textUrl.url.StartsWith("tg://emoji?id=") || textUrl.url.StartsWith("emoji?id=")) && long.TryParse(textUrl.url[(textUrl.url.IndexOf('=') + 1)..], out id))
|
||||
if (premium) entities[lastIndex] = new MessageEntityCustomEmoji { offset = textUrl.offset, length = textUrl.length, document_id = id };
|
||||
else entities.RemoveAt(lastIndex);
|
||||
sb.Remove(offset, offset2 - offset);
|
||||
else if (textUrl.url.StartsWith("tg://emoji?id=") && long.TryParse(textUrl.url[14..], out id))
|
||||
entities[lastIndex] = new MessageEntityCustomEmoji { offset = textUrl.offset, length = textUrl.length, document_id = id };
|
||||
else if (textUrl.url.StartsWith("tg://time?unix=") && textUrl.url.IndexOf("&format=", 15) is { } idxFormat)
|
||||
entities[lastIndex] = new MessageEntityFormattedDate
|
||||
{
|
||||
offset = textUrl.offset, length = textUrl.length,
|
||||
date = new DateTime((long.Parse(idxFormat < 0 ? textUrl.url[15..] : textUrl.url[15..idxFormat]) + 62135596800L) * 10000000, DateTimeKind.Utc),
|
||||
flags = idxFormat < 0 ? 0 : HtmlText.DateFlags(textUrl.url[(idxFormat + 8)..])
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -259,9 +269,8 @@ namespace TL
|
|||
/// <param name="client">Client, used only for getting current user ID in case of <c>InputMessageEntityMentionName+InputUserSelf</c></param>
|
||||
/// <param name="message">The plain text, typically obtained from <see cref="Message.message"/></param>
|
||||
/// <param name="entities">The array of formatting entities, typically obtained from <see cref="Message.entities"/></param>
|
||||
/// <param name="premium">Convert premium entities (might lead to non-standard markdown)</param>
|
||||
/// <returns>The message text with MarkdownV2 formattings</returns>
|
||||
public static string EntitiesToMarkdown(this Client client, string message, MessageEntity[] entities, bool premium = false)
|
||||
public static string EntitiesToMarkdown(this Client client, string message, MessageEntity[] entities)
|
||||
{
|
||||
if (entities == null || entities.Length == 0) return Escape(message);
|
||||
var closings = new List<(int offset, string md)>();
|
||||
|
|
@ -296,8 +305,9 @@ namespace TL
|
|||
else if (nextEntity is InputMessageEntityMentionName imemn)
|
||||
closing.md = $"](tg://user?id={imemn.user_id.UserId ?? client.UserId})";
|
||||
else if (nextEntity is MessageEntityCustomEmoji mecu)
|
||||
if (premium) closing.md = $"](tg://emoji?id={mecu.document_id})";
|
||||
else continue;
|
||||
closing.md = $"](tg://emoji?id={mecu.document_id})";
|
||||
else if (nextEntity is MessageEntityFormattedDate mefd)
|
||||
closing.md = $"](tg://time?unix={((DateTimeOffset)mefd.date).ToUnixTimeSeconds()}{(mefd.flags == 0 ? null : $"&format={HtmlText.DateFormat(mefd.flags)}")})";
|
||||
}
|
||||
else if (nextEntity is MessageEntityBlockquote mebq)
|
||||
{ inBlockQuote = true; if (lastCh is not '\n' and not '\0') md = "\n>";
|
||||
|
|
@ -338,6 +348,7 @@ namespace TL
|
|||
[typeof(MessageEntitySpoiler)] = "||",
|
||||
[typeof(MessageEntityCustomEmoji)] = "![",
|
||||
[typeof(MessageEntityBlockquote)] = ">",
|
||||
[typeof(MessageEntityFormattedDate)] = "![",
|
||||
};
|
||||
|
||||
/// <summary>Insert backslashes in front of Markdown reserved characters</summary>
|
||||
|
|
@ -367,10 +378,9 @@ namespace TL
|
|||
/// <summary>Converts an <a href="https://core.telegram.org/bots/api/#html-style">HTML-formatted text</a> into the (plain text + entities) format used by Telegram messages</summary>
|
||||
/// <param name="_">not used anymore, you can pass null</param>
|
||||
/// <param name="text">[in] The HTML-formatted text<br/>[out] The same (plain) text, stripped of all HTML tags</param>
|
||||
/// <param name="premium">Generate premium entities if any</param>
|
||||
/// <param name="users">Dictionary used for <c>tg://user?id=</c> notation</param>
|
||||
/// <returns>The array of formatting entities that you can pass (along with the plain text) to <see cref="Client.SendMessageAsync">SendMessageAsync</see> or <see cref="Client.SendMediaAsync">SendMediaAsync</see></returns>
|
||||
public static MessageEntity[] HtmlToEntities(this Client _, ref string text, bool premium = false, IReadOnlyDictionary<long, User> users = null)
|
||||
public static MessageEntity[] HtmlToEntities(this Client _, ref string text, IReadOnlyDictionary<long, User> users = null)
|
||||
{
|
||||
var entities = new List<MessageEntity>();
|
||||
var sb = new StringBuilder(text);
|
||||
|
|
@ -414,6 +424,7 @@ namespace TL
|
|||
case "code": ProcessEntity<MessageEntityCode>(); break;
|
||||
case "pre": ProcessEntity<MessageEntityPre>(); break;
|
||||
case "tg-emoji" when closing: ProcessEntity<MessageEntityCustomEmoji>(); break;
|
||||
case "tg-time" when closing: ProcessEntity<MessageEntityFormattedDate>(); break;
|
||||
case "blockquote": ProcessEntity<MessageEntityBlockquote>(); break;
|
||||
case "blockquote expandable":
|
||||
entities.Add(new MessageEntityBlockquote { offset = offset, length = -1, flags = MessageEntityBlockquote.Flags.collapsed });
|
||||
|
|
@ -443,8 +454,15 @@ namespace TL
|
|||
if (entities.LastOrDefault(e => e.length == -1) is MessageEntityPre prevEntity)
|
||||
prevEntity.language = tag[21..^1];
|
||||
}
|
||||
else if (premium && (tag.StartsWith("tg-emoji emoji-id=\"") || tag.StartsWith("tg-emoji emoji-id='")))
|
||||
entities.Add(new MessageEntityCustomEmoji { offset = offset, length = -1, document_id = long.Parse(tag[(tag.IndexOf('=') + 2)..^1]) });
|
||||
else if (tag.StartsWith("tg-emoji emoji-id=\"") || tag.StartsWith("tg-emoji emoji-id='"))
|
||||
entities.Add(new MessageEntityCustomEmoji { offset = offset, length = -1, document_id = long.Parse(tag[19..^1]) });
|
||||
else if ((tag.StartsWith("tg-time unix=\"") || tag.StartsWith("tg-time unix='")) && (end = tag.IndexOf(tag[13], 14)) > 0)
|
||||
entities.Add(new MessageEntityFormattedDate
|
||||
{
|
||||
offset = offset, length = -1,
|
||||
date = new DateTime((long.Parse(tag[14..end]) + 62135596800L) * 10000000, DateTimeKind.Utc),
|
||||
flags = string.Compare(tag, end + 1, " format=", 0, 8) == 0 ? DateFlags(tag[(end + 10)..^1]) : 0
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -481,9 +499,8 @@ namespace TL
|
|||
/// <param name="client">Client, used only for getting current user ID in case of <c>InputMessageEntityMentionName+InputUserSelf</c></param>
|
||||
/// <param name="message">The plain text, typically obtained from <see cref="Message.message"/></param>
|
||||
/// <param name="entities">The array of formatting entities, typically obtained from <see cref="Message.entities"/></param>
|
||||
/// <param name="premium">Convert premium entities</param>
|
||||
/// <returns>The message text with HTML formatting tags</returns>
|
||||
public static string EntitiesToHtml(this Client client, string message, MessageEntity[] entities, bool premium = false)
|
||||
public static string EntitiesToHtml(this Client client, string message, MessageEntity[] entities)
|
||||
{
|
||||
if (entities == null || entities.Length == 0) return Escape(message);
|
||||
var closings = new List<(int offset, string tag)>();
|
||||
|
|
@ -514,8 +531,7 @@ namespace TL
|
|||
tag = $"<a href=\"tg://user?id={imemn.user_id.UserId ?? client.UserId}\">";
|
||||
}
|
||||
else if (nextEntity is MessageEntityCustomEmoji mecu)
|
||||
if (premium) tag = $"<tg-emoji emoji-id=\"{mecu.document_id}\">";
|
||||
else continue;
|
||||
tag = $"<tg-emoji emoji-id=\"{mecu.document_id}\">";
|
||||
else if (nextEntity is MessageEntityPre mep && !string.IsNullOrEmpty(mep.language))
|
||||
{
|
||||
closing.Item2 = "</code></pre>";
|
||||
|
|
@ -523,6 +539,8 @@ namespace TL
|
|||
}
|
||||
else if (nextEntity is MessageEntityBlockquote { flags: MessageEntityBlockquote.Flags.collapsed })
|
||||
tag = "<blockquote expandable>";
|
||||
else if (nextEntity is MessageEntityFormattedDate mefd)
|
||||
tag = $"<tg-time unix=\"{((DateTimeOffset)mefd.date).ToUnixTimeSeconds()}\"{(mefd.flags == 0 ? null : $" format=\"{DateFormat(mefd.flags)}\"")}>";
|
||||
else
|
||||
tag = $"<{tag}>";
|
||||
int index = ~closings.BinarySearch(closing, Comparer<(int, string)>.Create((x, y) => x.Item1.CompareTo(y.Item1) | 1));
|
||||
|
|
@ -554,6 +572,7 @@ namespace TL
|
|||
[typeof(MessageEntitySpoiler)] = "tg-spoiler",
|
||||
[typeof(MessageEntityCustomEmoji)] = "tg-emoji",
|
||||
[typeof(MessageEntityBlockquote)] = "blockquote",
|
||||
[typeof(MessageEntityFormattedDate)] = "tg-time",
|
||||
};
|
||||
|
||||
/// <summary>Replace special HTML characters with their &xx; equivalent</summary>
|
||||
|
|
@ -561,5 +580,15 @@ namespace TL
|
|||
/// <returns>The HTML-safe text, ready to be used in <see cref="HtmlToEntities">HtmlToEntities</see> without problems</returns>
|
||||
public static string Escape(string text)
|
||||
=> text?.Replace("&", "&").Replace("<", "<").Replace(">", ">");
|
||||
|
||||
internal static string DateFormat(MessageEntityFormattedDate.Flags flags) => flags.HasFlag(MessageEntityFormattedDate.Flags.relative) ? "r" :
|
||||
((flags & MessageEntityFormattedDate.Flags.day_of_week) != 0 ? "w" : "") +
|
||||
((flags & MessageEntityFormattedDate.Flags.short_date) != 0 ? "d" : "") +
|
||||
((flags & MessageEntityFormattedDate.Flags.long_date) != 0 ? "D" : "") +
|
||||
((flags & MessageEntityFormattedDate.Flags.short_time) != 0 ? "t" : "") +
|
||||
((flags & MessageEntityFormattedDate.Flags.long_time) != 0 ? "T" : "");
|
||||
|
||||
internal static MessageEntityFormattedDate.Flags DateFlags(string format)
|
||||
=> (MessageEntityFormattedDate.Flags)format.Sum(c => 1 << "rtTdDw".IndexOf(c));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,17 +25,17 @@ namespace TL
|
|||
public Int128 server_nonce;
|
||||
public Int256 new_nonce;
|
||||
}
|
||||
[TLDef(0xA9F55F95, inheritBefore = true)] //p_q_inner_data_dc#a9f55f95 pq:bytes p:bytes q:bytes nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data
|
||||
[TLDef(0xA9F55F95, inheritAt = 0)] //p_q_inner_data_dc#a9f55f95 pq:bytes p:bytes q:bytes nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data
|
||||
public sealed partial class PQInnerDataDc : PQInnerData
|
||||
{
|
||||
public int dc;
|
||||
}
|
||||
[TLDef(0x3C6A84D4, inheritBefore = true)] //p_q_inner_data_temp#3c6a84d4 pq:bytes p:bytes q:bytes nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data
|
||||
[TLDef(0x3C6A84D4, inheritAt = 0)] //p_q_inner_data_temp#3c6a84d4 pq:bytes p:bytes q:bytes nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data
|
||||
public sealed partial class PQInnerDataTemp : PQInnerData
|
||||
{
|
||||
public int expires_in;
|
||||
}
|
||||
[TLDef(0x56FDDF88, inheritBefore = true)] //p_q_inner_data_temp_dc#56fddf88 pq:bytes p:bytes q:bytes nonce:int128 server_nonce:int128 new_nonce:int256 dc:int expires_in:int = P_Q_inner_data
|
||||
[TLDef(0x56FDDF88, inheritAt = 0)] //p_q_inner_data_temp_dc#56fddf88 pq:bytes p:bytes q:bytes nonce:int128 server_nonce:int128 new_nonce:int256 dc:int expires_in:int = P_Q_inner_data
|
||||
public sealed partial class PQInnerDataTempDc : PQInnerData
|
||||
{
|
||||
public int dc;
|
||||
|
|
@ -57,12 +57,12 @@ namespace TL
|
|||
public Int128 nonce;
|
||||
public Int128 server_nonce;
|
||||
}
|
||||
[TLDef(0x79CB045D, inheritBefore = true)] //server_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params
|
||||
[TLDef(0x79CB045D, inheritAt = 0)] //server_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params
|
||||
public sealed partial class ServerDHParamsFail : ServerDHParams
|
||||
{
|
||||
public Int128 new_nonce_hash;
|
||||
}
|
||||
[TLDef(0xD0E8075C, inheritBefore = true)] //server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:bytes = Server_DH_Params
|
||||
[TLDef(0xD0E8075C, inheritAt = 0)] //server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:bytes = Server_DH_Params
|
||||
public sealed partial class ServerDHParamsOk : ServerDHParams
|
||||
{
|
||||
public byte[] encrypted_answer;
|
||||
|
|
@ -93,17 +93,17 @@ namespace TL
|
|||
public Int128 nonce;
|
||||
public Int128 server_nonce;
|
||||
}
|
||||
[TLDef(0x3BCBF734, inheritBefore = true)] //dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer
|
||||
[TLDef(0x3BCBF734, inheritAt = 0)] //dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer
|
||||
public sealed partial class DhGenOk : SetClientDHParamsAnswer
|
||||
{
|
||||
public Int128 new_nonce_hash1;
|
||||
}
|
||||
[TLDef(0x46DC1FB9, inheritBefore = true)] //dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer
|
||||
[TLDef(0x46DC1FB9, inheritAt = 0)] //dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer
|
||||
public sealed partial class DhGenRetry : SetClientDHParamsAnswer
|
||||
{
|
||||
public Int128 new_nonce_hash2;
|
||||
}
|
||||
[TLDef(0xA69DAE02, inheritBefore = true)] //dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer
|
||||
[TLDef(0xA69DAE02, inheritAt = 0)] //dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer
|
||||
public sealed partial class DhGenFail : SetClientDHParamsAnswer
|
||||
{
|
||||
public Int128 new_nonce_hash3;
|
||||
|
|
@ -130,7 +130,7 @@ namespace TL
|
|||
public int bad_msg_seqno;
|
||||
public int error_code;
|
||||
}
|
||||
[TLDef(0xEDAB447B, inheritBefore = true)] //bad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification
|
||||
[TLDef(0xEDAB447B, inheritAt = 0)] //bad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification
|
||||
public sealed partial class BadServerSalt : BadMsgNotification
|
||||
{
|
||||
public long new_server_salt;
|
||||
|
|
@ -267,7 +267,7 @@ namespace TL
|
|||
public int ipv4;
|
||||
public int port;
|
||||
}
|
||||
[TLDef(0x37982646, inheritBefore = true)] //ipPortSecret#37982646 ipv4:int port:int secret:bytes = IpPort
|
||||
[TLDef(0x37982646, inheritAt = 0)] //ipPortSecret#37982646 ipv4:int port:int secret:bytes = IpPort
|
||||
public sealed partial class IpPortSecret : IpPort
|
||||
{
|
||||
public byte[] secret;
|
||||
|
|
|
|||
767
src/TL.Schema.cs
767
src/TL.Schema.cs
File diff suppressed because one or more lines are too long
|
|
@ -387,7 +387,7 @@ namespace TL
|
|||
mnc = mnc,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/auth.checkPaidAuth"/></para></summary>
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/auth.checkPaidAuth"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/auth.checkPaidAuth#possible-errors">details</a>)</para></summary>
|
||||
public static Task<Auth_SentCodeBase> Auth_CheckPaidAuth(this Client client, string phone_number, string phone_code_hash, long form_id)
|
||||
=> client.Invoke(new Auth_CheckPaidAuth
|
||||
{
|
||||
|
|
@ -396,6 +396,24 @@ namespace TL
|
|||
form_id = form_id,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/auth.initPasskeyLogin"/></para> <para>Possible <see cref="RpcException"/> codes: 400,500 (<a href="https://corefork.telegram.org/method/auth.initPasskeyLogin#possible-errors">details</a>)</para></summary>
|
||||
public static Task<Auth_PasskeyLoginOptions> Auth_InitPasskeyLogin(this Client client, int api_id, string api_hash)
|
||||
=> client.Invoke(new Auth_InitPasskeyLogin
|
||||
{
|
||||
api_id = api_id,
|
||||
api_hash = api_hash,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/auth.finishPasskeyLogin"/></para> <para>Possible <see cref="RpcException"/> codes: 400,500 (<a href="https://corefork.telegram.org/method/auth.finishPasskeyLogin#possible-errors">details</a>)</para></summary>
|
||||
public static Task<Auth_AuthorizationBase> Auth_FinishPasskeyLogin(this Client client, InputPasskeyCredential credential, int? from_dc_id = null, long? from_auth_key_id = null)
|
||||
=> client.Invoke(new Auth_FinishPasskeyLogin
|
||||
{
|
||||
flags = (Auth_FinishPasskeyLogin.Flags)((from_dc_id != null ? 0x1 : 0) | (from_auth_key_id != null ? 0x1 : 0)),
|
||||
credential = credential,
|
||||
from_dc_id = from_dc_id ?? default,
|
||||
from_auth_key_id = from_auth_key_id ?? default,
|
||||
});
|
||||
|
||||
/// <summary>Register device to receive <a href="https://corefork.telegram.org/api/push-updates">PUSH notifications</a> <para>See <a href="https://corefork.telegram.org/method/account.registerDevice"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/account.registerDevice#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="no_muted">Avoid receiving (silent and invisible background) notifications. Useful to save battery.</param>
|
||||
/// <param name="token_type">Device token type, see <a href="https://corefork.telegram.org/api/push-updates#subscribing-to-notifications">PUSH updates</a> for the possible values.</param>
|
||||
|
|
@ -1510,6 +1528,32 @@ namespace TL
|
|||
hash = hash,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.initPasskeyRegistration"/></para> <para>Possible <see cref="RpcException"/> codes: 403 (<a href="https://corefork.telegram.org/method/account.initPasskeyRegistration#possible-errors">details</a>)</para></summary>
|
||||
public static Task<Account_PasskeyRegistrationOptions> Account_InitPasskeyRegistration(this Client client)
|
||||
=> client.Invoke(new Account_InitPasskeyRegistration
|
||||
{
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.registerPasskey"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/account.registerPasskey#possible-errors">details</a>)</para></summary>
|
||||
public static Task<Passkey> Account_RegisterPasskey(this Client client, InputPasskeyCredential credential)
|
||||
=> client.Invoke(new Account_RegisterPasskey
|
||||
{
|
||||
credential = credential,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.getPasskeys"/></para></summary>
|
||||
public static Task<Account_Passkeys> Account_GetPasskeys(this Client client)
|
||||
=> client.Invoke(new Account_GetPasskeys
|
||||
{
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.deletePasskey"/></para></summary>
|
||||
public static Task<bool> Account_DeletePasskey(this Client client, string id)
|
||||
=> client.Invoke(new Account_DeletePasskey
|
||||
{
|
||||
id = id,
|
||||
});
|
||||
|
||||
/// <summary>Returns basic user info according to their identifiers. <para>See <a href="https://corefork.telegram.org/method/users.getUsers"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/users.getUsers#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="id">List of user identifiers</param>
|
||||
public static Task<UserBase[]> Users_GetUsers(this Client client, params InputUserBase[] id)
|
||||
|
|
@ -1544,7 +1588,7 @@ namespace TL
|
|||
id = id,
|
||||
});
|
||||
|
||||
/// <summary>Get songs <a href="https://corefork.telegram.org/api/profile#music">pinned to the user's profile, see here »</a> for more info. <para>See <a href="https://corefork.telegram.org/method/users.getSavedMusic"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/users.getSavedMusic#possible-errors">details</a>)</para></summary>
|
||||
/// <summary>Get songs <a href="https://corefork.telegram.org/api/profile#music">pinned to the user's profile, see here »</a> for more info. <para>See <a href="https://corefork.telegram.org/method/users.getSavedMusic"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/users.getSavedMusic#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="id">The ID of the user.</param>
|
||||
/// <param name="offset">Offset for pagination.</param>
|
||||
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
|
||||
|
|
@ -1568,7 +1612,7 @@ namespace TL
|
|||
documents = documents,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/users.suggestBirthday"/></para></summary>
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/users.suggestBirthday"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/users.suggestBirthday#possible-errors">details</a>)</para></summary>
|
||||
public static Task<UpdatesBase> Users_SuggestBirthday(this Client client, InputUserBase id, Birthday birthday)
|
||||
=> client.Invoke(new Users_SuggestBirthday
|
||||
{
|
||||
|
|
@ -1835,7 +1879,7 @@ namespace TL
|
|||
q = q,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/contacts.updateContactNote"/></para></summary>
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/contacts.updateContactNote"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/contacts.updateContactNote#possible-errors">details</a>)</para></summary>
|
||||
public static Task<bool> Contacts_UpdateContactNote(this Client client, InputUserBase id, TextWithEntities note)
|
||||
=> client.Invoke(new Contacts_UpdateContactNote
|
||||
{
|
||||
|
|
@ -1871,7 +1915,7 @@ namespace TL
|
|||
hash = hash,
|
||||
});
|
||||
|
||||
/// <summary>Returns the conversation history with one interlocutor / within a chat <para>See <a href="https://corefork.telegram.org/method/messages.getHistory"/></para> <para>Possible <see cref="RpcException"/> codes: 400,406 (<a href="https://corefork.telegram.org/method/messages.getHistory#possible-errors">details</a>)</para></summary>
|
||||
/// <summary>Returns the conversation history with one interlocutor / within a chat <para>See <a href="https://corefork.telegram.org/method/messages.getHistory"/></para> <para>Possible <see cref="RpcException"/> codes: 400,406,500 (<a href="https://corefork.telegram.org/method/messages.getHistory#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="peer">Target peer</param>
|
||||
/// <param name="offset_id">Only return messages starting from the specified message ID</param>
|
||||
/// <param name="offset_date">Only return messages sent before the specified date</param>
|
||||
|
|
@ -2089,10 +2133,10 @@ namespace TL
|
|||
/// <param name="video_timestamp">Start playing the video at the specified timestamp (seconds).</param>
|
||||
/// <param name="allow_paid_stars">For <a href="https://corefork.telegram.org/api/paid-messages">paid messages »</a>, specifies the amount of <a href="https://corefork.telegram.org/api/stars">Telegram Stars</a> the user has agreed to pay in order to send the message.</param>
|
||||
/// <param name="suggested_post">Used to <a href="https://corefork.telegram.org/api/suggested-posts">suggest a post to a channel, see here »</a> for more info on the full flow.</param>
|
||||
public static Task<UpdatesBase> 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, int? video_timestamp = null, long? allow_paid_stars = null, InputReplyTo reply_to = null, SuggestedPost suggested_post = null, int? schedule_repeat_period = null, bool silent = false, bool background = false, bool with_my_score = false, bool drop_author = false, bool drop_media_captions = false, bool noforwards = false, bool allow_paid_floodskip = false)
|
||||
public static Task<UpdatesBase> 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, long? effect = null, int? video_timestamp = null, long? allow_paid_stars = null, InputReplyTo reply_to = null, SuggestedPost suggested_post = null, int? schedule_repeat_period = null, bool silent = false, bool background = false, bool with_my_score = false, bool drop_author = false, bool drop_media_captions = false, bool noforwards = false, bool allow_paid_floodskip = 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) | (quick_reply_shortcut != null ? 0x20000 : 0) | (video_timestamp != null ? 0x100000 : 0) | (allow_paid_stars != null ? 0x200000 : 0) | (reply_to != null ? 0x400000 : 0) | (suggested_post != null ? 0x800000 : 0) | (schedule_repeat_period != null ? 0x1000000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (with_my_score ? 0x100 : 0) | (drop_author ? 0x800 : 0) | (drop_media_captions ? 0x1000 : 0) | (noforwards ? 0x4000 : 0) | (allow_paid_floodskip ? 0x80000 : 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) | (effect != null ? 0x40000 : 0) | (video_timestamp != null ? 0x100000 : 0) | (allow_paid_stars != null ? 0x200000 : 0) | (reply_to != null ? 0x400000 : 0) | (suggested_post != null ? 0x800000 : 0) | (schedule_repeat_period != null ? 0x1000000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (with_my_score ? 0x100 : 0) | (drop_author ? 0x800 : 0) | (drop_media_captions ? 0x1000 : 0) | (noforwards ? 0x4000 : 0) | (allow_paid_floodskip ? 0x80000 : 0)),
|
||||
from_peer = from_peer,
|
||||
id = id,
|
||||
random_id = random_id,
|
||||
|
|
@ -2103,6 +2147,7 @@ namespace TL
|
|||
schedule_repeat_period = schedule_repeat_period ?? default,
|
||||
send_as = send_as,
|
||||
quick_reply_shortcut = quick_reply_shortcut,
|
||||
effect = effect ?? default,
|
||||
video_timestamp = video_timestamp ?? default,
|
||||
allow_paid_stars = allow_paid_stars ?? default,
|
||||
suggested_post = suggested_post,
|
||||
|
|
@ -2198,7 +2243,7 @@ namespace TL
|
|||
user_id = user_id,
|
||||
});
|
||||
|
||||
/// <summary>Creates a new chat. <para>See <a href="https://corefork.telegram.org/method/messages.createChat"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403,500 (<a href="https://corefork.telegram.org/method/messages.createChat#possible-errors">details</a>)</para></summary>
|
||||
/// <summary>Creates a new chat. <para>See <a href="https://corefork.telegram.org/method/messages.createChat"/></para> <para>Possible <see cref="RpcException"/> codes: 400,406,500 (<a href="https://corefork.telegram.org/method/messages.createChat#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="users">List of user IDs to be invited</param>
|
||||
/// <param name="title">Chat name</param>
|
||||
/// <param name="ttl_period">Time-to-live of all messages that will be sent in the chat: once message.date+message.ttl_period === time(), the message will be deleted on the server, and must be deleted locally as well. You can use <see cref="Messages_SetDefaultHistoryTTL">Messages_SetDefaultHistoryTTL</see> to edit this value later.</param>
|
||||
|
|
@ -2245,7 +2290,7 @@ namespace TL
|
|||
key_fingerprint = key_fingerprint,
|
||||
});
|
||||
|
||||
/// <summary>Cancels a request for creation and/or delete info on secret chat. <para>See <a href="https://corefork.telegram.org/method/messages.discardEncryption"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.discardEncryption#possible-errors">details</a>)</para></summary>
|
||||
/// <summary>Cancels a request for creation and/or delete info on secret chat. <para>See <a href="https://corefork.telegram.org/method/messages.discardEncryption"/></para> <para>Possible <see cref="RpcException"/> codes: 400,500 (<a href="https://corefork.telegram.org/method/messages.discardEncryption#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="delete_history">Whether to delete the entire chat history for the other user as well</param>
|
||||
/// <param name="chat_id">Secret chat ID</param>
|
||||
public static Task<bool> Messages_DiscardEncryption(this Client client, int chat_id, bool delete_history = false)
|
||||
|
|
@ -3040,7 +3085,7 @@ namespace TL
|
|||
hash = hash,
|
||||
});
|
||||
|
||||
/// <summary>Send an <a href="https://corefork.telegram.org/api/files#albums-grouped-media">album or grouped media</a> <para>See <a href="https://corefork.telegram.org/method/messages.sendMultiMedia"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400,403,420,500 (<a href="https://corefork.telegram.org/method/messages.sendMultiMedia#possible-errors">details</a>)</para></summary>
|
||||
/// <summary>Send an <a href="https://corefork.telegram.org/api/files#albums-grouped-media">album or grouped media</a> <para>See <a href="https://corefork.telegram.org/method/messages.sendMultiMedia"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400,403,406,420,500 (<a href="https://corefork.telegram.org/method/messages.sendMultiMedia#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="silent">Whether to send the album silently (no notification triggered)</param>
|
||||
/// <param name="background">Send in background?</param>
|
||||
/// <param name="clear_draft">Whether to clear <a href="https://corefork.telegram.org/api/drafts">drafts</a></param>
|
||||
|
|
@ -3246,14 +3291,15 @@ namespace TL
|
|||
/// <param name="button_id">The ID of the button with the authorization request</param>
|
||||
/// <param name="url">URL used for <a href="https://corefork.telegram.org/api/url-authorization#link-url-authorization">link URL authorization, click here for more info »</a></param>
|
||||
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/urlAuthResultDefault">urlAuthResultDefault</a></returns>
|
||||
public static Task<UrlAuthResult> Messages_RequestUrlAuth(this Client client, InputPeer peer = null, int? msg_id = null, int? button_id = null, string url = null)
|
||||
public static Task<UrlAuthResult> Messages_RequestUrlAuth(this Client client, InputPeer peer = null, int? msg_id = null, int? button_id = null, string url = null, string in_app_origin = null)
|
||||
=> client.Invoke(new Messages_RequestUrlAuth
|
||||
{
|
||||
flags = (Messages_RequestUrlAuth.Flags)((peer != null ? 0x2 : 0) | (msg_id != null ? 0x2 : 0) | (button_id != null ? 0x2 : 0) | (url != null ? 0x4 : 0)),
|
||||
flags = (Messages_RequestUrlAuth.Flags)((peer != null ? 0x2 : 0) | (msg_id != null ? 0x2 : 0) | (button_id != null ? 0x2 : 0) | (url != null ? 0x4 : 0) | (in_app_origin != null ? 0x8 : 0)),
|
||||
peer = peer,
|
||||
msg_id = msg_id ?? default,
|
||||
button_id = button_id ?? default,
|
||||
url = url,
|
||||
in_app_origin = in_app_origin,
|
||||
});
|
||||
|
||||
/// <summary>Use this to accept a Seamless Telegram Login authorization request, for more info <a href="https://corefork.telegram.org/api/url-authorization">click here »</a> <para>See <a href="https://corefork.telegram.org/method/messages.acceptUrlAuth"/></para></summary>
|
||||
|
|
@ -3263,14 +3309,15 @@ namespace TL
|
|||
/// <param name="button_id">ID of the login button</param>
|
||||
/// <param name="url">URL used for <a href="https://corefork.telegram.org/api/url-authorization#link-url-authorization">link URL authorization, click here for more info »</a></param>
|
||||
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/urlAuthResultDefault">urlAuthResultDefault</a></returns>
|
||||
public static Task<UrlAuthResult> Messages_AcceptUrlAuth(this Client client, InputPeer peer = null, int? msg_id = null, int? button_id = null, string url = null, bool write_allowed = false)
|
||||
public static Task<UrlAuthResult> Messages_AcceptUrlAuth(this Client client, InputPeer peer = null, int? msg_id = null, int? button_id = null, string url = null, string match_code = null, bool write_allowed = false, bool share_phone_number = false)
|
||||
=> client.Invoke(new Messages_AcceptUrlAuth
|
||||
{
|
||||
flags = (Messages_AcceptUrlAuth.Flags)((peer != null ? 0x2 : 0) | (msg_id != null ? 0x2 : 0) | (button_id != null ? 0x2 : 0) | (url != null ? 0x4 : 0) | (write_allowed ? 0x1 : 0)),
|
||||
flags = (Messages_AcceptUrlAuth.Flags)((peer != null ? 0x2 : 0) | (msg_id != null ? 0x2 : 0) | (button_id != null ? 0x2 : 0) | (url != null ? 0x4 : 0) | (match_code != null ? 0x10 : 0) | (write_allowed ? 0x1 : 0) | (share_phone_number ? 0x8 : 0)),
|
||||
peer = peer,
|
||||
msg_id = msg_id ?? default,
|
||||
button_id = button_id ?? default,
|
||||
url = url,
|
||||
match_code = match_code,
|
||||
});
|
||||
|
||||
/// <summary>Should be called after the user hides the <a href="https://corefork.telegram.org/api/action-bar">report spam/add as contact bar</a> of a new chat, effectively prevents the user from executing the actions specified in the <a href="https://corefork.telegram.org/api/action-bar">action bar »</a>. <para>See <a href="https://corefork.telegram.org/method/messages.hidePeerSettingsBar"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.hidePeerSettingsBar#possible-errors">details</a>)</para></summary>
|
||||
|
|
@ -3709,11 +3756,13 @@ namespace TL
|
|||
/// <summary>Enable or disable <a href="https://telegram.org/blog/protected-content-delete-by-date-and-more">content protection</a> on a channel or chat <para>See <a href="https://corefork.telegram.org/method/messages.toggleNoForwards"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.toggleNoForwards#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="peer">The chat or channel</param>
|
||||
/// <param name="enabled">Enable or disable content protection</param>
|
||||
public static Task<UpdatesBase> Messages_ToggleNoForwards(this Client client, InputPeer peer, bool enabled)
|
||||
public static Task<UpdatesBase> Messages_ToggleNoForwards(this Client client, InputPeer peer, bool enabled, int? request_msg_id = null)
|
||||
=> client.Invoke(new Messages_ToggleNoForwards
|
||||
{
|
||||
flags = (Messages_ToggleNoForwards.Flags)(request_msg_id != null ? 0x1 : 0),
|
||||
peer = peer,
|
||||
enabled = enabled,
|
||||
request_msg_id = request_msg_id ?? default,
|
||||
});
|
||||
|
||||
/// <summary>Change the default peer that should be used when sending messages, reactions, poll votes to a specific group <para>See <a href="https://corefork.telegram.org/method/messages.saveDefaultSendAs"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.saveDefaultSendAs#possible-errors">details</a>)</para></summary>
|
||||
|
|
@ -4812,6 +4861,62 @@ namespace TL
|
|||
top_msg_id = top_msg_id,
|
||||
}, peer is InputPeerChannel ipc ? ipc.channel_id : 0);
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getEmojiGameInfo"/></para></summary>
|
||||
public static Task<Messages_EmojiGameInfo> Messages_GetEmojiGameInfo(this Client client)
|
||||
=> client.Invoke(new Messages_GetEmojiGameInfo
|
||||
{
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.summarizeText"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.summarizeText#possible-errors">details</a>)</para></summary>
|
||||
public static Task<TextWithEntities> Messages_SummarizeText(this Client client, InputPeer peer, int id, string to_lang = null)
|
||||
=> client.Invoke(new Messages_SummarizeText
|
||||
{
|
||||
flags = (Messages_SummarizeText.Flags)(to_lang != null ? 0x1 : 0),
|
||||
peer = peer,
|
||||
id = id,
|
||||
to_lang = to_lang,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.editChatCreator"/> [bots: ✓]</para></summary>
|
||||
public static Task<UpdatesBase> Messages_EditChatCreator(this Client client, InputPeer peer, InputUserBase user_id, InputCheckPasswordSRP password)
|
||||
=> client.Invoke(new Messages_EditChatCreator
|
||||
{
|
||||
peer = peer,
|
||||
user_id = user_id,
|
||||
password = password,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getFutureChatCreatorAfterLeave"/> [bots: ✓]</para></summary>
|
||||
public static Task<UserBase> Messages_GetFutureChatCreatorAfterLeave(this Client client, InputPeer peer)
|
||||
=> client.Invoke(new Messages_GetFutureChatCreatorAfterLeave
|
||||
{
|
||||
peer = peer,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.editChatParticipantRank"/> [bots: ✓]</para></summary>
|
||||
public static Task<UpdatesBase> Messages_EditChatParticipantRank(this Client client, InputPeer peer, InputPeer participant, string rank)
|
||||
=> client.Invoke(new Messages_EditChatParticipantRank
|
||||
{
|
||||
peer = peer,
|
||||
participant = participant,
|
||||
rank = rank,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.declineUrlAuth"/> [bots: ✓]</para></summary>
|
||||
public static Task<bool> Messages_DeclineUrlAuth(this Client client, string url)
|
||||
=> client.Invoke(new Messages_DeclineUrlAuth
|
||||
{
|
||||
url = url,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.checkUrlAuthMatchCode"/> [bots: ✓]</para></summary>
|
||||
public static Task<bool> Messages_CheckUrlAuthMatchCode(this Client client, string url, string match_code)
|
||||
=> client.Invoke(new Messages_CheckUrlAuthMatchCode
|
||||
{
|
||||
url = url,
|
||||
match_code = match_code,
|
||||
});
|
||||
|
||||
/// <summary>Returns a current state of updates. <para>See <a href="https://corefork.telegram.org/method/updates.getState"/> [bots: ✓]</para></summary>
|
||||
public static Task<Updates_State> Updates_GetState(this Client client)
|
||||
=> client.Invoke(new Updates_GetState
|
||||
|
|
@ -5306,7 +5411,7 @@ namespace TL
|
|||
channel = channel,
|
||||
});
|
||||
|
||||
/// <summary>Create a <a href="https://corefork.telegram.org/api/channel">supergroup/channel</a>. <para>See <a href="https://corefork.telegram.org/method/channels.createChannel"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403,500 (<a href="https://corefork.telegram.org/method/channels.createChannel#possible-errors">details</a>)</para></summary>
|
||||
/// <summary>Create a <a href="https://corefork.telegram.org/api/channel">supergroup/channel</a>. <para>See <a href="https://corefork.telegram.org/method/channels.createChannel"/></para> <para>Possible <see cref="RpcException"/> codes: 400,406,500 (<a href="https://corefork.telegram.org/method/channels.createChannel#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="broadcast">Whether to create a <a href="https://corefork.telegram.org/api/channel">channel</a></param>
|
||||
/// <param name="megagroup">Whether to create a <a href="https://corefork.telegram.org/api/channel">supergroup</a></param>
|
||||
/// <param name="for_import">Whether the supergroup is being created to import messages from a foreign chat service using <see cref="Messages_InitHistoryImport">Messages_InitHistoryImport</see></param>
|
||||
|
|
@ -5332,9 +5437,10 @@ namespace TL
|
|||
/// <param name="user_id">The ID of the user whose admin rights should be modified</param>
|
||||
/// <param name="admin_rights">The admin rights</param>
|
||||
/// <param name="rank">Indicates the role (rank) of the admin in the group: just an arbitrary string</param>
|
||||
public static Task<UpdatesBase> Channels_EditAdmin(this Client client, InputChannelBase channel, InputUserBase user_id, ChatAdminRights admin_rights, string rank)
|
||||
public static Task<UpdatesBase> Channels_EditAdmin(this Client client, InputChannelBase channel, InputUserBase user_id, ChatAdminRights admin_rights, string rank = null)
|
||||
=> client.Invoke(new Channels_EditAdmin
|
||||
{
|
||||
flags = (Channels_EditAdmin.Flags)(rank != null ? 0x1 : 0),
|
||||
channel = channel,
|
||||
user_id = user_id,
|
||||
admin_rights = admin_rights,
|
||||
|
|
@ -5548,18 +5654,6 @@ namespace TL
|
|||
group = group,
|
||||
});
|
||||
|
||||
/// <summary>Transfer channel ownership <para>See <a href="https://corefork.telegram.org/method/channels.editCreator"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403 (<a href="https://corefork.telegram.org/method/channels.editCreator#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="channel">Channel</param>
|
||||
/// <param name="user_id">New channel owner</param>
|
||||
/// <param name="password"><a href="https://corefork.telegram.org/api/srp">2FA password</a> of account</param>
|
||||
public static Task<UpdatesBase> Channels_EditCreator(this Client client, InputChannelBase channel, InputUserBase user_id, InputCheckPasswordSRP password)
|
||||
=> client.Invoke(new Channels_EditCreator
|
||||
{
|
||||
channel = channel,
|
||||
user_id = user_id,
|
||||
password = password,
|
||||
});
|
||||
|
||||
/// <summary>Edit location of geogroup, see <a href="https://corefork.telegram.org/api/nearby">here »</a> for more info on geogroups. <para>See <a href="https://corefork.telegram.org/method/channels.editLocation"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/channels.editLocation#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="channel"><a href="https://corefork.telegram.org/api/channel">Geogroup</a></param>
|
||||
/// <param name="geo_point">New geolocation</param>
|
||||
|
|
@ -5781,7 +5875,7 @@ namespace TL
|
|||
restricted = restricted,
|
||||
});
|
||||
|
||||
/// <summary>Globally search for posts from public <a href="https://corefork.telegram.org/api/channel">channels »</a> (<em>including</em> those we aren't a member of) containing either a specific hashtag, <em>or</em> a full text query. <para>See <a href="https://corefork.telegram.org/method/channels.searchPosts"/></para> <para>Possible <see cref="RpcException"/> codes: 420 (<a href="https://corefork.telegram.org/method/channels.searchPosts#possible-errors">details</a>)</para></summary>
|
||||
/// <summary>Globally search for posts from public <a href="https://corefork.telegram.org/api/channel">channels »</a> (<em>including</em> those we aren't a member of) containing either a specific hashtag, <em>or</em> a full text query. <para>See <a href="https://corefork.telegram.org/method/channels.searchPosts"/></para> <para>Possible <see cref="RpcException"/> codes: 403,420 (<a href="https://corefork.telegram.org/method/channels.searchPosts#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="hashtag">The hashtag to search, without the <c>#</c> character.</param>
|
||||
/// <param name="query">The full text query: each user has a limited amount of free full text search slots, after which payment is required, see <a href="https://corefork.telegram.org/api/search#posts-tab">here »</a> for more info on the full flow.</param>
|
||||
/// <param name="offset_rate">Initially 0, then set to the <see cref="Messages_MessagesSlice"><c>next_rate</c> parameter of messages.messagesSlice</see>, or if that is absent, the <c>date</c> of the last returned message.</param>
|
||||
|
|
@ -6606,7 +6700,7 @@ namespace TL
|
|||
slug = slug,
|
||||
});
|
||||
|
||||
/// <summary>Fetch the full list of <a href="https://corefork.telegram.org/api/gifts">gifts</a> owned by a peer. <para>See <a href="https://corefork.telegram.org/method/payments.getSavedStarGifts"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/payments.getSavedStarGifts#possible-errors">details</a>)</para></summary>
|
||||
/// <summary>Fetch the full list of <a href="https://corefork.telegram.org/api/gifts">gifts</a> owned by a peer. <para>See <a href="https://corefork.telegram.org/method/payments.getSavedStarGifts"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/payments.getSavedStarGifts#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="exclude_unsaved">Exclude gifts not pinned on the profile.</param>
|
||||
/// <param name="exclude_saved">Exclude gifts pinned on the profile.</param>
|
||||
/// <param name="exclude_unlimited">Exclude gifts that do not have the <see cref="StarGift"/>.<c>limited</c> flag set.</param>
|
||||
|
|
@ -6682,10 +6776,10 @@ namespace TL
|
|||
/// <param name="attributes">Optionally filter gifts with the specified attributes. If no attributes of a specific type are specified, all attributes of that type are allowed.</param>
|
||||
/// <param name="offset">Offset for pagination. If not equal to an empty string, <see cref="Payments_ResaleStarGifts"/>.<c>counters</c> will not be set to avoid returning the counters every time a new page is fetched.</param>
|
||||
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
|
||||
public static Task<Payments_ResaleStarGifts> Payments_GetResaleStarGifts(this Client client, long gift_id, string offset, int limit = int.MaxValue, long? attributes_hash = null, StarGiftAttributeId[] attributes = null, bool sort_by_price = false, bool sort_by_num = false)
|
||||
public static Task<Payments_ResaleStarGifts> Payments_GetResaleStarGifts(this Client client, long gift_id, string offset, int limit = int.MaxValue, long? attributes_hash = null, StarGiftAttributeId[] attributes = null, bool sort_by_price = false, bool sort_by_num = false, bool for_craft = false)
|
||||
=> client.Invoke(new Payments_GetResaleStarGifts
|
||||
{
|
||||
flags = (Payments_GetResaleStarGifts.Flags)((attributes_hash != null ? 0x1 : 0) | (attributes != null ? 0x8 : 0) | (sort_by_price ? 0x2 : 0) | (sort_by_num ? 0x4 : 0)),
|
||||
flags = (Payments_GetResaleStarGifts.Flags)((attributes_hash != null ? 0x1 : 0) | (attributes != null ? 0x8 : 0) | (sort_by_price ? 0x2 : 0) | (sort_by_num ? 0x4 : 0) | (for_craft ? 0x10 : 0)),
|
||||
attributes_hash = attributes_hash ?? default,
|
||||
gift_id = gift_id,
|
||||
attributes = attributes,
|
||||
|
|
@ -6781,7 +6875,7 @@ namespace TL
|
|||
gift_id = gift_id,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.getStarGiftAuctionState"/></para></summary>
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.getStarGiftAuctionState"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/payments.getStarGiftAuctionState#possible-errors">details</a>)</para></summary>
|
||||
public static Task<Payments_StarGiftAuctionState> Payments_GetStarGiftAuctionState(this Client client, InputStarGiftAuctionBase auction, int version)
|
||||
=> client.Invoke(new Payments_GetStarGiftAuctionState
|
||||
{
|
||||
|
|
@ -6789,7 +6883,7 @@ namespace TL
|
|||
version = version,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.getStarGiftAuctionAcquiredGifts"/></para></summary>
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.getStarGiftAuctionAcquiredGifts"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/payments.getStarGiftAuctionAcquiredGifts#possible-errors">details</a>)</para></summary>
|
||||
public static Task<Payments_StarGiftAuctionAcquiredGifts> Payments_GetStarGiftAuctionAcquiredGifts(this Client client, long gift_id)
|
||||
=> client.Invoke(new Payments_GetStarGiftAuctionAcquiredGifts
|
||||
{
|
||||
|
|
@ -6804,6 +6898,52 @@ namespace TL
|
|||
hash = hash,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.resolveStarGiftOffer"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/payments.resolveStarGiftOffer#possible-errors">details</a>)</para></summary>
|
||||
public static Task<UpdatesBase> Payments_ResolveStarGiftOffer(this Client client, int offer_msg_id, bool decline = false)
|
||||
=> client.Invoke(new Payments_ResolveStarGiftOffer
|
||||
{
|
||||
flags = (Payments_ResolveStarGiftOffer.Flags)(decline ? 0x1 : 0),
|
||||
offer_msg_id = offer_msg_id,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.sendStarGiftOffer"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/payments.sendStarGiftOffer#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="random_id"> <para>You can use <see cref="WTelegram.Helpers.RandomLong"/></para></param>
|
||||
public static Task<UpdatesBase> Payments_SendStarGiftOffer(this Client client, InputPeer peer, string slug, StarsAmountBase price, int duration, long random_id, long? allow_paid_stars = null)
|
||||
=> client.Invoke(new Payments_SendStarGiftOffer
|
||||
{
|
||||
flags = (Payments_SendStarGiftOffer.Flags)(allow_paid_stars != null ? 0x1 : 0),
|
||||
peer = peer,
|
||||
slug = slug,
|
||||
price = price,
|
||||
duration = duration,
|
||||
random_id = random_id,
|
||||
allow_paid_stars = allow_paid_stars ?? default,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.getStarGiftUpgradeAttributes"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/payments.getStarGiftUpgradeAttributes#possible-errors">details</a>)</para></summary>
|
||||
public static Task<Payments_StarGiftUpgradeAttributes> Payments_GetStarGiftUpgradeAttributes(this Client client, long gift_id)
|
||||
=> client.Invoke(new Payments_GetStarGiftUpgradeAttributes
|
||||
{
|
||||
gift_id = gift_id,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.getCraftStarGifts"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/payments.getCraftStarGifts#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
|
||||
public static Task<Payments_SavedStarGifts> Payments_GetCraftStarGifts(this Client client, long gift_id, string offset, int limit = int.MaxValue)
|
||||
=> client.Invoke(new Payments_GetCraftStarGifts
|
||||
{
|
||||
gift_id = gift_id,
|
||||
offset = offset,
|
||||
limit = limit,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.craftStarGift"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/payments.craftStarGift#possible-errors">details</a>)</para></summary>
|
||||
public static Task<UpdatesBase> Payments_CraftStarGift(this Client client, params InputSavedStarGift[] stargift)
|
||||
=> client.Invoke(new Payments_CraftStarGift
|
||||
{
|
||||
stargift = stargift,
|
||||
});
|
||||
|
||||
/// <summary>Create a stickerset. <para>See <a href="https://corefork.telegram.org/method/stickers.createStickerSet"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/stickers.createStickerSet#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="masks">Whether this is a mask stickerset</param>
|
||||
/// <param name="emojis">Whether this is a <a href="https://corefork.telegram.org/api/custom-emoji">custom emoji</a> stickerset.</param>
|
||||
|
|
@ -6940,7 +7080,7 @@ namespace TL
|
|||
{
|
||||
});
|
||||
|
||||
/// <summary>Start a telegram phone call <para>See <a href="https://corefork.telegram.org/method/phone.requestCall"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403 (<a href="https://corefork.telegram.org/method/phone.requestCall#possible-errors">details</a>)</para></summary>
|
||||
/// <summary>Start a telegram phone call <para>See <a href="https://corefork.telegram.org/method/phone.requestCall"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403,500 (<a href="https://corefork.telegram.org/method/phone.requestCall#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="video">Whether to start a video call</param>
|
||||
/// <param name="user_id">Destination of the phone call</param>
|
||||
/// <param name="random_id">Random ID to avoid resending the same object</param>
|
||||
|
|
@ -7056,7 +7196,7 @@ namespace TL
|
|||
schedule_date = schedule_date ?? default,
|
||||
});
|
||||
|
||||
/// <summary>Join a group call <para>See <a href="https://corefork.telegram.org/method/phone.joinGroupCall"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403 (<a href="https://corefork.telegram.org/method/phone.joinGroupCall#possible-errors">details</a>)</para></summary>
|
||||
/// <summary>Join a group call <para>See <a href="https://corefork.telegram.org/method/phone.joinGroupCall"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403,500 (<a href="https://corefork.telegram.org/method/phone.joinGroupCall#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="muted">If set, the user will be muted by default upon joining.</param>
|
||||
/// <param name="video_stopped">If set, the user's video will be disabled by default upon joining.</param>
|
||||
/// <param name="call">The group call</param>
|
||||
|
|
@ -7373,7 +7513,8 @@ namespace TL
|
|||
limit = limit,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/phone.sendGroupCallMessage"/></para></summary>
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/phone.sendGroupCallMessage"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/phone.sendGroupCallMessage#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="random_id"> <para>You can use <see cref="WTelegram.Helpers.RandomLong"/></para></param>
|
||||
public static Task<UpdatesBase> Phone_SendGroupCallMessage(this Client client, InputGroupCallBase call, long random_id, TextWithEntities message, long? allow_paid_stars = null, InputPeer send_as = null)
|
||||
=> client.Invoke(new Phone_SendGroupCallMessage
|
||||
{
|
||||
|
|
@ -7385,7 +7526,7 @@ namespace TL
|
|||
send_as = send_as,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/phone.sendGroupCallEncryptedMessage"/></para></summary>
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/phone.sendGroupCallEncryptedMessage"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/phone.sendGroupCallEncryptedMessage#possible-errors">details</a>)</para></summary>
|
||||
public static Task<bool> Phone_SendGroupCallEncryptedMessage(this Client client, InputGroupCallBase call, byte[] encrypted_message)
|
||||
=> client.Invoke(new Phone_SendGroupCallEncryptedMessage
|
||||
{
|
||||
|
|
@ -7393,7 +7534,7 @@ namespace TL
|
|||
encrypted_message = encrypted_message,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/phone.deleteGroupCallMessages"/></para></summary>
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/phone.deleteGroupCallMessages"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/phone.deleteGroupCallMessages#possible-errors">details</a>)</para></summary>
|
||||
public static Task<UpdatesBase> Phone_DeleteGroupCallMessages(this Client client, InputGroupCallBase call, int[] messages, bool report_spam = false)
|
||||
=> client.Invoke(new Phone_DeleteGroupCallMessages
|
||||
{
|
||||
|
|
@ -7402,7 +7543,7 @@ namespace TL
|
|||
messages = messages,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/phone.deleteGroupCallParticipantMessages"/></para></summary>
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/phone.deleteGroupCallParticipantMessages"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/phone.deleteGroupCallParticipantMessages#possible-errors">details</a>)</para></summary>
|
||||
public static Task<UpdatesBase> Phone_DeleteGroupCallParticipantMessages(this Client client, InputGroupCallBase call, InputPeer participant, bool report_spam = false)
|
||||
=> client.Invoke(new Phone_DeleteGroupCallParticipantMessages
|
||||
{
|
||||
|
|
@ -7411,14 +7552,14 @@ namespace TL
|
|||
participant = participant,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/phone.getGroupCallStars"/></para></summary>
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/phone.getGroupCallStars"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/phone.getGroupCallStars#possible-errors">details</a>)</para></summary>
|
||||
public static Task<Phone_GroupCallStars> Phone_GetGroupCallStars(this Client client, InputGroupCallBase call)
|
||||
=> client.Invoke(new Phone_GetGroupCallStars
|
||||
{
|
||||
call = call,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/phone.saveDefaultSendAs"/></para></summary>
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/phone.saveDefaultSendAs"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/phone.saveDefaultSendAs#possible-errors">details</a>)</para></summary>
|
||||
public static Task<bool> Phone_SaveDefaultSendAs(this Client client, InputGroupCallBase call, InputPeer send_as)
|
||||
=> client.Invoke(new Phone_SaveDefaultSendAs
|
||||
{
|
||||
|
|
@ -8068,7 +8209,9 @@ namespace TL
|
|||
limit = limit,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/stories.startLive"/></para></summary>
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/stories.startLive"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/stories.startLive#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="entities"><a href="https://corefork.telegram.org/api/entities">Message entities for styled text</a></param>
|
||||
/// <param name="random_id"> <para>You can use <see cref="WTelegram.Helpers.RandomLong"/></para></param>
|
||||
public static Task<UpdatesBase> Stories_StartLive(this Client client, InputPeer peer, InputPrivacyRule[] privacy_rules, long random_id, string caption = null, MessageEntity[] entities = null, bool? messages_enabled = default, long? send_paid_messages_stars = null, bool pinned = false, bool noforwards = false, bool rtmp_stream = false)
|
||||
=> client.Invoke(new Stories_StartLive
|
||||
{
|
||||
|
|
@ -8489,6 +8632,27 @@ namespace TL.Methods
|
|||
public long form_id;
|
||||
}
|
||||
|
||||
[TLDef(0x518AD0B7)]
|
||||
public sealed partial class Auth_InitPasskeyLogin : IMethod<Auth_PasskeyLoginOptions>
|
||||
{
|
||||
public int api_id;
|
||||
public string api_hash;
|
||||
}
|
||||
|
||||
[TLDef(0x9857AD07)]
|
||||
public sealed partial class Auth_FinishPasskeyLogin : IMethod<Auth_AuthorizationBase>
|
||||
{
|
||||
public Flags flags;
|
||||
public InputPasskeyCredential credential;
|
||||
[IfFlag(0)] public int from_dc_id;
|
||||
[IfFlag(0)] public long from_auth_key_id;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
has_from_dc_id = 0x1,
|
||||
}
|
||||
}
|
||||
|
||||
[TLDef(0xEC86017A)]
|
||||
public sealed partial class Account_RegisterDevice : IMethod<bool>
|
||||
{
|
||||
|
|
@ -9392,6 +9556,24 @@ namespace TL.Methods
|
|||
public long hash;
|
||||
}
|
||||
|
||||
[TLDef(0x429547E8)]
|
||||
public sealed partial class Account_InitPasskeyRegistration : IMethod<Account_PasskeyRegistrationOptions> { }
|
||||
|
||||
[TLDef(0x55B41FD6)]
|
||||
public sealed partial class Account_RegisterPasskey : IMethod<Passkey>
|
||||
{
|
||||
public InputPasskeyCredential credential;
|
||||
}
|
||||
|
||||
[TLDef(0xEA1F0C52)]
|
||||
public sealed partial class Account_GetPasskeys : IMethod<Account_Passkeys> { }
|
||||
|
||||
[TLDef(0xF5B5563F)]
|
||||
public sealed partial class Account_DeletePasskey : IMethod<bool>
|
||||
{
|
||||
public string id;
|
||||
}
|
||||
|
||||
[TLDef(0x0D91A548)]
|
||||
public sealed partial class Users_GetUsers : IMethod<UserBase[]>
|
||||
{
|
||||
|
|
@ -9877,7 +10059,7 @@ namespace TL.Methods
|
|||
}
|
||||
}
|
||||
|
||||
[TLDef(0x41D41ADE)]
|
||||
[TLDef(0x13704A7C)]
|
||||
public sealed partial class Messages_ForwardMessages : IMethod<UpdatesBase>
|
||||
{
|
||||
public Flags flags;
|
||||
|
|
@ -9891,6 +10073,7 @@ namespace TL.Methods
|
|||
[IfFlag(24)] public int schedule_repeat_period;
|
||||
[IfFlag(13)] public InputPeer send_as;
|
||||
[IfFlag(17)] public InputQuickReplyShortcutBase quick_reply_shortcut;
|
||||
[IfFlag(18)] public long effect;
|
||||
[IfFlag(20)] public int video_timestamp;
|
||||
[IfFlag(21)] public long allow_paid_stars;
|
||||
[IfFlag(23)] public SuggestedPost suggested_post;
|
||||
|
|
@ -9907,6 +10090,7 @@ namespace TL.Methods
|
|||
has_send_as = 0x2000,
|
||||
noforwards = 0x4000,
|
||||
has_quick_reply_shortcut = 0x20000,
|
||||
has_effect = 0x40000,
|
||||
allow_paid_floodskip = 0x80000,
|
||||
has_video_timestamp = 0x100000,
|
||||
has_allow_paid_stars = 0x200000,
|
||||
|
|
@ -10900,7 +11084,7 @@ namespace TL.Methods
|
|||
}
|
||||
}
|
||||
|
||||
[TLDef(0x198FB446)]
|
||||
[TLDef(0x894CC99C)]
|
||||
public sealed partial class Messages_RequestUrlAuth : IMethod<UrlAuthResult>
|
||||
{
|
||||
public Flags flags;
|
||||
|
|
@ -10908,15 +11092,17 @@ namespace TL.Methods
|
|||
[IfFlag(1)] public int msg_id;
|
||||
[IfFlag(1)] public int button_id;
|
||||
[IfFlag(2)] public string url;
|
||||
[IfFlag(3)] public string in_app_origin;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
has_peer = 0x2,
|
||||
has_url = 0x4,
|
||||
has_in_app_origin = 0x8,
|
||||
}
|
||||
}
|
||||
|
||||
[TLDef(0xB12C7125)]
|
||||
[TLDef(0x67A3F0DE)]
|
||||
public sealed partial class Messages_AcceptUrlAuth : IMethod<UrlAuthResult>
|
||||
{
|
||||
public Flags flags;
|
||||
|
|
@ -10924,12 +11110,15 @@ namespace TL.Methods
|
|||
[IfFlag(1)] public int msg_id;
|
||||
[IfFlag(1)] public int button_id;
|
||||
[IfFlag(2)] public string url;
|
||||
[IfFlag(4)] public string match_code;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
write_allowed = 0x1,
|
||||
has_peer = 0x2,
|
||||
has_url = 0x4,
|
||||
share_phone_number = 0x8,
|
||||
has_match_code = 0x10,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -11293,11 +11482,18 @@ namespace TL.Methods
|
|||
}
|
||||
}
|
||||
|
||||
[TLDef(0xB11EAFA2)]
|
||||
[TLDef(0xB2081A35)]
|
||||
public sealed partial class Messages_ToggleNoForwards : IMethod<UpdatesBase>
|
||||
{
|
||||
public Flags flags;
|
||||
public InputPeer peer;
|
||||
public bool enabled;
|
||||
[IfFlag(0)] public int request_msg_id;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
has_request_msg_id = 0x1,
|
||||
}
|
||||
}
|
||||
|
||||
[TLDef(0xCCFDDF96)]
|
||||
|
|
@ -12235,6 +12431,58 @@ namespace TL.Methods
|
|||
public int top_msg_id;
|
||||
}
|
||||
|
||||
[TLDef(0xFB7E8CA7)]
|
||||
public sealed partial class Messages_GetEmojiGameInfo : IMethod<Messages_EmojiGameInfo> { }
|
||||
|
||||
[TLDef(0x9D4104E2)]
|
||||
public sealed partial class Messages_SummarizeText : IMethod<TextWithEntities>
|
||||
{
|
||||
public Flags flags;
|
||||
public InputPeer peer;
|
||||
public int id;
|
||||
[IfFlag(0)] public string to_lang;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
has_to_lang = 0x1,
|
||||
}
|
||||
}
|
||||
|
||||
[TLDef(0xF743B857)]
|
||||
public sealed partial class Messages_EditChatCreator : IMethod<UpdatesBase>
|
||||
{
|
||||
public InputPeer peer;
|
||||
public InputUserBase user_id;
|
||||
public InputCheckPasswordSRP password;
|
||||
}
|
||||
|
||||
[TLDef(0x3B7D0EA6)]
|
||||
public sealed partial class Messages_GetFutureChatCreatorAfterLeave : IMethod<UserBase>
|
||||
{
|
||||
public InputPeer peer;
|
||||
}
|
||||
|
||||
[TLDef(0xA00F32B0)]
|
||||
public sealed partial class Messages_EditChatParticipantRank : IMethod<UpdatesBase>
|
||||
{
|
||||
public InputPeer peer;
|
||||
public InputPeer participant;
|
||||
public string rank;
|
||||
}
|
||||
|
||||
[TLDef(0x35436BBC)]
|
||||
public sealed partial class Messages_DeclineUrlAuth : IMethod<bool>
|
||||
{
|
||||
public string url;
|
||||
}
|
||||
|
||||
[TLDef(0xC9A47B0B)]
|
||||
public sealed partial class Messages_CheckUrlAuthMatchCode : IMethod<bool>
|
||||
{
|
||||
public string url;
|
||||
public string match_code;
|
||||
}
|
||||
|
||||
[TLDef(0xEDD4882A)]
|
||||
public sealed partial class Updates_GetState : IMethod<Updates_State> { }
|
||||
|
||||
|
|
@ -12619,13 +12867,19 @@ namespace TL.Methods
|
|||
}
|
||||
}
|
||||
|
||||
[TLDef(0xD33C8902)]
|
||||
[TLDef(0x9A98AD68)]
|
||||
public sealed partial class Channels_EditAdmin : IMethod<UpdatesBase>
|
||||
{
|
||||
public Flags flags;
|
||||
public InputChannelBase channel;
|
||||
public InputUserBase user_id;
|
||||
public ChatAdminRights admin_rights;
|
||||
public string rank;
|
||||
[IfFlag(0)] public string rank;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
has_rank = 0x1,
|
||||
}
|
||||
}
|
||||
|
||||
[TLDef(0x566DECD0)]
|
||||
|
|
@ -12798,14 +13052,6 @@ namespace TL.Methods
|
|||
public InputChannelBase group;
|
||||
}
|
||||
|
||||
[TLDef(0x8F38CD1F)]
|
||||
public sealed partial class Channels_EditCreator : IMethod<UpdatesBase>
|
||||
{
|
||||
public InputChannelBase channel;
|
||||
public InputUserBase user_id;
|
||||
public InputCheckPasswordSRP password;
|
||||
}
|
||||
|
||||
[TLDef(0x58E63F6D)]
|
||||
public sealed partial class Channels_EditLocation : IMethod<bool>
|
||||
{
|
||||
|
|
@ -13764,6 +14010,7 @@ namespace TL.Methods
|
|||
sort_by_price = 0x2,
|
||||
sort_by_num = 0x4,
|
||||
has_attributes = 0x8,
|
||||
for_craft = 0x10,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -13854,6 +14101,55 @@ namespace TL.Methods
|
|||
public long hash;
|
||||
}
|
||||
|
||||
[TLDef(0xE9CE781C)]
|
||||
public sealed partial class Payments_ResolveStarGiftOffer : IMethod<UpdatesBase>
|
||||
{
|
||||
public Flags flags;
|
||||
public int offer_msg_id;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
decline = 0x1,
|
||||
}
|
||||
}
|
||||
|
||||
[TLDef(0x8FB86B41)]
|
||||
public sealed partial class Payments_SendStarGiftOffer : IMethod<UpdatesBase>
|
||||
{
|
||||
public Flags flags;
|
||||
public InputPeer peer;
|
||||
public string slug;
|
||||
public StarsAmountBase price;
|
||||
public int duration;
|
||||
public long random_id;
|
||||
[IfFlag(0)] public long allow_paid_stars;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
has_allow_paid_stars = 0x1,
|
||||
}
|
||||
}
|
||||
|
||||
[TLDef(0x6D038B58)]
|
||||
public sealed partial class Payments_GetStarGiftUpgradeAttributes : IMethod<Payments_StarGiftUpgradeAttributes>
|
||||
{
|
||||
public long gift_id;
|
||||
}
|
||||
|
||||
[TLDef(0xFD05DD00)]
|
||||
public sealed partial class Payments_GetCraftStarGifts : IMethod<Payments_SavedStarGifts>
|
||||
{
|
||||
public long gift_id;
|
||||
public string offset;
|
||||
public int limit;
|
||||
}
|
||||
|
||||
[TLDef(0xB0F9684F)]
|
||||
public sealed partial class Payments_CraftStarGift : IMethod<UpdatesBase>
|
||||
{
|
||||
public InputSavedStarGift[] stargift;
|
||||
}
|
||||
|
||||
[TLDef(0x9021AB67)]
|
||||
public sealed partial class Stickers_CreateStickerSet : IMethod<Messages_StickerSet>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -571,7 +571,7 @@ namespace TL
|
|||
}
|
||||
|
||||
/// <summary>Message entity representing a <a href="https://corefork.telegram.org/api/mentions">user mention</a>: for <em>creating</em> a mention use <see cref="InputMessageEntityMentionName"/>. <para>See <a href="https://corefork.telegram.org/constructor/messageEntityMentionName"/></para></summary>
|
||||
[TLDef(0x352DCA58, inheritBefore = true)]
|
||||
[TLDef(0x352DCA58, inheritAt = 0)]
|
||||
public sealed partial class MessageEntityMentionName : MessageEntity
|
||||
{
|
||||
/// <summary>Identifier of the user that was mentioned</summary>
|
||||
|
|
|
|||
119
src/TL.Table.cs
119
src/TL.Table.cs
|
|
@ -6,7 +6,7 @@ namespace TL
|
|||
{
|
||||
public static partial class Layer
|
||||
{
|
||||
public const int Version = 218; // fetched 11/15/2025 21:06:24
|
||||
public const int Version = 223; // fetched 03/02/2026 11:38:17
|
||||
internal const int SecretChats = 144;
|
||||
internal const int MTProto2 = 73;
|
||||
internal const uint VectorCtor = 0x1CB5C415;
|
||||
|
|
@ -107,6 +107,7 @@ namespace TL
|
|||
[0xC21B8849] = typeof(InputMediaWebPage),
|
||||
[0xC4103386] = typeof(InputMediaPaidMedia),
|
||||
[0x9FC55FDE] = typeof(InputMediaTodo),
|
||||
[0xF3A9244A] = typeof(InputMediaStakeDice),
|
||||
[0x1CA48F57] = null,//InputChatPhotoEmpty
|
||||
[0xBDCDAEC0] = typeof(InputChatUploadedPhoto),
|
||||
[0x8953AD37] = typeof(InputChatPhoto),
|
||||
|
|
@ -144,15 +145,15 @@ namespace TL
|
|||
[0x17D493D5] = typeof(ChannelForbidden),
|
||||
[0x2633421B] = typeof(ChatFull),
|
||||
[0xE4E0B29D] = typeof(ChannelFull),
|
||||
[0xC02D4007] = typeof(ChatParticipant),
|
||||
[0xE46BCEE4] = typeof(ChatParticipantCreator),
|
||||
[0xA0933F5B] = typeof(ChatParticipantAdmin),
|
||||
[0x38E79FDE] = typeof(ChatParticipant),
|
||||
[0xE1F867B8] = typeof(ChatParticipantCreator),
|
||||
[0x0360D5D2] = typeof(ChatParticipantAdmin),
|
||||
[0x8763D3E1] = typeof(ChatParticipantsForbidden),
|
||||
[0x3CBC93F8] = typeof(ChatParticipants),
|
||||
[0x37C1011C] = null,//ChatPhotoEmpty
|
||||
[0x1C6E1C11] = typeof(ChatPhoto),
|
||||
[0x90A6CA84] = typeof(MessageEmpty),
|
||||
[0xB92F76CF] = typeof(Message),
|
||||
[0x3AE56482] = typeof(Message),
|
||||
[0x7A800E0A] = typeof(MessageService),
|
||||
[0x3DED6320] = null,//MessageMediaEmpty
|
||||
[0x695150D7] = typeof(MessageMediaPhoto),
|
||||
|
|
@ -166,7 +167,7 @@ namespace TL
|
|||
[0xF6A548D3] = typeof(MessageMediaInvoice),
|
||||
[0xB940C666] = typeof(MessageMediaGeoLive),
|
||||
[0x4BD6E798] = typeof(MessageMediaPoll),
|
||||
[0x3F7EE58B] = typeof(MessageMediaDice),
|
||||
[0x08CBEC07] = typeof(MessageMediaDice),
|
||||
[0x68CB6283] = typeof(MessageMediaStory),
|
||||
[0xAA073BEB] = typeof(MessageMediaGiveaway),
|
||||
[0xCEAA3EA1] = typeof(MessageMediaGiveawayResults),
|
||||
|
|
@ -219,8 +220,8 @@ namespace TL
|
|||
[0x41B3E202] = typeof(MessageActionPaymentRefunded),
|
||||
[0x45D5B021] = typeof(MessageActionGiftStars),
|
||||
[0xB00C47A2] = typeof(MessageActionPrizeStars),
|
||||
[0xDB596550] = typeof(MessageActionStarGift),
|
||||
[0x95728543] = typeof(MessageActionStarGiftUnique),
|
||||
[0xEA2C31D3] = typeof(MessageActionStarGift),
|
||||
[0xE6C31522] = typeof(MessageActionStarGiftUnique),
|
||||
[0xAC1F1FCD] = typeof(MessageActionPaidMessagesRefunded),
|
||||
[0x84B88578] = typeof(MessageActionPaidMessagesPrice),
|
||||
[0x2FFE2F7A] = typeof(MessageActionConferenceCall),
|
||||
|
|
@ -231,6 +232,12 @@ namespace TL
|
|||
[0x69F916F8] = typeof(MessageActionSuggestedPostRefund),
|
||||
[0xA8A3C699] = typeof(MessageActionGiftTon),
|
||||
[0x2C8F2A25] = typeof(MessageActionSuggestBirthday),
|
||||
[0x774278D4] = typeof(MessageActionStarGiftPurchaseOffer),
|
||||
[0x73ADA76B] = typeof(MessageActionStarGiftPurchaseOfferDeclined),
|
||||
[0xB07ED085] = typeof(MessageActionNewCreatorPending),
|
||||
[0xE188503B] = typeof(MessageActionChangeCreator),
|
||||
[0xBF7D6572] = typeof(MessageActionNoForwardsToggle),
|
||||
[0x3E2793BA] = typeof(MessageActionNoForwardsRequest),
|
||||
[0xD58A08C6] = typeof(Dialog),
|
||||
[0x71BD134C] = typeof(DialogFolder),
|
||||
[0x2331B22D] = typeof(PhotoEmpty),
|
||||
|
|
@ -446,6 +453,9 @@ namespace TL
|
|||
[0x3E85E92C] = typeof(UpdateDeleteGroupCallMessages),
|
||||
[0x48E246C2] = typeof(UpdateStarGiftAuctionState),
|
||||
[0xDC58F31E] = typeof(UpdateStarGiftAuctionUserState),
|
||||
[0xFB9C547A] = typeof(UpdateEmojiGameInfo),
|
||||
[0xAC072444] = typeof(UpdateStarGiftCraftFail),
|
||||
[0xBD8367B9] = typeof(UpdateChatParticipantRank),
|
||||
[0xA56C2A3E] = typeof(Updates_State),
|
||||
[0x5D75A138] = typeof(Updates_DifferenceEmpty),
|
||||
[0x00F49CA0] = typeof(Updates_Difference),
|
||||
|
|
@ -590,24 +600,24 @@ namespace TL
|
|||
[0xD3F924EB] = null,//Messages_StickerSetNotModified
|
||||
[0xC27AC8C7] = typeof(BotCommand),
|
||||
[0x4D8A0299] = typeof(BotInfo),
|
||||
[0xA2FA4880] = typeof(KeyboardButton),
|
||||
[0x258AFF05] = typeof(KeyboardButtonUrl),
|
||||
[0x35BBDB6B] = typeof(KeyboardButtonCallback),
|
||||
[0xB16A6C29] = typeof(KeyboardButtonRequestPhone),
|
||||
[0xFC796B3F] = typeof(KeyboardButtonRequestGeoLocation),
|
||||
[0x93B9FBB5] = typeof(KeyboardButtonSwitchInline),
|
||||
[0x50F41CCF] = typeof(KeyboardButtonGame),
|
||||
[0xAFD93FBB] = typeof(KeyboardButtonBuy),
|
||||
[0x10B78D29] = typeof(KeyboardButtonUrlAuth),
|
||||
[0xD02E7FD4] = typeof(InputKeyboardButtonUrlAuth),
|
||||
[0xBBC7515D] = typeof(KeyboardButtonRequestPoll),
|
||||
[0xE988037B] = typeof(InputKeyboardButtonUserProfile),
|
||||
[0x308660C1] = typeof(KeyboardButtonUserProfile),
|
||||
[0x13767230] = typeof(KeyboardButtonWebView),
|
||||
[0xA0C0505C] = typeof(KeyboardButtonSimpleWebView),
|
||||
[0x53D7BFD8] = typeof(KeyboardButtonRequestPeer),
|
||||
[0xC9662D05] = typeof(InputKeyboardButtonRequestPeer),
|
||||
[0x75D2698E] = typeof(KeyboardButtonCopy),
|
||||
[0x7D170CFF] = typeof(KeyboardButton),
|
||||
[0xD80C25EC] = typeof(KeyboardButtonUrl),
|
||||
[0xE62BC960] = typeof(KeyboardButtonCallback),
|
||||
[0x417EFD8F] = typeof(KeyboardButtonRequestPhone),
|
||||
[0xAA40F94D] = typeof(KeyboardButtonRequestGeoLocation),
|
||||
[0x991399FC] = typeof(KeyboardButtonSwitchInline),
|
||||
[0x89C590F9] = typeof(KeyboardButtonGame),
|
||||
[0x3FA53905] = typeof(KeyboardButtonBuy),
|
||||
[0xF51006F9] = typeof(KeyboardButtonUrlAuth),
|
||||
[0x68013E72] = typeof(InputKeyboardButtonUrlAuth),
|
||||
[0x7A11D782] = typeof(KeyboardButtonRequestPoll),
|
||||
[0x7D5E07C7] = typeof(InputKeyboardButtonUserProfile),
|
||||
[0xC0FD5D09] = typeof(KeyboardButtonUserProfile),
|
||||
[0xE846B1A0] = typeof(KeyboardButtonWebView),
|
||||
[0xE15C4370] = typeof(KeyboardButtonSimpleWebView),
|
||||
[0x5B0F15F5] = typeof(KeyboardButtonRequestPeer),
|
||||
[0x02B78156] = typeof(InputKeyboardButtonRequestPeer),
|
||||
[0xBCC4AF10] = typeof(KeyboardButtonCopy),
|
||||
[0x77608B83] = typeof(KeyboardButtonRow),
|
||||
[0xA03E5B85] = typeof(ReplyKeyboardHide),
|
||||
[0x86B40B08] = typeof(ReplyKeyboardForceReply),
|
||||
|
|
@ -634,6 +644,7 @@ namespace TL
|
|||
[0x32CA960F] = typeof(MessageEntitySpoiler),
|
||||
[0xC8CF05F8] = typeof(MessageEntityCustomEmoji),
|
||||
[0xF1CCAAAC] = typeof(MessageEntityBlockquote),
|
||||
[0x904AC7C7] = typeof(MessageEntityFormattedDate),
|
||||
[0xEE8C1E86] = null,//InputChannelEmpty
|
||||
[0xF35AEC28] = typeof(InputChannel),
|
||||
[0x5B934F9D] = typeof(InputChannelFromMessage),
|
||||
|
|
@ -644,11 +655,11 @@ namespace TL
|
|||
[0x2064674E] = typeof(Updates_ChannelDifference),
|
||||
[0x94D42EE7] = null,//ChannelMessagesFilterEmpty
|
||||
[0xCD77D957] = typeof(ChannelMessagesFilter),
|
||||
[0xCB397619] = typeof(ChannelParticipant),
|
||||
[0x4F607BEF] = typeof(ChannelParticipantSelf),
|
||||
[0x1BD54456] = typeof(ChannelParticipant),
|
||||
[0xA9478A1A] = typeof(ChannelParticipantSelf),
|
||||
[0x2FE601D3] = typeof(ChannelParticipantCreator),
|
||||
[0x34C3BB53] = typeof(ChannelParticipantAdmin),
|
||||
[0x6DF8014E] = typeof(ChannelParticipantBanned),
|
||||
[0xD5F0AD91] = typeof(ChannelParticipantBanned),
|
||||
[0x1B03F006] = typeof(ChannelParticipantLeft),
|
||||
[0xDE3F3C79] = typeof(ChannelParticipantsRecent),
|
||||
[0xB4608969] = typeof(ChannelParticipantsAdmins),
|
||||
|
|
@ -882,6 +893,7 @@ namespace TL
|
|||
[0x60A79C79] = typeof(ChannelAdminLogEventActionToggleSignatureProfiles),
|
||||
[0x64642DB3] = typeof(ChannelAdminLogEventActionParticipantSubExtend),
|
||||
[0xC517F77E] = typeof(ChannelAdminLogEventActionToggleAutotranslation),
|
||||
[0x5806B4EC] = typeof(ChannelAdminLogEventActionParticipantEditRank),
|
||||
[0x1FAD68CD] = typeof(ChannelAdminLogEvent),
|
||||
[0xED8AF74D] = typeof(Channels_AdminLogResults),
|
||||
[0xEA107AE4] = typeof(ChannelAdminLogEventsFilter),
|
||||
|
|
@ -995,8 +1007,8 @@ namespace TL
|
|||
[0xFBD2C296] = typeof(InputFolderPeer),
|
||||
[0xE9BAA668] = typeof(FolderPeer),
|
||||
[0xE844EBFF] = typeof(Messages_SearchCounter),
|
||||
[0x92D33A0E] = typeof(UrlAuthResultRequest),
|
||||
[0x8F8C0E4E] = typeof(UrlAuthResultAccepted),
|
||||
[0xF8F8EB1E] = typeof(UrlAuthResultRequest),
|
||||
[0x623A8FA0] = typeof(UrlAuthResultAccepted),
|
||||
[0xA9D6DB1F] = null,//UrlAuthResultDefault
|
||||
[0xBFB5AD8B] = null,//ChannelLocationEmpty
|
||||
[0x209B82DB] = typeof(ChannelLocation),
|
||||
|
|
@ -1020,7 +1032,7 @@ namespace TL
|
|||
[0x50CC03D3] = typeof(WebPageAttributeStickerSet),
|
||||
[0xCF6F6DB8] = typeof(WebPageAttributeUniqueStarGift),
|
||||
[0x31CAD303] = typeof(WebPageAttributeStarGiftCollection),
|
||||
[0x034986AB] = typeof(WebPageAttributeStarGiftAuction),
|
||||
[0x01C641C2] = typeof(WebPageAttributeStarGiftAuction),
|
||||
[0x4899484E] = typeof(Messages_VotesList),
|
||||
[0xF568028A] = typeof(BankCardOpenUrl),
|
||||
[0x3E24E573] = typeof(Payments_BankCardData),
|
||||
|
|
@ -1384,8 +1396,8 @@ namespace TL
|
|||
[0x4BA3A95A] = typeof(MessageReactor),
|
||||
[0x94CE852A] = typeof(StarsGiveawayOption),
|
||||
[0x54236209] = typeof(StarsGiveawayWinnersOption),
|
||||
[0x1B9A4D7F] = typeof(StarGift),
|
||||
[0xB0BF741B] = typeof(StarGiftUnique),
|
||||
[0x313A9547] = typeof(StarGift),
|
||||
[0x85F0A9CD] = typeof(StarGiftUnique),
|
||||
[0xA388A368] = null,//Payments_StarGiftsNotModified
|
||||
[0x2ED82995] = typeof(Payments_StarGifts),
|
||||
[0x7903E3D9] = typeof(MessageReportOption),
|
||||
|
|
@ -1405,16 +1417,16 @@ namespace TL
|
|||
[0x82C9E290] = typeof(Messages_FoundStickers),
|
||||
[0xB0CD6617] = typeof(BotVerifierSettings),
|
||||
[0xF93CD45C] = typeof(BotVerification),
|
||||
[0x39D99013] = typeof(StarGiftAttributeModel),
|
||||
[0x13ACFF19] = typeof(StarGiftAttributePattern),
|
||||
[0xD93D859C] = typeof(StarGiftAttributeBackdrop),
|
||||
[0x565251E2] = typeof(StarGiftAttributeModel),
|
||||
[0x4E7085EA] = typeof(StarGiftAttributePattern),
|
||||
[0x9F2504E4] = typeof(StarGiftAttributeBackdrop),
|
||||
[0xE0BFF26C] = typeof(StarGiftAttributeOriginalDetails),
|
||||
[0x3DE1DFED] = typeof(Payments_StarGiftUpgradePreview),
|
||||
[0x62D706B8] = typeof(Users_Users),
|
||||
[0x315A4974] = typeof(Users_UsersSlice),
|
||||
[0x416C56E8] = typeof(Payments_UniqueStarGift),
|
||||
[0x8C9A88AC] = typeof(Messages_WebPagePreview),
|
||||
[0x8983A452] = typeof(SavedStarGift),
|
||||
[0x41DF43FC] = typeof(SavedStarGift),
|
||||
[0x95F389B1] = typeof(Payments_SavedStarGifts),
|
||||
[0x69279795] = typeof(InputSavedStarGiftUser),
|
||||
[0xF101AA7F] = typeof(InputSavedStarGiftChat),
|
||||
|
|
@ -1468,17 +1480,38 @@ namespace TL
|
|||
[0x711D692D] = typeof(RecentStory),
|
||||
[0x310240CC] = typeof(AuctionBidLevel),
|
||||
[0xFE333952] = null,//StarGiftAuctionStateNotModified
|
||||
[0x5DB04F4B] = typeof(StarGiftAuctionState),
|
||||
[0x7D967C3A] = typeof(StarGiftAuctionStateFinished),
|
||||
[0x771A4E66] = typeof(StarGiftAuctionState),
|
||||
[0x972DABBF] = typeof(StarGiftAuctionStateFinished),
|
||||
[0x2EEED1C4] = typeof(StarGiftAuctionUserState),
|
||||
[0x0E98E474] = typeof(Payments_StarGiftAuctionState),
|
||||
[0xAB60E20B] = typeof(StarGiftAuctionAcquiredGift),
|
||||
[0x6B39F4EC] = typeof(Payments_StarGiftAuctionState),
|
||||
[0x42B00348] = typeof(StarGiftAuctionAcquiredGift),
|
||||
[0x7D5BD1F0] = typeof(Payments_StarGiftAuctionAcquiredGifts),
|
||||
[0xD31BC45D] = typeof(StarGiftActiveAuctionState),
|
||||
[0xDB33DAD0] = null,//Payments_StarGiftActiveAuctionsNotModified
|
||||
[0x97F187D8] = typeof(Payments_StarGiftActiveAuctions),
|
||||
[0xAEF6ABBC] = typeof(Payments_StarGiftActiveAuctions),
|
||||
[0x02E16C98] = typeof(InputStarGiftAuction),
|
||||
[0x7AB58308] = typeof(InputStarGiftAuctionSlug),
|
||||
[0x98613EBF] = typeof(Passkey),
|
||||
[0xF8E0AA1C] = typeof(Account_Passkeys),
|
||||
[0xE16B5CE1] = typeof(Account_PasskeyRegistrationOptions),
|
||||
[0xE2037789] = typeof(Auth_PasskeyLoginOptions),
|
||||
[0x3E63935C] = typeof(InputPasskeyResponseRegister),
|
||||
[0xC31FC14A] = typeof(InputPasskeyResponseLogin),
|
||||
[0x3C27B78F] = typeof(InputPasskeyCredentialPublicKey),
|
||||
[0x5B1CCB28] = typeof(InputPasskeyCredentialFirebasePNV),
|
||||
[0xAFF56398] = typeof(StarGiftBackground),
|
||||
[0x3AAE0528] = typeof(StarGiftAuctionRound),
|
||||
[0x0AA021E5] = typeof(StarGiftAuctionRoundExtendable),
|
||||
[0x46C6E36F] = typeof(Payments_StarGiftUpgradeAttributes),
|
||||
[0xDA2AD647] = typeof(Messages_EmojiGameOutcome),
|
||||
[0x59E65335] = typeof(Messages_EmojiGameUnavailable),
|
||||
[0x44E56023] = typeof(Messages_EmojiGameDiceInfo),
|
||||
[0x36437737] = typeof(StarGiftAttributeRarity),
|
||||
[0xDBCE6389] = typeof(StarGiftAttributeRarityUncommon),
|
||||
[0xF08D516B] = typeof(StarGiftAttributeRarityRare),
|
||||
[0x78FBF3A8] = typeof(StarGiftAttributeRarityEpic),
|
||||
[0xCEF7E7A8] = typeof(StarGiftAttributeRarityLegendary),
|
||||
[0x4FDD3430] = typeof(KeyboardButtonStyle),
|
||||
// from TL.Secret:
|
||||
[0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument),
|
||||
[0x020DF5D0] = typeof(Layer101.MessageEntityBlockquote),
|
||||
|
|
|
|||
23
src/TL.cs
23
src/TL.cs
|
|
@ -24,7 +24,7 @@ namespace TL
|
|||
public sealed class TLDefAttribute(uint ctorNb) : Attribute
|
||||
{
|
||||
public readonly uint CtorNb = ctorNb;
|
||||
public bool inheritBefore;
|
||||
public int inheritAt = -1;
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
|
|
@ -68,8 +68,7 @@ namespace TL
|
|||
var tlDef = type.GetCustomAttribute<TLDefAttribute>();
|
||||
var ctorNb = tlDef.CtorNb;
|
||||
writer.Write(ctorNb);
|
||||
IEnumerable<FieldInfo> fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public);
|
||||
if (tlDef.inheritBefore) fields = fields.GroupBy(f => f.DeclaringType).Reverse().SelectMany(g => g);
|
||||
var fields = GetTLFields(type, tlDef);
|
||||
ulong flags = 0;
|
||||
IfFlagAttribute ifFlag;
|
||||
foreach (var field in fields)
|
||||
|
|
@ -98,8 +97,7 @@ namespace TL
|
|||
if (type == null) return null; // nullable ctor (class meaning is associated with null)
|
||||
var tlDef = type.GetCustomAttribute<TLDefAttribute>();
|
||||
var obj = Activator.CreateInstance(type, true);
|
||||
IEnumerable<FieldInfo> fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public);
|
||||
if (tlDef.inheritBefore) fields = fields.GroupBy(f => f.DeclaringType).Reverse().SelectMany(g => g);
|
||||
var fields = GetTLFields(type, tlDef);
|
||||
ulong flags = 0;
|
||||
IfFlagAttribute ifFlag;
|
||||
foreach (var field in fields)
|
||||
|
|
@ -115,6 +113,16 @@ namespace TL
|
|||
#endif
|
||||
}
|
||||
|
||||
#if !MTPG
|
||||
static IEnumerable<FieldInfo> GetTLFields(Type type, TLDefAttribute tlDef)
|
||||
{
|
||||
if (!(tlDef?.inheritAt >= 0)) return type.GetFields(BindingFlags.Instance | BindingFlags.Public);
|
||||
var fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly);
|
||||
if (type.IsAbstract || type.BaseType == typeof(IObject)) return fields;
|
||||
var subfields = GetTLFields(type.BaseType, type.BaseType.GetCustomAttribute<TLDefAttribute>());
|
||||
return fields.Take(tlDef.inheritAt).Concat(subfields).Concat(fields.Skip(tlDef.inheritAt));
|
||||
}
|
||||
#else
|
||||
public static IMethod<X> ReadTLMethod<X>(this BinaryReader reader)
|
||||
{
|
||||
uint ctorNb = reader.ReadUInt32();
|
||||
|
|
@ -125,6 +133,7 @@ namespace TL
|
|||
method = new BoolMethod { query = method };
|
||||
return (IMethod<X>)method;
|
||||
}
|
||||
#endif
|
||||
|
||||
internal static void WriteTLValue(this BinaryWriter writer, object value, Type valueType)
|
||||
{
|
||||
|
|
@ -490,6 +499,10 @@ namespace TL
|
|||
public sealed class BoolMethod : IMethod<object>
|
||||
{
|
||||
public IObject query;
|
||||
#if MTPG
|
||||
public void WriteTL(BinaryWriter writer) => query.WriteTL(writer);
|
||||
#else
|
||||
public void WriteTL(BinaryWriter writer) => writer.WriteTLObject(query);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@
|
|||
<PackageId>WTelegramClient</PackageId>
|
||||
<Authors>Wizou</Authors>
|
||||
<VersionPrefix>0.0.0</VersionPrefix>
|
||||
<VersionSuffix>layer.218</VersionSuffix>
|
||||
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 218
|
||||
<VersionSuffix>layer.223</VersionSuffix>
|
||||
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 223
|
||||
|
||||
Release Notes:
|
||||
$(ReleaseNotes)</Description>
|
||||
<Copyright>Copyright © Olivier Marcoux 2021-2025</Copyright>
|
||||
<Copyright>Copyright © Olivier Marcoux 2021-2026</Copyright>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://wiz0u.github.io/WTelegramClient</PackageProjectUrl>
|
||||
<PackageIcon>logo.png</PackageIcon>
|
||||
|
|
@ -28,7 +28,7 @@ $(ReleaseNotes)</Description>
|
|||
<PackageTags>Telegram;MTProto;Client;Api;UserBot</PackageTags>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<PackageReleaseNotes>$(ReleaseNotes)</PackageReleaseNotes>
|
||||
<NoWarn>NETSDK1138;CS0419;CS1573;CS1591</NoWarn>
|
||||
<NoWarn>NETSDK1138;CS0419;CS1573;CS1591;CA1850</NoWarn>
|
||||
<DefineConstants>TRACE;OBFUSCATION;MTPG</DefineConstants>
|
||||
<!--<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>-->
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue