From fe2baf51107ba23abba7993b4c603e0e39efddca Mon Sep 17 00:00:00 2001 From: Ilya Pirozhenko Date: Tue, 23 Jan 2018 13:34:28 +0300 Subject: [PATCH 1/2] Update README.md --- README.md | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/README.md b/README.md index 6605bbc..cbee7f0 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@ TLSharp ------------------------------- - [![Join the chat at https://gitter.im/TLSharp/Lobby](https://badges.gitter.im/TLSharp/Lobby.svg)](https://gitter.im/TLSharp/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build status](https://ci.appveyor.com/api/projects/status/95rl618ch5c4h2fa?svg=true)](https://ci.appveyor.com/project/sochix/tlsharp) [![NuGet version](https://badge.fury.io/nu/TLSharp.svg)](https://badge.fury.io/nu/TLSharp) - _Unofficial_ Telegram (http://telegram.org) client library implemented in C#. Latest TL scheme supported, thanks to Afshin Arani @@ -13,22 +11,6 @@ It's a perfect fit for any developer who would like to send data directly to Tel :star2: If you :heart: library, please star it! :star2: -# News -* **JavaScript Telegram Client** - - Hi everyone! I want to create JavaScript client for Telegram, it will have next features: - - * send & receieve messages from users/groups/channels - * easy installation with npm or yarn - * latest Telegram Schema - * examples and documentation - - If you like this idea, please leave your email [here](http://eepurl.com/cBXX8n). - -* **TLSharp GUI** - - If you have difficulties with console or writing code, you can try [Telegram Tools](https://github.com/sochix/telegram-tools). It's a GUI for TLSharp. - # Table of contents - [How do I add this to my project?](#how-do-i-add-this-to-my-project) @@ -200,10 +182,6 @@ Don't panic. You can call any method with help of `SendRequestAsync` function. F The only way is [Telegram API docs](https://core.telegram.org/methods). Yes, it's outdated. But there is no other source. Latest scheme in JSON format you can find [here](https://gist.github.com/aarani/b22b7cda024973dff68e1672794b0298) -# Contributing - -Contributing is highly appreciated! Donations required - ## What things can I Implement (Project Roadmap)? ### Release 1.0.0 From d1799732fd0ca07bb101a927f742fdbe3f15e3cd Mon Sep 17 00:00:00 2001 From: marjani Date: Fri, 2 Mar 2018 12:49:57 +0330 Subject: [PATCH 2/2] add GetUserDialogsSliceAsync() Method and fix NLog not found errors --- README.md | 4 ++-- TLSharp.Core/TelegramClient.cs | 7 +++++++ TLSharp.Core/packages.config | 2 +- TLSharp.sln | 14 ++++++++++---- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5149d9f..db4a8fa 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ namespace TLSharpPOC } - var dialogs = (TLDialogs) await client.GetUserDialogsAsync(); + var dialogs = await client.GetUserDialogsSliceAsync(); Console.WriteLine("Channels: "); foreach (var channelObj in dialogs.Chats.OfType()) { @@ -240,7 +240,7 @@ namespace TLSharpPOC // -- Wait in a loop to handle incoming updates. No need to poll. for (;;) { - await client.WaitEventAsync(); + await client.WaitEventAsync(1000); } } catch (Exception e) diff --git a/TLSharp.Core/TelegramClient.cs b/TLSharp.Core/TelegramClient.cs index 91fd283..abb9f45 100644 --- a/TLSharp.Core/TelegramClient.cs +++ b/TLSharp.Core/TelegramClient.cs @@ -329,6 +329,13 @@ public async Task GetUserDialogsAsync() var peer = new TLInputPeerSelf(); return await SendRequestAsync( new TLRequestGetDialogs() { OffsetDate = 0, OffsetPeer = peer, Limit = 100 }); + } + + public async Task GetUserDialogsSliceAsync() + { + var peer = new TLInputPeerSelf(); + return await SendRequestAsync( + new TLRequestGetDialogs() { OffsetDate = 0, OffsetPeer = peer, Limit = 100 }); } public async Task SendUploadedPhoto(TLAbsInputPeer peer, TLAbsInputFile file, string caption) diff --git a/TLSharp.Core/packages.config b/TLSharp.Core/packages.config index 518c7dc..4c898f4 100644 --- a/TLSharp.Core/packages.config +++ b/TLSharp.Core/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/TLSharp.sln b/TLSharp.sln index 4f55f1b..699425b 100644 --- a/TLSharp.sln +++ b/TLSharp.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TLSharp.Core", "TLSharp.Core\TLSharp.Core.csproj", "{400D2544-1CC6-4D8A-A62C-2292D9947A16}" EndProject @@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TLSharp.Tests.VS", "TLSharp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TLSharp.Tests.NUnit", "TLSharp.Tests.NUnit\TLSharp.Tests.NUnit.csproj", "{E90B705B-19FA-43BA-B952-69957976D12C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Marjani.TLSharp.Sample", "Marjani.TLSharp.Sample\Marjani.TLSharp.Sample.csproj", "{12B33A23-9EAA-4A6F-A9DC-9D66CEB1C00C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,6 +47,13 @@ Global {E90B705B-19FA-43BA-B952-69957976D12C}.Debug|Any CPU.Build.0 = Debug|Any CPU {E90B705B-19FA-43BA-B952-69957976D12C}.Release|Any CPU.ActiveCfg = Release|Any CPU {E90B705B-19FA-43BA-B952-69957976D12C}.Release|Any CPU.Build.0 = Release|Any CPU + {12B33A23-9EAA-4A6F-A9DC-9D66CEB1C00C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12B33A23-9EAA-4A6F-A9DC-9D66CEB1C00C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12B33A23-9EAA-4A6F-A9DC-9D66CEB1C00C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12B33A23-9EAA-4A6F-A9DC-9D66CEB1C00C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution Policies = $0 @@ -81,7 +90,4 @@ Global $2.inheritsScope = text/x-csharp $2.scope = text/x-csharp EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection EndGlobal