This library is crap!!! '_client != null': is not true
This library is crap. It doesn't work. I keep getting an error when sending a method to TdLib: Unhandled Exception: 'package:tdlib/src/client/platform/io/io_platform.dart': Failed assertion: line 60 pos 12: '_client != null': is not true. There is no support.
The error if from the Dart code and not from the library.
This is the tdlib library in dart. It is taken from the repository as is. And it does not work. After executing the 'send' method, after some time the console displays the message 'stop td' and the library does not work.
You use a third-party wrapper for TDLib.
The error likely means that you are trying to send requests to a closed TDLib instance.
The example with the library was taken from the repository: https://github.com/ivk1800/tdlib-dart.git. Is this a third-party wrapper? The link to this repository with examples is in the current section. The first "send" request with the "GetMe()" function is sent and a response arrives in the console with data about the current user. After some time, the TdLib instance apparently closes itself and subsequent requests are not sent. Where can I get a working example of TdLib with Dart?
Yes, this is a third-party wrapper as the most examples of TDLib usage.
Where can I get a working example of TdLib with Dart?
Likely, there is no issue with the wrapper. TDLib instance can't be closed without a reason. But you are free to modify the wrapper or write your own using the interface described at https://core.telegram.org/tdlib/docs/td__json__client_8h.html.
I'm trying to get a chat after authorization "_client?.send(const td.GetChat(chatId: 1219159675))". I get the error: "Failed to load chat 1219159675 from database from load_dialog: Not found. Receive error for query: [Error : 400 : Chat not found]"
The same error occurs when trying to send a message to the chat: "_client?.send(const td.SendMessage( chatId: 1219159675, messageThreadId: 0, inputMessageContent: td.InputMessageText(text: td.FormattedText(text: "TEST", entities: []), clearDraft: false) ));"
Using GET requests (in the format: https://api.telegram.org/bot<YOUR_BOT_TOKEN>/sendMessage?chat_id=<chat_id>&text=
What's the problem here?
You can use only identifiers received from the same TDLib instance. For this you must find the chat in exactly the same way you would do this in a regular app.
How can I find the chat?
How can I get a list of chats so that I can select the desired chat to send a message? I can't find a working example that shows the entire mechanism for sending a message.
See https://core.telegram.org/tdlib/getting-started, which covers loading of the chat list among other details.
This library is crap. It doesn't work. I keep getting an error when sending a method to TdLib: Unhandled Exception: 'package:tdlib/src/client/platform/io/io_platform.dart': Failed assertion: line 60 pos 12: '_client != null': is not true. There is no support.
it's a library from dart, if you want to use it you need to add a shared library depending on the OS.