For the complete documentation index, see llms.txt. This page is also available as Markdown.

Dokument fayllar

Xondamir Abduxoshimov

Bundan oldingi mavzularda sanab o'tilgan fayl formatlaridan tashqari fayllarni SendDocumentAsync() asinxron funksiyasidan foydalangan holda amalga oshirish mumkin.

private async void Xabar_Kelganda(object sender, MessageEventArgs e)
{
    if (e.Message.Text == "document yubor")
    {
        using (var stream = System.IO.File.OpenRead(@"D:\salom.txt"))
        {
            await client.SendDocumentAsync(
                chatId: e.Message.Chat.Id,
                document: stream,    
                caption: "Document file",
                replyToMessageId: e.Message.MessageId,
                disableNotification: true
            );
        }
    }
}

Natija:

Last updated

Was this helpful?