diff --git a/TLSharp.Core/DataCenterIPVersion.cs b/TLSharp.Core/DataCenterIPVersion.cs index 9b22794..9c908ac 100644 --- a/TLSharp.Core/DataCenterIPVersion.cs +++ b/TLSharp.Core/DataCenterIPVersion.cs @@ -4,26 +4,26 @@ /// When the Telegram server responds with a set of addresses to connect to, DataCenterIPVersion indicates a preference /// for how to choose the IP address to connect to /// - public enum DataCenterIPVersion + public enum DataCenterIPVersion { /// /// Prefers IPv6 addresses if any is passed by Telegram /// - Default = 0, + Default = 0, /// /// Takes only IPv4 addresses /// - OnlyIPv4 = 1, + OnlyIPv4 = 1, /// /// Takes only IPv6 addresses /// - OnlyIPv6 = 2, + OnlyIPv6 = 2, /// /// Connection to IPv4 addresses is preferred to IPv6 addresses /// PreferIPv4 = 3, /// - /// Connection to IPv6 addresses is preferred to IPv6 addresses + /// Connection to IPv6 addresses is preferred to IPv4 addresses /// PreferIPv6 = 4, } diff --git a/TLSharp.Core/TelegramClient.cs b/TLSharp.Core/TelegramClient.cs index d4906a8..cee8c00 100644 --- a/TLSharp.Core/TelegramClient.cs +++ b/TLSharp.Core/TelegramClient.cs @@ -434,69 +434,6 @@ namespace TLSharp.Core .ConfigureAwait(false); } - /// - /// Authenticates a Bot - /// - /// The token of the bot to authenticate - /// - /// The TLUser descriptor - public async Task MakeAuthBotAsync(string botAuthToken, CancellationToken token = default(CancellationToken)) - { - if (String.IsNullOrWhiteSpace(botAuthToken)) - { - throw new ArgumentNullException(nameof(botAuthToken)); - } - - var request = new TLRequestImportBotAuthorization() { BotAuthToken = botAuthToken, ApiId = apiId, ApiHash = apiHash }; - - await RequestWithDcMigration(request, token).ConfigureAwait(false); - - OnUserAuthenticated(((TLUser)request.Response.User)); - - return ((TLUser)request.Response.User); - } - - /// - /// Gets the full information of a specified chat - /// - /// The ID of the chat we want the info of - /// - /// - public async Task GetFullChat(int chatId, CancellationToken token = default(CancellationToken)) - { - var req = new TLRequestGetFullChat() { ChatId = chatId }; - var fchat = await SendRequestAsync(req).ConfigureAwait(false); - - return fchat; - } - - /// - /// Gets the list of chats opened by the authenticated user. - /// Throws an exception if the authenticated user is a bot. - /// - /// - /// The list of chats opened by the authenticated user - public async Task GetAllChats(CancellationToken token = default(CancellationToken)) - { - return await GetAllChats(null, token); - } - - /// - /// Gets the list of chats opened by the authenticated user except the passed ones. - /// Throws an exception if the authenticated user is a bot. - /// - /// The IDs of the chats that we don't want to be returned - /// - /// The list of chats opened by the authenticated user - public async Task GetAllChats(int[] exceptIds = null, CancellationToken token = default(CancellationToken)) - { - var ichats = new TeleSharp.TL.TLVector(); // we can't pass a null argument to the TLRequestGetChats - if (exceptIds != null) - Array.ForEach(exceptIds, x => ichats.Add(x)); - var chatInfo = await SendRequestAsync(new TLRequestGetChats() { Id = ichats }).ConfigureAwait(false); - return chatInfo; - } - /// /// Serch user or chat. API: contacts.search#11f812d8 q:string limit:int = contacts.Found; ///