td icon indicating copy to clipboard operation
td copied to clipboard

C# Please tell me an example of how to use C# UpdateMessageSendSuccessful

Open junho13123 opened this issue 3 years ago • 3 comments

private static void sendMessage(long chatId, string message) { // initialize reply markup just for testing TdApi.InlineKeyboardButton[] row = { new TdApi.InlineKeyboardButton("https://telegram.org?1", new TdApi.InlineKeyboardButtonTypeUrl()), new TdApi.InlineKeyboardButton("https://telegram.org?2", new TdApi.InlineKeyboardButtonTypeUrl()), new TdApi.InlineKeyboardButton("https://telegram.org?3", new TdApi.InlineKeyboardButtonTypeUrl()) }; TdApi.ReplyMarkup replyMarkup = new TdApi.ReplyMarkupInlineKeyboard(new TdApi.InlineKeyboardButton[][] { row, row, row });

        TdApi.InputMessageContent content = new TdApi.InputMessageText(new TdApi.FormattedText(message, null), false, true);
        //  TdApi.InputMessageContent csa = new TdApi.InputMessageDocument(new TdApi.InputFileLocal(loginform.textBox1.Text), null, false, new TdApi.FormattedText(message, null));
        TdApi.InputMessageContent imageSend = new TdApi.InputMessagePhoto(new TdApi.InputFileLocal(loginform.textBox1.Text), null, null, 0, 0, new TdApi.FormattedText(message, null), 0);
        if(loginform.checkBox1.Checked == true)
        {
            _client.Send(new TdApi.SendMessage(chatId, 0, 0, null, replyMarkup, imageSend), _defaultHandler);
        }
        else
        {
            _client.Send(new TdApi.SendMessage(chatId, 0, 0, null, replyMarkup, content), null);
        }
    }

We're sending a message through this function I would like to check for shipping errors using the UpdateMessageSendSuccessful class I don't know how Please show me the source code for example in C#

junho13123 avatar Sep 17 '22 08:09 junho13123

You must wait for updateMessageSendSucceeded, updateMessageSendFailed, or updateDeleteMessages update about the message. Updates are received independently from request responses.

levlam avatar Sep 17 '22 17:09 levlam

You must wait for updateMessageSendSucceeded, updateMessageSendFailed, or updateDeleteMessages update about the message. Updates are received independently from request responses.

Please show me the example code in C#

junho13123 avatar Sep 18 '22 08:09 junho13123

You can find all available examples in C# at https://github.com/tdlib/td/blob/master/example/README.md#csharp.

levlam avatar Sep 18 '22 16:09 levlam