# Dokument fayllar

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

```csharp
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:**

![](https://2189654329-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-ML4YbrwilsjU6IyB7jd%2Fsync%2F8e55505ead03640a1e3579d4b02466831b57dc71.png?generation=1624557363861623\&alt=media)
