From 81870b2de1f55dc8b76bdcf06437095de4cc4162 Mon Sep 17 00:00:00 2001
From: Wizou <11647984+wiz0u@users.noreply.github.com>
Date: Sun, 26 Mar 2023 17:59:15 +0200
Subject: [PATCH] API Layer 156: some email login stuff
---
README.md | 2 +-
src/TL.Schema.cs | 25 ++++++++++++----
src/TL.SchemaFuncs.cs | 59 ++++++++++++++++++++++++++------------
src/TL.Table.cs | 4 +--
src/WTelegramClient.csproj | 2 +-
5 files changed, 63 insertions(+), 29 deletions(-)
diff --git a/README.md b/README.md
index f68bee3..ac00bd1 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-[](https://corefork.telegram.org/methods)
+[](https://corefork.telegram.org/methods)
[](https://www.nuget.org/packages/WTelegramClient/)
[](https://dev.azure.com/wiz0u/WTelegramClient/_build?definitionId=7)
[](https://www.buymeacoffee.com/wizou)
diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs
index 6e1c9e3..a86dd6f 100644
--- a/src/TL.Schema.cs
+++ b/src/TL.Schema.cs
@@ -7879,7 +7879,7 @@ namespace TL
public string prefix;
}
/// The code was sent via the previously configured login email » See
- [TLDef(0x5A159841)]
+ [TLDef(0xF450F59B)]
public class Auth_SentCodeTypeEmailCode : Auth_SentCodeType
{
/// Flags, see TL conditional fields
@@ -7888,8 +7888,8 @@ namespace TL
public string email_pattern;
/// Length of the sent verification code
public int length;
- /// If set, contains an absolute UNIX timestamp indicating when will the user be able to authorize with a code sent to the user's phone number
- [IfFlag(2)] public DateTime next_phone_login_date;
+ [IfFlag(3)] public int reset_available_period;
+ [IfFlag(4)] public DateTime reset_pending_date;
[Flags] public enum Flags : uint
{
@@ -7897,8 +7897,10 @@ namespace TL
apple_signin_allowed = 0x1,
/// Whether authorization through Google ID is allowed
google_signin_allowed = 0x2,
- /// Field has a value
- has_next_phone_login_date = 0x4,
+ /// Field has a value
+ has_reset_available_period = 0x8,
+ /// Field has a value
+ has_reset_pending_date = 0x10,
}
}
/// The user should add and verify an email address in order to login as described here ». See
@@ -11421,6 +11423,7 @@ namespace TL
manage_call = 0x800,
/// Set this flag if none of the other flags are set, but you still want the user to be an admin: if this or any of the other flags are set, the admin can get the chat admin log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode.
other = 0x1000,
+ /// If set, allows the admin to create, delete or modify forum topics ».
manage_topics = 0x2000,
}
}
@@ -11448,7 +11451,7 @@ namespace TL
send_gifs = 0x10,
/// If set, does not allow a user to send games in a supergroup/chat
send_games = 0x20,
- /// If set, does not allow a user to use inline bots in a supergroup/chat
+ /// If set, does not allow a user to use inline bots in a supergroup/chat.
send_inline = 0x40,
/// If set, does not allow a user to embed links in the messages of a supergroup/chat
embed_links = 0x80,
@@ -11460,13 +11463,21 @@ namespace TL
invite_users = 0x8000,
/// If set, does not allow any user to pin messages in a supergroup/chat
pin_messages = 0x20000,
+ /// If set, does not allow any user to create, delete or modify forum topics ».
manage_topics = 0x40000,
+ /// If set, does not allow a user to send photos in a supergroup/chat.
send_photos = 0x80000,
+ /// If set, does not allow a user to send videos in a supergroup/chat.
send_videos = 0x100000,
+ /// If set, does not allow a user to send round videos in a supergroup/chat.
send_roundvideos = 0x200000,
+ /// If set, does not allow a user to send audio files in a supergroup/chat.
send_audios = 0x400000,
+ /// If set, does not allow a user to send voice messages in a supergroup/chat.
send_voices = 0x800000,
+ /// If set, does not allow a user to send documents in a supergroup/chat.
send_docs = 0x1000000,
+ /// If set, does not allow a user to send text messages in a supergroup/chat.
send_plain = 0x2000000,
}
}
@@ -12617,7 +12628,9 @@ namespace TL
has_reply_to_peer_id = 0x1,
/// Field has a value
has_reply_to_top_id = 0x2,
+ /// This is a reply to a scheduled message.
reply_to_scheduled = 0x4,
+ /// Whether this message was sent in a forum topic (except for the General topic).
forum_topic = 0x8,
}
}
diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs
index d3f26ae..9c343e8 100644
--- a/src/TL.SchemaFuncs.cs
+++ b/src/TL.SchemaFuncs.cs
@@ -306,6 +306,14 @@ namespace TL
ios_push_secret = ios_push_secret,
});
+ /// See
+ public static Task Auth_ResetLoginEmail(this Client client, string phone_number, string phone_code_hash)
+ => client.Invoke(new Auth_ResetLoginEmail
+ {
+ phone_number = phone_number,
+ phone_code_hash = phone_code_hash,
+ });
+
/// Register device to receive PUSH notifications See Possible codes: 400 (details)
/// Avoid receiving (silent and invisible background) notifications. Useful to save battery.
/// Device token type, see PUSH updates for the possible values.
@@ -1511,7 +1519,7 @@ namespace TL
/// Whether to move used stickersets to top, see here for more info on this flag »
/// The destination where the message will be sent
/// The message ID to which this message will reply to
- /// If set, sends the message to the specified message thread/forum topic
+ /// If set, sends the message to the specified forum topic
/// The message
/// Unique client message ID required to prevent message resending You can use
/// Reply markup for sending bot buttons
@@ -1541,7 +1549,7 @@ namespace TL
/// Whether to move used stickersets to top, see here for more info on this flag »
/// Destination
/// Message ID to which this message should reply to
- /// If set, sends the media to the specified message thread/forum topic
+ /// If set, sends the media to the specified forum topic
/// Attached media
/// Caption
/// Random ID to avoid resending the same message You can use
@@ -1576,7 +1584,7 @@ namespace TL
/// IDs of messages
/// Random ID to prevent resending of messages You can use
/// Destination peer
- /// Destination message thread/forum topic
+ /// Destination forum topic
/// Scheduled message date for scheduled messages
/// Forward the messages as the specified peer
public static Task Messages_ForwardMessages(this Client client, InputPeer from_peer, int[] id, long[] random_id, InputPeer to_peer, int? top_msg_id = null, DateTime? schedule_date = null, InputPeer send_as = null, bool silent = false, bool background = false, bool with_my_score = false, bool drop_author = false, bool drop_media_captions = false, bool noforwards = false)
@@ -2076,7 +2084,7 @@ namespace TL
/// Whether to hide the via @botname in the resulting message (only for bot usernames encountered in the )
/// Destination
/// ID of the message this message should reply to
- /// If set, sends the message to the specified message thread/forum topic
+ /// If set, sends the message to the specified forum topic
/// Random ID to avoid resending the same query You can use
/// Query ID from Messages_GetInlineBotResults
/// Result ID from Messages_GetInlineBotResults
@@ -2189,7 +2197,7 @@ namespace TL
/// Save a message draft associated to a chat. See Possible codes: 400 (details)
/// Disable generation of the webpage preview
/// Message ID the message should reply to
- /// Message thread/forum topic where the message will be sent
+ /// Forum topic where the message will be sent
/// Destination of the message that should be sent
/// The draft
/// Message entities for styled text
@@ -2470,7 +2478,7 @@ namespace TL
/// Get unread messages where we were mentioned See Possible codes: 400 (details)
/// Peer where to look for mentions
- /// If set, considers only messages within the specified message thread/forum topic
+ /// If set, considers only messages within the specified forum topic
/// Offsets for pagination, for more info click here
/// Offsets for pagination, for more info click here
/// Maximum number of results to return, see pagination
@@ -2491,7 +2499,7 @@ namespace TL
/// Mark mentions as read See Possible codes: 400 (details)
/// Dialog
- /// Mark as read only mentions within the specified message thread/forum topic
+ /// Mark as read only mentions within the specified forum topic
public static Task Messages_ReadMentions(this Client client, InputPeer peer, int? top_msg_id = null)
=> client.Invoke(new Messages_ReadMentions
{
@@ -2520,7 +2528,7 @@ namespace TL
/// Whether to move used stickersets to top, see here for more info on this flag »
/// The destination chat
/// The message to reply to
- /// If set, sends the media to the specified message thread/forum topic
+ /// If set, sends the media to the specified forum topic
/// The medias to send: note that they must be separately uploaded using Messages_UploadMedia first, using raw inputMediaUploaded* constructors is not supported.
/// Scheduled message date for scheduled messages
/// Send this message as the specified peer
@@ -2688,7 +2696,7 @@ namespace TL
/// Get the number of results that would be found by a Messages_Search call with the same parameters See Possible codes: 400 (details)
/// Peer where to search
- /// If set, consider only messages within the specified message thread/forum topic
+ /// If set, consider only messages within the specified forum topic
/// Search filters
public static Task Messages_GetSearchCounters(this Client client, InputPeer peer, MessagesFilter[] filters, int? top_msg_id = null)
=> client.Invoke(new Messages_GetSearchCounters
@@ -2900,7 +2908,7 @@ namespace TL
/// Unpin all pinned messages See [bots: ✓] Possible codes: 400 (details)
/// Chat where to unpin
- /// Message thread/forum topic where to unpin
+ /// Forum topic where to unpin
public static Task Messages_UnpinAllMessages(this Client client, InputPeer peer, int? top_msg_id = null)
=> client.Invoke(new Messages_UnpinAllMessages
{
@@ -3262,7 +3270,7 @@ namespace TL
/// Get unread reactions to messages you sent See
/// Peer
- /// If set, considers only reactions to messages within the specified message thread/forum topic
+ /// If set, considers only reactions to messages within the specified forum topic
/// Offsets for pagination, for more info click here
/// Offsets for pagination, for more info click here
/// Maximum number of results to return, see pagination
@@ -3283,7 +3291,7 @@ namespace TL
/// Mark message reactions » as read See Possible codes: 400 (details)
/// Peer
- /// Mark as read only reactions to messages within the specified message thread/forum topic
+ /// Mark as read only reactions to messages within the specified forum topic
public static Task Messages_ReadReactions(this Client client, InputPeer peer, int? top_msg_id = null)
=> client.Invoke(new Messages_ReadReactions
{
@@ -3342,7 +3350,7 @@ namespace TL
/// Theme parameters »
/// Short name of the application; 0-64 English letters, digits, and underscores
/// Whether the inline message that will be sent by the bot on behalf of the user once the web app interaction is Messages_SendWebViewResultMessage should be sent in reply to this message ID.
- /// If set, the inline message that will be sent by the bot on behalf of the user once the web app interaction is Messages_SendWebViewResultMessage will be sent to the specified message thread/forum topic
+ /// If set, the inline message that will be sent by the bot on behalf of the user once the web app interaction is Messages_SendWebViewResultMessage will be sent to the specified forum topic
/// Open the web app as the specified peer, sending the resulting the message as the specified peer.
public static Task Messages_RequestWebView(this Client client, InputPeer peer, InputUserBase bot, string platform, string url = null, string start_param = null, DataJSON theme_params = null, int? reply_to_msg_id = null, int? top_msg_id = null, InputPeer send_as = null, bool from_bot_menu = false, bool silent = false)
=> client.Invoke(new Messages_RequestWebView
@@ -3365,7 +3373,7 @@ namespace TL
/// Bot that owns the web app
/// Web app interaction ID obtained from Messages_RequestWebView
/// Whether the inline message that will be sent by the bot on behalf of the user once the web app interaction is Messages_SendWebViewResultMessage should be sent in reply to this message ID.
- /// If set, the inline message that will be sent by the bot on behalf of the user once the web app interaction is Messages_SendWebViewResultMessage will be sent to the specified message thread/forum topic.
+ /// If set, the inline message that will be sent by the bot on behalf of the user once the web app interaction is Messages_SendWebViewResultMessage will be sent to the specified forum topic.
/// Open the web app as the specified peer
public static Task Messages_ProlongWebView(this Client client, InputPeer peer, InputUserBase bot, long query_id, int? reply_to_msg_id = null, int? top_msg_id = null, InputPeer send_as = null, bool silent = false)
=> client.Invoke(new Messages_ProlongWebView
@@ -3591,7 +3599,13 @@ namespace TL
hash = hash,
});
- /// See [bots: ✓]
+ /// Open a bot web app from a bot web app deep link, sending over user information after user confirmation. See [bots: ✓]
+ /// Set this flag if the bot is asking permission to send messages to the user as specified in the bot web app deep link docs, and the user agreed.
+ /// If the client has clicked on the link in a Telegram chat, pass the chat's peer information; otherwise pass the bot's peer information, instead.
+ /// The app obtained by invoking Messages_GetBotApp as specified in the bot web app deep link docs.
+ /// If the startapp query string parameter is present in the bot web app deep link, pass it to start_param.
+ /// Theme parameters »
+ /// Short name of the application; 0-64 English letters, digits, and underscores
public static Task Messages_RequestAppWebView(this Client client, InputPeer peer, InputBotApp app, string platform, string start_param = null, DataJSON theme_params = null, bool write_allowed = false)
=> client.Invoke(new Messages_RequestAppWebView
{
@@ -4448,9 +4462,9 @@ namespace TL
enabled = enabled,
});
- /// Create a forum topic. See [bots: ✓] Possible codes: 400 (details)
+ /// Create a forum topic; requires manage_topics rights. See [bots: ✓] Possible codes: 400 (details)
/// The forum
- /// Topic title
+ /// Topic title (maximum UTF-8 length: 128)
/// If no custom emoji icon is specified, specifies the color of the fallback topic icon (RGB), one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F.
/// ID of the custom emoji used as topic icon. Telegram Premium users can use any custom emoji, other users can only use the custom emojis contained in the emoji pack.
/// Unique client message ID to prevent duplicate sending of the same event You can use
@@ -4496,10 +4510,10 @@ namespace TL
topics = topics,
});
- /// Edit forum topic See [bots: ✓]
+ /// Edit forum topic; requires manage_topics rights. See [bots: ✓]
/// Supergroup
/// Topic ID
- /// If present, will update the topic title.
+ /// If present, will update the topic title (maximum UTF-8 length: 128).
/// If present, updates the custom emoji used as topic icon. Telegram Premium users can use any custom emoji, other users can only use the custom emojis contained in the emoji pack. Pass 0 to switch to the fallback topic icon.
/// If present, will update the open/closed status of the topic.
/// If present, will hide/unhide the topic.
@@ -5631,6 +5645,13 @@ namespace TL.Methods
}
}
+ [TLDef(0x7E960193)]
+ public class Auth_ResetLoginEmail : IMethod
+ {
+ public string phone_number;
+ public string phone_code_hash;
+ }
+
[TLDef(0xEC86017A)]
public class Account_RegisterDevice : IMethod
{
diff --git a/src/TL.Table.cs b/src/TL.Table.cs
index f2ee174..9f5eb29 100644
--- a/src/TL.Table.cs
+++ b/src/TL.Table.cs
@@ -6,7 +6,7 @@ namespace TL
{
public static class Layer
{
- public const int Version = 155; // fetched 13/03/2023 22:46:30
+ public const int Version = 156; // fetched 26/03/2023 15:54:09
internal const int SecretChats = 144;
internal const int MTProto2 = 73;
internal const uint VectorCtor = 0x1CB5C415;
@@ -602,7 +602,7 @@ namespace TL
[0x5353E5A7] = typeof(Auth_SentCodeTypeCall),
[0xAB03C6D9] = typeof(Auth_SentCodeTypeFlashCall),
[0x82006484] = typeof(Auth_SentCodeTypeMissedCall),
- [0x5A159841] = typeof(Auth_SentCodeTypeEmailCode),
+ [0xF450F59B] = typeof(Auth_SentCodeTypeEmailCode),
[0xA5491DEA] = typeof(Auth_SentCodeTypeSetUpEmailRequired),
[0xD9565C39] = typeof(Auth_SentCodeTypeFragmentSms),
[0xE57B1432] = typeof(Auth_SentCodeTypeFirebaseSms),
diff --git a/src/WTelegramClient.csproj b/src/WTelegramClient.csproj
index 68efad0..49d8aeb 100644
--- a/src/WTelegramClient.csproj
+++ b/src/WTelegramClient.csproj
@@ -13,7 +13,7 @@
WTelegramClient
0.0.0
Wizou
- Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 155
Release Notes:
$(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))
+ Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 156
Release Notes:
$(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))
Copyright © Olivier Marcoux 2021-2023
MIT
https://github.com/wiz0u/WTelegramClient