Giter Site home page Giter Site logo

tdsharp's Introduction

TDLib

.NET bindings for TDLib (Telegram Database Library): https://github.com/tdlib/td

  • Generated API bindings
  • Supports .NET Standard 2.0 and later

Installation

Install via NuGet: TDLib

NuGet

Dependencies

You're recommended to use precompiled version of TDLib native artifacts from NuGet: tdlib.native.

NuGet

Note that this is the main cross-platform package, and there are per-platform packages and additional options described in the tdlib.native documentation.

Note that tdlib.native is not a dependency of TDLib, so you may choose to build the binaries yourself and provide them at the runtime.

To do that, build TDLib and put the compiled library into your project's output directory

  • tdjson.dll (Windows) (optionally accompanied by other DLL files from the build directory if you want to bundle OpenSSL and ZLib dependencies as well)
  • libtdjson.dylib (MacOS)
  • libtdjson.so (Linux)

Have a question?

Report bugs to the issue tracker.

Ask questions at the discussion section on GitHub.

Using json client

TdJsonClient is a wrapper around native JSON APIs. Use it to send/receive data as strings.

using TdLib;

var json = ""; // json data
double timeout = 1.0; // 1 second

using (var jsonClient = new TdJsonClient())
{
    jsonClient.Send(json); // send request
    var result = jsonClient.Receive(timeout); // receive response
}

Using strongly typed APIs

This library contains generated classes for objects and functions. JSON serialization and deserialization is handled automatically. Use TdClient to asynchronously execute functions.

using TdLib;

using (var client = new TdClient())
{
    try
    {
        // asynchronously execute function
        TdApi.Ok ok = await client.ExecuteAsync(new TdApi.SetAuthenticationPhoneNumber
        {
            PhoneNumber = phoneNumber
        });

        // or use extension method
        ok = await client.SetAuthenticationPhoneNumberAsync(phoneNumber);

        // do something...
    }
    catch (ErrorException e)
    {
        TdApi.Error error = e.Error;

        // handle error...
    }
}

Overriding native bindings

By default, TdSharp will try to detect the platform and use the corresponding bindings to native td library. In case you want to override it (e.g. for Xamarin), create a custom implementation of ITdLibBindings (which corresponds to native library interface used by TdSharp) and pass it to TdClient constructor.

Documentation

License

All the project code is licensed under the MIT license.

The code generated from the upstream TDLib has the same license as TDLib, which is the Boost Software License - Version 1.0.

The license indication in the project's sources is compliant with the [REUSE specification v3.0][reuse.spec].

tdsharp's People

Contributors

0x25cbfc4f avatar dancojocaru2000 avatar dariooo512 avatar dependabot[bot] avatar fernandonajera avatar fornever avatar kant2002 avatar x2bool avatar yogurtthehorse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tdsharp's Issues

SetLogVerbosityLevel not working

Expected Behavior

Logs from the library are no longer getting displayed on the console.

Actual Behavior

The API Crashes or displays an error in the console

Steps to Reproduce the Problem

Case 1:

_client = new TdClient();
await _client.ExecuteAsync(new TdApi.SetLogVerbosityLevel { NewVerbosityLevel = 0 });

this yields:
image

Case 2:
Using syncronus method:

 _client = new TdClient();
 _client.Execute(new TdApi.SetLogVerbosityLevel { NewVerbosityLevel = 0 });

this yields an ArgumentNullException:
image

Specifications

  • Version: TdLib 1.4.0 (master version)
  • Platform: Win10
  • Runtime: Net Core 3.0

Failed to rename binlog

Hi,

I use tdsharp to download several files simultaneously from Telegram. Sporadically I receive and exception when tdlid tries to rename binlog and my app crashes. Do you know how can I avoid this?

[&status.is_error()] Failed to rename binlog: [WindowsError : Access
denied. : 5 : Can't rename "C:------\td.binlog.new" to "C:------\td.binlog"]

I have no antivirus enabled.

Failure when trying to dispose the client

This console program will crash in native code:

using System;
using TdLib;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            using (var client = new TdClient())
            {
                TdLog.SetVerbosityLevel(1024);
                
                var result = client.ExecuteAsync(new TdApi.TestCallEmpty()).Result;
                Console.WriteLine(result);
            }
            
            Console.WriteLine("That's all folks");
        }
    }
}

I've found that the reason is that we're disposing the client in an illegal manner: we're supposed to wait for updateAuthorizationState first (even if we never authorize).

See the sample C++ code as a reference.

When this library update to the 1.5?

Since the latest version of tdlib is 1.5 and there is a lot of changes, especially in the authentications. Do you have any plan to update your library to the latest version?

P.S: take a look at this issue: tdlib/td#561

Sending a video with a thumbnail

Hey, guys.
I want to send a video to chat along with a thumbnail.
I tried several options, but in my case, only a video without a thumbnail is sent (in the telegram chat I see only a black start preview). The last try looks like this:

1.Loading video and picture in TDLib

                var imgAnsw = await TdLibClient.UploadFileAsync(new InputFileLocal
                {
                    Path = fileInfo.ThumbnailFilePath
                }, new FileTypeThumbnail(), 31);

                var upAnsw = await TdLibClient.UploadFileAsync(new InputFileLocal
                {
                    Path = fileInfo.UploadedFilePath
                }, new FileTypeVideo(), 32);

2.I send a message

            var answ = await TdLibClient.SendMessageAsync
            (
                chatId: _tdLibSettings.ServiceChatId,
                options: new SendMessageOptions
                {
                    DisableNotification = true
                },
                inputMessageContent: new InputMessageVideo
                {
                    SupportsStreaming = true,
                    Width = fileInfo.UploadedFileWidth,
                    Height = fileInfo.UploadedFileHeight,
                    Video = new InputFileId
                    {
                        Id = upAnsw.Id
                    },
                    Caption = new FormattedText
                    {
                        Text = fileInfo.UploadedFileCaption
                    },
                    Thumbnail = new InputThumbnail
                    {
                        Thumbnail = new InputFileLocal
                        {
                            Path = imgAnsw.Local.Path
                        },
                        Width = fileInfo.ThumbnailFileWidth,
                        Height = fileInfo.ThumbnailFileHeight
                    }
                }
            );

Perhaps I am following some wrong algorithm? Correct me please.

Concurrency problems in tests

There're some wild concurrency troubles in our tests. The problem leads to 100% reproducible hang on Appveyor when running tests via dotnet test.

I've not been able to reproduce the issue on my machine, but Appveyor VM's are available to RDP to them and debug the issues. Unfortunately, I've got nothing from debugger. I'd like to see debug logs from tdlib, but dotnet test has no way of showing them.

Unfortunately, quick test program I've wrote to run the same test code in parallel haven't been able to reproduce the issues even on Appveyor.

Here's a test program, anyway. Probably we'll try to debug and fix the underlying issue somehow.

namespace TDLib.Tests
{
    public static class Program
    {
        private static async Task RunTdClientDisposeTests()
        {
            var instance = new TdClientDisposeTests();

            Console.WriteLine("Dispose_WhenCalled_DoesNotThrowException");
            await instance.Dispose_WhenCalled_DoesNotThrowException();

            Console.WriteLine("Dispose_WhenCalledTwice_DoesNotThrowException");
            await instance.Dispose_WhenCalledTwice_DoesNotThrowException();

            Console.WriteLine("Dispose_WhenCalledOnDifferentClients_DoesNotThrowException");
            await instance.Dispose_WhenCalledOnDifferentClients_DoesNotThrowException();
        }

        private static async Task RunTdClientErrorTests()
        {
            var instance = new TdClientErrorTests();

            Console.WriteLine("Execute_WhenErrorExpected_ThrowsTdException");
            await instance.Execute_WhenErrorExpected_ThrowsTdException();
        }

        private static async Task RunTdClientResultTests()
        {
            var instance = new TdClientResultTests();

            Console.WriteLine("Execute_WhenEmptyCallPassed_ReturnsOk");
            await instance.Execute_WhenEmptyCallPassed_ReturnsOk();

            Console.WriteLine("Execute_WhenStringPassed_ReturnsTheSameString");
            await instance.Execute_WhenStringPassed_ReturnsTheSameString();

            Console.WriteLine("Execute_WhenByteArrayPassed_ReturnsTheSameByteArray");
            await instance.Execute_WhenByteArrayPassed_ReturnsTheSameByteArray();

            Console.WriteLine("Execute_WhenIntArrayPassed_ReturnsTheSameArray");
            await instance.Execute_WhenIntArrayPassed_ReturnsTheSameArray();

            Console.WriteLine("Execute_WhenStringArrayPassed_ReturnsTheSameArray");
            await instance.Execute_WhenStringArrayPassed_ReturnsTheSameArray();
        }

        public static async Task Main()
        {
            Console.WriteLine("# RunTdClientDisposeTests");
            var a = RunTdClientDisposeTests();

            Console.WriteLine("# RunTdClientErrorTests");
            var b = RunTdClientErrorTests();

            Console.WriteLine("# RunTdClientResultTests");
            var c = RunTdClientResultTests();

            await Task.WhenAll(a, b, c);
        }
    }
}

download big file

how download big file by tdsharp?
my code for download file is :
TdClient.DownloadFileAsync(fileId,priority:32,offset:0,limit:0,synchronous:false)

file size is 1.5 GB.
Is there a mistake in the code?

"tdjson.dll" could not be found, despite everything

Hello!

  • I tried install tdlib.native,
  • I tried download release from https://github.com/ForNeVeR/tdlib.native/releases and copy "tdjson.dll" to output directory.
  • I tried even put full path to dll in TdLib.Bindings.WindowsBindings
    private const string Dll = "tdjson.dll";

But still get the error:
Unable to load DLL 'tdjson.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Could the reason be that I use Core 2.1?
Windows 10, VS 2017

What's content of the compiled library?

You're recommended to use precompiled version of TDLib native artifacts from NuGet: TDLib.Native

NuGet

Note that tdlib.native is not a dependency of TDLib, so you may choose to build the binaries yourself and provide them at the runtime.

To do that, build TDLib and put the compiled library into your project's output directory

20210113064446

20210113064319

How to put the compiled library into my project's output directory?
20210113064640

How to copy?

tdjson.dll (Windows) (optionally accompanied by other DLL files from the build directory if you want to bundle OpenSSL and ZLib dependencies as well)
libtdjson.dylib (MacOS)

libtdjson.so (Linux)

Failed to parse JSON object as TDLib request: Unknown class "updateOption"

Hi
I download current source and add tdlib.native package from nuget to TDLib.Samples.GetChats project, update ApId and ApiHash and PhoneNumber, then run. after few moments exception occurred.

TdLib.TdException: 'Failed to parse JSON object as TDLib request: Unknown class "updateOption"'
latest line of output:

'TDLib.Samples.GetChats.exe' (CoreCLR: clrhost): Loaded 'Anonymously Hosted DynamicMethods Assembly'. 
Exception thrown: 'TdLib.TdException' in System.Private.CoreLib.dll
An exception of type 'TdLib.TdException' occurred in System.Private.CoreLib.dll but was not handled in user code
Failed to parse JSON object as TDLib request: Unknown class "updateOption

image : https://ibb.co/6RY8bs0

Missing type "updateUnreadMessageCount"

Hi,

the type class for "updateUnreadMessageCount" was missing, I had to add it manually to prevent converter crashes. On a quick glance, it seems the types are incomplete and your missing around 300+ types :>

using Newtonsoft.Json;

namespace TD {

    public partial class Update : Structure {

        public class UpdateUnreadMessageCount : Update {

            [JsonProperty( "@type" )]
            public override string DataType { get; set; } = "updateUnreadMessageCount";

            [JsonProperty( "@extra" )]
            public override string Extra { get; set; }

            [JsonConverter( typeof( Converter ) )]
            [JsonProperty( "unread_count" )]
            public int UnreadCount { get; set; }

            [JsonConverter( typeof( Converter ) )]
            [JsonProperty( "unread_unmuted_count" )]
            public int UnreadUnmutedCount { get; set; }
        }

    }

}

SetLogVerbosityLevel and question about Hub and Dialer

Hello,

I got 2 questions:

  1. How to change LogVerbosityLevel? I would like to avoid all this output
    image
    In original tdlib it was possible to do in this way Client.Execute(new TdApi.SetLogVerbosityLevel(0));

I can find SetLogVerbosityLevel in sources inside tdsharp repository but, I don't have it in TdLib which I uploaded from nuget.

  1. Why I can't find Hub, Dialer and several other classes in sources but, they exist in TdLib which I got from nuget? Actually the reason why I'm trying to find sources is that I want to understand how Hub is implemented. Is that wrapper over ClientResultHandler in original tdlib? Could we have several hubs - for instance one for auth and another for handling other requests?

Thanks!

some methods not found

it seems, a lot of methods from mehtods is omitted. Is there any way to call these methods like TLsharp general solution :

//Create request
var req = new TLRequestSetTyping()
{
Action = new TLSendMessageTypingAction(),
Peer = new TLInputPeerUser() { UserId = user.Id }
};

//run request, and deserialize response to Boolean
return await client.SendRequestAsync(req);

Message Forwarding not always working - Gives Error : Chat to forward messages to not found

The Message forwarding option is working at times and fails at times with error: Chat to forward messages to not found
All parameters are valid and having proper value.
Any idea what could be the reason?
I tried 2 methods TdClient.ForwardMessagesAsync and TdClient.Send

_client = new TdClient();
_client.UpdateReceived += async (sender, update) =>
//////
case TdApi.Update.UpdateNewMessage u when u.Message.Content.GetType() == typeof(TdApi.MessageContent.MessageText):
await _client.ForwardMessagesAsync(destinationChatId, u.Message.ChatId, new long[1] { u.Message.Id },
                                    new TdApi.SendMessageOptions { DisableNotification = false, FromBackground = true }, true, true, false);

Alternately, below method was used and this method doesn't give error, but forwarding doesn't happen. If i run both together, its clear that, if it works both works. If fails, both fails.

_client.Send(new TdApi.ForwardMessages
{
	ChatId = destinationChatId,
	FromChatId = u.Message.ChatId,
	Options = new TdApi.SendMessageOptions { DisableNotification = false, FromBackground = true },
	AsAlbum = true,
	SendCopy = true,
	RemoveCaption = false,
	MessageIds = new long[1] { u.Message.Id }
});

NuGet: The package does not contain any assembly references or content files that are compatible with that framework.

Hello everyone,

does someone what to do to install the TDLib package through NuGet if I get the following error message?

Could not install package 'TDLib 1.6.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0,Profile=Client', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

"tdjson.dll" could not be found

Hello, this error occurs when I call "new Client()":

Unable to load DLL 'tdjson.dll': The specified module could not be found.

Add unit tests

For now, my main concern is that we could easily publish non-working library build (e.g. depending on non-working native assemblies) into NuGet. I think that we should add some rudimentary tests to check if the library works at least a little bit.

And the tests should execute on all supported platforms, for sure.

getChats result list not found

hi, thanks for this binding .
when call request like getChats result list not found but in log file exist ! and result is ok

data = JsonConvert.SerializeObject(new Methods.getChats()
          {
              limit_ = 100,
              offset_chat_id_ = 0,
              offset_order_ = long.MaxValue.ToString()
          });
Client.Send(data);
while (true)
{
    string result = Client.Receive(5);
}

how can retrive result getChats in same thread ?

Does offset in GetChatsAsync work?

I would like to get all chats, but I might have more chats than the limit so I want to call GetChatsAsync multiple times.

However, this code never terminates.

var offset = 0;
var limit = 3;

while (true)
{
  var chats = await client.GetChatsAsync(offset, limit);

  Console.Log(chats.ChatIds);

  if (chats.ChatIds.IsEmpty)
  {
    break;
  }

  offset += 1; // What should the next offset be?
}

Calling Convention when compiling for Windows

I couldn't use the NuGet package because of the DLL resulting from compiling td was generating calls with a different convention.

I had to add:

[DllImport("tdjson.dll", CallingConvention = CallingConvention.Cdecl)]

to WindowsBindings for being able to use it.

InvalidCastException: Unable to cast object of type 'ChatPhoto' to type 'ChatPhotoInfo'.

Newtonsoft.Json.JsonSerializationException
HResult=0x80131500
Message=Error setting value to 'Photo' on 'TdLib.TdApi+Chat'.
Source=Newtonsoft.Json
StackTrace:
at Newtonsoft.Json.Serialization.ExpressionValueProvider.SetValue(Object target, Object value)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
at TdLib.Converter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in C:\Users\majid\Desktop\tdsharp\TDLib.Api\Converter.cs:line 50
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)

Inner Exception 1:
InvalidCastException: Unable to cast object of type 'ChatPhoto' to type 'ChatPhotoInfo'.

TdClientErrorTests never terminates

Currently, the test TDLib.Tests.TdClientErrorTests.Execute_WhenErrorExpected_ThrowsTdException doesn't work, because it will never terminate.

Tested on Windows and macOS.

[Azure] Unable to load DLL 'tdjson.dll' or one of its dependencies

Hi @ForNeVeR, @x2bool,

The app logged this error when deploying in azure web app service. Any ideas?

System.DllNotFoundException: Unable to load DLL 'tdjson.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at TdLib.Bindings.WindowsBindings.td_json_client_create()
at TdLib.TdJsonClient..ctor()
at TdLib.TdClient..ctor()

    <TargetFramework>netcoreapp2.2</TargetFramework>
    
    <PackageReference Include="TDLib" Version="1.6.0" />
    <PackageReference Include="tdlib.native" Version="1.6.0" />

I can see the dll in the machine

image

The service is configured on 64 bit

Regards,

[Suggestion] tdsharp automatically gets updated if tdlib is updated.

Hello tdlib is a library that gets updates almost daily. tdsharp lags behind the intermediate versions after a while.

My suggestion is a program idea that when tdlib is updated, downloads the last tdlib code and recreates the functions of tdsharp.

so as tdlib is updated, tdsharp will be automatically updated.

Xamarin support

How about Xamarin support to build an Android app in Visual Studio using C#?

Failed to ExecuteAsync in the latest version?

My os: linux.
I update the tdlib to the latest version and use yout latest version but it hangs on ExecuteAsync and dont return received result, take a look at log:

11/3/19 12:47:07 PM - enabling tor proxy
[ 3][t 4][1572772627.691557407][Td.cpp:3548][#1][!Td][&td_requests]	Receive request 3: addProxy {
  server = "127.0.0.1"
  port = 9050
  enable = true
  type = proxyTypeSocks5 {
    username = ""
    password = ""
  }
}
[ 3][t 4][1572772627.691611528][Td.cpp:4672][#1][!Td][&td_requests]	Sending result for request 3: proxy {
  id = 2
  server = "127.0.0.1"
  port = 9050
  last_used_date = 1572772581
  is_enabled = true
  type = proxyTypeSocks5 {
    username = ""
    password = ""
  }
}

The log shows that the result sent, but the tdjsonclient does not receive it and ExecuteAsync hang forever.

PS: Everything was fine with 1.3 version.

Impossible to send message with keyboard.

When i'm trying to send a message with keyboard to chat, the message without keyboard is displayed in the chat.

I'm send message using the following code:

var keyboard = new TdApi.ReplyMarkup.ReplyMarkupInlineKeyboard()
{
    Rows = new TdApi.InlineKeyboardButton[][]
    {
        new TdApi.InlineKeyboardButton[]
        {
            new TdApi.InlineKeyboardButton()
            {
                Text = "https://www.google.com",
                Type = new TdApi.InlineKeyboardButtonType.InlineKeyboardButtonTypeUrl() { Url = "https://www.google.com" }
            }
        }
    }
});

var content = new TdApi.InputMessageContent.InputMessageText
{
    Text = new TdApi.FormattedText { Text = "Keyboard:", Entities = null },
    ClearDraft = false,
    DisableWebPagePreview = true
};

var chatId = 12345678l; // any chat, groups / private, etc. - the same result

var client = new Client();
var hub = new Hub(client);
var dialer = new Dialer(client, hub);

await dialer.ExecuteAsync(new TdApi.GetChat { ChatId = chatId }).ContinueWith(t =>
{
    dialer.ExecuteAsync(new TdApi.SendMessage
    {
        InputMessageContent = content,
        ChatId = userId,
        ReplyMarkup = keyboard,
        ReplyToMessageId = 0,
        DisableNotification = false,
        FromBackground = false
    });
});

Expected result:
Message with text "Keyboard:" and inline button with text "www.google.com".

Actual result:
Message with text "Keyboard:" without inline buttons.

I'm tried do the same thing with ReplyMarkupShowKeyboard - without success, the same result.

I have checked logs, it seems something going wrong with formatting, but what's actually wrong - no information.

Full Log since message sending:

[ 3][t 4][1541874286.967513323][td.cpp:3308][!Td][&td_requests] Receive request 7: sendMessage {
  chat_id = XXXXXXXXX
  reply_to_message_id = 0
  disable_notification = false
  from_background = false
  reply_markup = replyMarkupInlineKeyboard {
    rows = vector[1] {
      vector[1] {
        inlineKeyboardButton {
          text = "https://www.google.com"
          type = inlineKeyboardButtonTypeUrl {
            url = "https://www.google.com"
          }
        }
      }
    }
  }
  input_message_content = inputMessageText {
    text = formattedText {
      text = "Keyboard:"
      entities = vector[0] {
      }
    }
    disable_web_page_preview = true
    clear_draft = false
  }
}

[ 3][t 4][1541874286.967513323][messagesmanager.cpp:16763][!Td] Begin to send message to chat XXXXXXXXX in reply to invalid message 0
[ 3][t 4][1541874286.967513323][messagesmanager.cpp:16932][!Td] Send file 0(0) and thumbnail 0(0)
[ 3][t 4][1541874286.967513323][messagesmanager.cpp:15957][!Td] Create yet unsent message 213.9 in chat XXXXXXXXX
[ 3][t 4][1541874286.967513323][messagesmanager.cpp:23230][!Td] Adding yet unsent message 213.9 of type 0 to chat XXXXXXXXX from send message. Last new is server message 213, last is server message 213, from_update = true, have_previous = true, have_next = true

[ 4][t 4][1541874286.967513323][messagesmanager.cpp:22068][!Td] Search for yet unsent message 213.9 in chat XXXXXXXXX
[ 4][t 4][1541874286.967513323][messagesmanager.cpp:22041][!Td] Searching for yet unsent message 213.9 in 000000001A58D1E0
[ 3][t 4][1541874286.967513323][messagesmanager.cpp:23420][!Td] Schedule unload of chat XXXXXXXXX
[ 4][t 4][1541874286.967513323][timeout.cpp:38][!Td]    Add timeout for XXXXXXXXX in 60.000000
[ 3][t 4][1541874286.968513727][messagesmanager.cpp:23444][!Td] Adding not found yet unsent message 213.9 to chat XXXXXXXXX from send message
[ 3][t 4][1541874286.968513727][messagesmanager.cpp:23506][!Td] Trying to auto attach yet unsent message 213.9
[ 3][t 4][1541874286.968513727][messagesmanager.cpp:23530][!Td] Attach yet unsent message 213.9 to the previous server message 213
[ 3][t 4][1541874286.968513727][messagesmanager.cpp:10882][!Td] Set chat XXXXXXXXX last message to yet unsent message 213.9 from add_message_to_dialog
[ 3][t 4][1541874286.968513727][messagesmanager.cpp:25255][!Td] Trying to update chat XXXXXXXXX order from send_message
[ 4][t 4][1541874286.968513727][messagesmanager.cpp:22068][!Td] Search for yet unsent message 213.9 in chat XXXXXXXXX
[ 4][t 4][1541874286.968513727][messagesmanager.cpp:22041][!Td] Searching for yet unsent message 213.9 in 000000001A58D1E0
[ 4][t 4][1541874286.968513727][messagesmanager.cpp:22051][!Td] Message found
[ 3][t 4][1541874286.968513727][messagesmanager.cpp:25293][!Td] Last message at 1541874284 found
[ 3][t 4][1541874286.968513727][messagesmanager.cpp:25377][!Td] Dialog order is not changed: 6622299624323416277
[ 3][t 4][1541874286.968513727][messagesmanager.cpp:19822][!Td] Send updateChatLastMessage in chat XXXXXXXXX to yet unsent message 213.9 from send_message
[ 4][t 4][1541874286.968513727][messagesmanager.cpp:22068][!Td] Search for yet unsent message 213.9 in chat XXXXXXXXX
[ 4][t 4][1541874286.968513727][messagesmanager.cpp:22041][!Td] Searching for yet unsent message 213.9 in 000000001A58D1E0
[ 4][t 4][1541874286.968513727][messagesmanager.cpp:22051][!Td] Message found
[ 3][t 4][1541874286.968513727][messagesmanager.cpp:17307][!Td] Save yet unsent message 213.9 in chat XXXXXXXXX to binlog
[ 3][t 4][1541874286.968513727][messagesmanager.cpp:17316][!Td] Do send yet unsent message 213.9 in chat XXXXXXXXX
[ 3][t 4][1541874286.968513727][messagesmanager.cpp:16023][!Td] Begin to send yet unsent message 213.9 in chat XXXXXXXXX with random_id = 5531539883735517143
[ 4][t 4][1541874286.969513655][utils.cpp:21][!net_actor]       Create storer for messages_sendMessage {
  flags = 2
  peer = inputPeerUser {
    user_id = XXXXXXXXX
    access_hash = -1303515726422426141
  }
  message = "Keyboard:"
  random_id = 5531539883735517143
}

[ 3][t 4][1541874286.969513655][netquery.h:347][!net_actor]     [Query:[id:393216][tl:0xfa88427a][state:Query]]
[ 3][t 4][1541874286.970513821][netquery.h:239][!net_actor][&net_query] [Query:[id:393216][tl:0xfa88427a][state:Query]] [debug:send to MessagesManager::MultiSequenceDispatcher]
[ 4][t 4][1541874286.970513821][sequencedispatcher.cpp:247][!multi sequence dispatcher] Create SequenceDispatcher1207075360
[ 3][t 4][1541874286.971513748][netquery.h:239][!multi sequence dispatcher][&net_query] [Query:[id:393216][tl:0xfa88427a][state:Query]] [debug:send to SequenceDispatcher [sequence_id:1207075360]]
[ 3][t 4][1541874286.971513748][netquery.h:239][!sequence dispatcher][&net_query]       [Query:[id:393216][tl:0xfa88427a][state:Query]] [debug:Waiting at SequenceDispatcher]
[ 3][t 4][1541874286.972513914][sequencedispatcher.cpp:170][!sequence dispatcher][&net_query]   Send [Query:[id:393216][tl:0xfa88427a][state:Query]]
[ 3][t 4][1541874286.972513914][netquery.h:239][!sequence dispatcher][&net_query]       [Query:[id:393216][tl:0xfa88427a][state:Query]] [debug:send to Td::send_with_callback]
[ 3][t 4][1541874286.972513914][netquery.h:239][!sequence dispatcher][&net_query]       [Query:[id:393216][tl:0xfa88427a][state:Query]] [debug:dispatch]
[ 3][t 4][1541874286.972513914][netquery.h:239][!sequence dispatcher][&net_query]       [Query:[id:393216][tl:0xfa88427a][state:Query]] [debug:sent to main session multi proxy DcId{2}]
[ 4][t 4][1541874286.972513914][messagesmanager.cpp:22068][!Td] Search for yet unsent message 213.9 in chat XXXXXXXXX
[ 4][t 4][1541874286.972513914][messagesmanager.cpp:22041][!Td] Searching for yet unsent message 213.9 in 000000001A58D1E0
[ 4][t 4][1541874286.972513914][messagesmanager.cpp:22051][!Td] Message found
[ 3][t 4][1541874286.972513914][netquery.h:239][!SessionMultiProxy:2:main][&net_query]  [Query:[id:393216][tl:0xfa88427a][state:Query]] [debug:SessionMultiProxy:2:main: send to proxy #0]
[ 3][t 4][1541874286.972513914][netquery.h:239][!SessionProxy:2:main][&net_query]       [Query:[id:393216][tl:0xfa88427a][state:Query]] [debug:SessionProxy:2:main: sent to session]
[ 3][t 4][1541874286.972513914][netquery.h:239][!Session:2:main][&net_query]    [Query:[id:393216][tl:0xfa88427a][state:Query]] [debug:Session: received from SessionProxy]
[ 3][t 4][1541874286.972513914][session.cpp:223][!Session:2:main][&net_query]   got query [Query:[id:393216][tl:0xfa88427a][state:Query]]
[ 3][t 4][1541874286.972513914][netquery.h:239][!Session:2:main][&net_query]    [Query:[id:393216][tl:0xfa88427a][state:Query]] [debug:Session: pending]
[ 3][t 4][1541874286.973513842][netquery.h:239][!Session:2:main][&net_query]    [Query:[id:393216][tl:0xfa88427a][state:Query]] [debug:Session: try send to mtproto::connection]
[ 3][t 4][1541874286.973513842][netquery.h:239][!Session:2:main][&net_query]    [Query:[id:393216][tl:0xfa88427a][state:Query]] [debug:Session: send to mtproto::connection]
[ 3][t 4][1541874286.973513842][session.cpp:834][!Session:2:main][&net_query]   send query to connection [Query:[id:393216][tl:0xfa88427a][state:Query]] [msg_id:0x5be7226ca94a99a4][invoke_after:0x0000000000000000]
[ 4][t 4][1541874286.973513842][session.cpp:1210][!Session:2:main]      Wakeup after 0.001000
[ 3][t 4][1541874286.973513842][td.cpp:4238][!Td][&td_requests] Sending update: updateNewMessage {
  message = message {
    id = 223346697
    sender_user_id = YYYYYYYYY
    chat_id = XXXXXXXXX
    sending_state = messageSendingStatePending {
    }
    is_outgoing = true
    can_be_edited = false
    can_be_forwarded = true
    can_be_deleted_only_for_self = false
    can_be_deleted_for_all_users = true
    is_channel_post = false
    contains_unread_mention = false
    date = 1541874284
    edit_date = 0
    forward_info = null
    reply_to_message_id = 0
    ttl = 0
    ttl_expires_in = 0.000000
    via_bot_user_id = 0
    author_signature = ""
    views = 0
    media_album_id = 0
    content = messageText {
      text = formattedText {
        text = "Keyboard:"
        entities = vector[0] {
        }
      }
      web_page = null
    }
    reply_markup = null
  }
  disable_notification = true
  contains_mention = false
}

[ 3][t 4][1541874286.973513842][td.cpp:4238][!Td][&td_requests] Sending update: updateChatLastMessage {
  chat_id = XXXXXXXXX
  last_message = message {
    id = 223346697
    sender_user_id = YYYYYYYYY
    chat_id = XXXXXXXXX
    sending_state = messageSendingStatePending {
    }
    is_outgoing = true
    can_be_edited = false
    can_be_forwarded = true
    can_be_deleted_only_for_self = false
    can_be_deleted_for_all_users = true
    is_channel_post = false
    contains_unread_mention = false
    date = 1541874284
    edit_date = 0
    forward_info = null
    reply_to_message_id = 0
    ttl = 0
    ttl_expires_in = 0.000000
    via_bot_user_id = 0
    author_signature = ""
    views = 0
    media_album_id = 0
    content = messageText {
      text = formattedText {
        text = "Keyboard:"
        entities = vector[0] {
        }
      }
      web_page = null
    }
    reply_markup = null
  }
  order = 0
}

[ 3][t 4][1541874286.977514029][td.cpp:4253][!Td][&td_requests] Sending result for request 7: message {
  id = 223346697
  sender_user_id = YYYYYYYYY
  chat_id = XXXXXXXXX
  sending_state = messageSendingStatePending {
  }
  is_outgoing = true
  can_be_edited = false
  can_be_forwarded = true
  can_be_deleted_only_for_self = false
  can_be_deleted_for_all_users = true
  is_channel_post = false
  contains_unread_mention = false
  date = 1541874284
  edit_date = 0
  forward_info = null
  reply_to_message_id = 0
  ttl = 0
  ttl_expires_in = 0.000000
  via_bot_user_id = 0
  author_signature = ""
  views = 0
  media_album_id = 0
  content = messageText {
    text = formattedText {
      text = "Keyboard:"
      entities = vector[0] {
      }
    }
    web_page = null
  }
  reply_markup = null
}

[ 4][t 4][1541874286.978514194][bufferedfd.h:183][!Session:2:main]      flush_write: +220B[left:0B]
[ 4][t 4][1541874286.980514288][session.cpp:1210][!Session:2:main]      Wakeup after 55.158038
[ 4][t 4][1541874287.093520641][bufferedfd.h:174][!Session:2:main]      flush_read: +124B[total:124B]
[ 3][t 4][1541874287.093520641][session.cpp:634][!Session:2:main][&net_query]   Return query result [Query:[id:393216][tl:0xfa88427a][state:Query]]
[ 3][t 4][1541874287.094520569][netquery.h:127][!Session:2:main][&net_query]    Got answer [Query:[id:393216][tl:0xfa88427a][state:Query]]
[ 3][t 4][1541874287.094520569][netquery.h:239][!Session:2:main][&net_query]    [Query:[id:393216][tl:0xfa88427a][state:Result][tl:0x11f1331c]] [debug:dispatch]
[ 3][t 4][1541874287.094520569][netquery.h:239][!Session:2:main][&net_query]    [Query:[id:393216][tl:0xfa88427a][state:Result][tl:0x11f1331c]] [debug:sent to callback]
[ 3][t 4][1541874287.094520569][messagesmanager.cpp:2038][!net_actor]   Receive result for sendMessage for 5531539883735517143: updateShortSentMessage {
  flags = 514
  id = 214
  pts = 286
  pts_count = 1
  date = 1541874284
  media = messageMediaEmpty {
  }
}

[ 4][t 4][1541874287.094520569][messagesmanager.cpp:22068][!net_actor]  Search for yet unsent message 213.9 in chat XXXXXXXXX
[ 4][t 4][1541874287.094520569][messagesmanager.cpp:22041][!net_actor]  Searching for yet unsent message 213.9 in 000000001A58D1E0
[ 4][t 4][1541874287.094520569][messagesmanager.cpp:22051][!net_actor]  Message found
[ 3][t 4][1541874287.095520973][messagesmanager.cpp:5427][!net_actor]   Receive from send message actor pending updateSentMessage {
  random_id_ = 5531539883735517143
  message_id_ = 224395264
  date_ = 1541874284
}
new_pts = 286, pts_count = 1, force_apply = false
[ 3][t 4][1541874287.095520973][messagesmanager.cpp:6246][!net_actor]   Process updateSentMessage 5531539883735517143
[ 4][t 4][1541874287.095520973][messagesmanager.cpp:22041][!net_actor]  Searching for yet unsent message 213.9 in 000000001A58D1E0
[ 4][t 4][1541874287.095520973][messagesmanager.cpp:22051][!net_actor]  Message found
[ 3][t 4][1541874287.095520973][messagesmanager.cpp:11599][!net_actor]  Deleting yet unsent message 213.9 in chat XXXXXXXXX with have_previous = true and have_next = false from process updateSentMessage
[ 3][t 4][1541874287.095520973][messagesmanager.cpp:10882][!net_actor]  Set chat XXXXXXXXX last message to server message 213 from do_delete_message
[ 3][t 4][1541874287.095520973][messagesmanager.cpp:16462][!net_actor]  Cancel send message query for yet unsent message 213.9
[ 3][t 4][1541874287.095520973][messagesmanager.cpp:16469][!net_actor]  Cancel send query for yet unsent message 213.9
[ 3][t 4][1541874287.095520973][messagesmanager.cpp:16475][!net_actor]  Delete send message log event for yet unsent message 213.9
[ 3][t 4][1541874287.095520973][messagesmanager.cpp:23230][!net_actor]  Adding server message 214 of type 0 to chat XXXXXXXXX from process updateSentMessage. Last new is server message 213, last is server message 213, from_update = true, have_previous = true, h
ave_next = true
[ 4][t 4][1541874287.095520973][messagesmanager.cpp:22068][!net_actor]  Search for server message 214 in chat XXXXXXXXX
[ 4][t 4][1541874287.095520973][messagesmanager.cpp:22041][!net_actor]  Searching for server message 214 in 000000001A58D1E0
[ 3][t 4][1541874287.095520973][messagesmanager.cpp:22094][!net_actor]  Try to load server message 214 in chat XXXXXXXXX from database
[ 3][t 4][1541874287.096520901][messagesmanager.cpp:23420][!net_actor]  Schedule unload of chat XXXXXXXXX
[ 4][t 4][1541874287.096520901][timeout.cpp:38][!net_actor]     Add timeout for XXXXXXXXX in 60.000000
[ 3][t 4][1541874287.096520901][messagesmanager.cpp:23444][!net_actor]  Adding not found server message 214 to chat XXXXXXXXX from process updateSentMessage
[ 3][t 4][1541874287.096520901][messagesmanager.cpp:10967][!net_actor]  Set chat XXXXXXXXX last new message to server message 214 from add_message_to_dialog
[ 3][t 4][1541874287.096520901][messagesmanager.cpp:19669][!net_actor]  Update chat XXXXXXXXX from add_message_to_dialog
[ 4][t 4][1541874287.096520901][timeout.cpp:38][!net_actor]     Add timeout for XXXXXXXXX in -0.000000
[ 4][t 4][1541874287.096520901][timeout.cpp:75][!net_actor]     Set timeout in -0.000000
[ 3][t 4][1541874287.097521067][messagesmanager.cpp:23506][!net_actor]  Trying to auto attach server message 214
[ 3][t 4][1541874287.097521067][messagesmanager.cpp:23530][!net_actor]  Attach server message 214 to the previous server message 213
[ 3][t 4][1541874287.097521067][messagesmanager.cpp:10882][!net_actor]  Set chat XXXXXXXXX last message to server message 214 from add_message_to_dialog
[ 3][t 4][1541874287.097521067][messagesmanager.cpp:10907][!net_actor]  Set chat XXXXXXXXX last database message to server message 214 from add_message_to_dialog
[ 3][t 4][1541874287.097521067][messagesmanager.cpp:19669][!net_actor]  Update chat XXXXXXXXX from set_dialog_last_database_message_id
[ 4][t 4][1541874287.097521067][timeout.cpp:38][!net_actor]     Add timeout for XXXXXXXXX in -0.000000
[ 3][t 4][1541874287.097521067][messagesmanager.cpp:23837][!net_actor]  Add server message 214 in chat XXXXXXXXX to database from add_message_to_dialog
[ 3][t 4][1541874287.097521067][topdialogmanager.cpp:156][!TopDialogManager]    Update correspondent rating of chat XXXXXXXXX by 1.000002
[ 3][t 4][1541874287.097521067][topdialogmanager.cpp:568][!TopDialogManager]    Wakeup in: 5.000000
[ 3][t 4][1541874287.097521067][td.cpp:4238][!Td][&td_requests] Sending update: updateMessageSendSucceeded {
  message = message {
    id = 224395264
    sender_user_id = YYYYYYYYY
    chat_id = XXXXXXXXX
    sending_state = null
    is_outgoing = true
    can_be_edited = true
    can_be_forwarded = true
    can_be_deleted_only_for_self = true
    can_be_deleted_for_all_users = true
    is_channel_post = false
    contains_unread_mention = false
    date = 1541874284
    edit_date = 0
    forward_info = null
    reply_to_message_id = 0
    ttl = 0
    ttl_expires_in = 0.000000
    via_bot_user_id = 0
    author_signature = ""
    views = 0
    media_album_id = 0
    content = messageText {
      text = formattedText {
        text = "Keyboard:"
        entities = vector[0] {
        }
      }
      web_page = null
    }
    reply_markup = null
  }
  old_message_id = 223346697
}

[ 3][t 4][1541874287.099521160][messagesmanager.cpp:25255][!net_actor]  Trying to update chat XXXXXXXXX order from on_send_message_success
[ 4][t 4][1541874287.100521088][messagesmanager.cpp:22068][!net_actor]  Search for server message 214 in chat XXXXXXXXX
[ 4][t 4][1541874287.102521181][messagesmanager.cpp:22041][!net_actor]  Searching for server message 214 in 000000001A58D1E0
[ 4][t 4][1541874287.102521181][messagesmanager.cpp:22051][!net_actor]  Message found
[ 3][t 4][1541874287.102521181][messagesmanager.cpp:25293][!net_actor]  Last message at 1541874284 found
[ 3][t 4][1541874287.102521181][messagesmanager.cpp:25380][!net_actor]  Update order of chat XXXXXXXXX from 6622299624323416277 to 6622299624323416278
[ 3][t 4][1541874287.102521181][messagesmanager.cpp:25226][!net_actor]  Change position of chat XXXXXXXXX in chats search
[ 3][t 4][1541874287.102521181][messagesmanager.cpp:19669][!net_actor]  Update chat XXXXXXXXX from update_dialog_pos
[ 4][t 4][1541874287.102521181][timeout.cpp:38][!net_actor]     Add timeout for XXXXXXXXX in 0.000000
[ 3][t 4][1541874287.103521347][messagesmanager.cpp:19822][!net_actor]  Send updateChatLastMessage in chat XXXXXXXXX to server message 214 from on_send_message_success
[ 4][t 4][1541874287.103521347][messagesmanager.cpp:22068][!net_actor]  Search for server message 214 in chat XXXXXXXXX
[ 4][t 4][1541874287.103521347][messagesmanager.cpp:22041][!net_actor]  Searching for server message 214 in 000000001A58D1E0
[ 4][t 4][1541874287.103521347][messagesmanager.cpp:22051][!net_actor]  Message found
[ 3][t 4][1541874287.103521347][td.cpp:4238][!Td][&td_requests] Sending update: updateChatLastMessage {
  chat_id = XXXXXXXXX
  last_message = message {
    id = 224395264
    sender_user_id = YYYYYYYYY
    chat_id = XXXXXXXXX
    sending_state = null
    is_outgoing = true
    can_be_edited = true
    can_be_forwarded = true
    can_be_deleted_only_for_self = true
    can_be_deleted_for_all_users = true
    is_channel_post = false
    contains_unread_mention = false
    date = 1541874284
    edit_date = 0
    forward_info = null
    reply_to_message_id = 0
    ttl = 0
    ttl_expires_in = 0.000000
    via_bot_user_id = 0
    author_signature = ""
    views = 0
    media_album_id = 0
    content = messageText {
      text = formattedText {
        text = "Keyboard:"
        entities = vector[0] {
        }
      }
      web_page = null
    }
    reply_markup = null
  }
  order = 0
}

[ 3][t 4][1541874287.104521275][updatesmanager.cpp:297][!net_actor]     Update pts from 285 to 286 from process pending updates fast path
[ 4][t 4][1541874287.104521275][session.cpp:1210][!Session:2:main]      Wakeup after 29.991039
[ 3][t 4][1541874287.104521275][messagesmanager.cpp:4985][!PendingUpdatedDialogTimeout] Save chat XXXXXXXXX to database
[ 4][t 4][1541874287.104521275][messagesmanager.cpp:22068][!PendingUpdatedDialogTimeout]        Search for server message 214 in chat XXXXXXXXX
[ 4][t 4][1541874287.104521275][messagesmanager.cpp:22041][!PendingUpdatedDialogTimeout]        Searching for server message 214 in 000000001A58D1E0
[ 4][t 4][1541874287.104521275][messagesmanager.cpp:22051][!PendingUpdatedDialogTimeout]        Message found
[ 4][t 4][1541874287.104521275][messagesmanager.cpp:22068][!PendingUpdatedDialogTimeout]        Search for server message 214 in chat XXXXXXXXX
[ 4][t 4][1541874287.105521441][messagesmanager.cpp:22041][!PendingUpdatedDialogTimeout]        Searching for server message 214 in 000000001A58D1E0
[ 4][t 4][1541874287.105521441][messagesmanager.cpp:22051][!PendingUpdatedDialogTimeout]        Message found
[ 3][t 4][1541874287.105521441][messagesmanager.cpp:4993][!MessagesManager]     Successfully saved chat XXXXXXXXX to database
[ 4][t 4][1541874287.195526600][bufferedfd.h:174][!Session:2:main]      flush_read: +140B[total:140B]
[ 3][t 4][1541874287.195526600][netquery.h:347][!Session:2:main]        [Query:[id:0][tl:0x00000000][state:Result][tl:0x74ae4240]]
[ 3][t 4][1541874287.195526600][netquery.h:239][!Session:2:main][&net_query]    [Query:[id:0][tl:0x00000000][state:Result][tl:0x74ae4240]] [debug:dispatch]
[ 3][t 4][1541874287.195526600][netquery.h:239][!Session:2:main][&net_query]    [Query:[id:0][tl:0x00000000][state:Result][tl:0x74ae4240]] [debug:sent to td (no callback)]
[ 3][t 4][1541874287.196526766][netquery.h:239][!Td][&net_query]        [Query:[id:0][tl:0x00000000][state:Result][tl:0x74ae4240]] [debug:Td: received from DcManager]
[ 3][t 4][1541874287.196526766][td.cpp:3451][!Td][&net_query]   on_result [Query:[id:0][tl:0x00000000][state:Result][tl:0x74ae4240]]
[ 3][t 4][1541874287.196526766][updatesmanager.cpp:629][!Td]    Receive updates {
  updates = vector[1] {
    updateReadHistoryOutbox {
      peer = peerUser {
        user_id = XXXXXXXXX
      }
      max_id = 214
      pts = 287
      pts_count = 1
    }
  }
  users = vector[0] {
  }
  chats = vector[0] {
  }
  date = 1541874283
  seq = 0
}

...

Also, I have tried to manually serialize SendMessage object with JsonConvert.SerializeObject - it was successfully serialized and information about keyboard are presented in json.

Formatted JSON for the SendMessage presented bellow:

{  
   "@type":"sendMessage",
   "@extra":"6",
   "chat_id":XXXXXXXXX,
   "reply_to_message_id":0,
   "disable_notification":false,
   "from_background":false,
   "reply_markup":{  
      "@type":"replyMarkupInlineKeyboard",
      "@extra":null,
      "rows":[  
         [  
            {  
               "@type":"inlineKeyboardButton",
               "@extra":null,
               "text":"https://www.google.com",
               "type":{  
                  "@type":"inlineKeyboardButtonTypeUrl",
                  "@extra":null,
                  "url":"https://www.google.com"
               }
            }
         ]
      ]
   },
   "input_message_content":{  
      "@type":"inputMessageText",
      "@extra":null,
      "text":{  
         "@type":"formattedText",
         "@extra":null,
         "text":"Keyboard:",
         "entities":[  

         ]
      },
      "disable_web_page_preview":true,
      "clear_draft":false
   }
}

Data is incorrect if telegram account is protected by cloud password

When I tried to use code from example, I found that if I have a cloud password, I receive Update with Type UpdateAuthorizationState -> AuthorizationStateWaitPassword. That is OK. But the issue is that I receive the same update with exactly the same data even if I will remove that cloud password or change it (changed hint). There are two ways how to reproduce that issue:
Repro steps

  1. Add a cloud password to your account.
  2. Try to login using existing code, but add update handler for
    UpdateAuthorizationState->AuthorizationStateWaitPassword update type.
  3. Remove cloud password OR Change it and change hint
  4. Try that again. And receive the same data.
  5. Even if you will provide the correct password you will get HTTP 401 from the server.

Maybe I did something wrong and that is the correct behavior?
I think the issue is related to the tdlib_json.dll library because data is provided by it. Maybe I have to move that issue to tdlib repo?
I can provide a sample code to reproduce if needed.


I tested the same behaviour with TLSharp and it works fine.

AddProxy has no effect at all!

Could someone please give me an example of how we properly can use proxy (both Socks5 and Mtproto) here? coz when I use AddProxy nothing get returned, same applies to GetProxies.
If I could see an operational example, I'd highly appreciate it.

How to handle responses?

Hello,

For example I want to handle GetChat response. The type of Update which is retrieved for it is UpdateFile (what sounds logically since the purpose is to store that data to local db). However I don't want to store any data at all and I want work with API only in online mode. Moreover there is no specification which file will be updated (I believe the same type will be retrieved for GetMessages for instance)

So, how I can access actual data which is retrieved for GetChat API? Why the logic was changed to handle Update object instead of BaseObject as it is in original tdlib? It's useful when you can simply cast response data to object type which is expected to be retrieved.

Maybe I didn't get smth so, please clarify that.

Thank you!

ExecuteAsync thread seems to be blocked after the first call

From the samples in the repo in the GetChannels method, the TdApi.GetChats works well and the list of Chats is getting returned. Inside foreach the TdApi.GetChat returns a value the first time but after that when it gets called for the second time seems like thread to be blocked and no more data is getting received.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.