# Polls

Guruh va kanallarda biror - bir mavzu to'g'risida so'rovnoma o'tkazishda **poll** xabar turidan foydalaniladi.&#x20;

![](/files/-MR5_czLUDqf8sl_8GnZ)

Poll ko'rinishidagi xabar turlari 2 xil bo'ladi.

* Oddiy poll
* Quiz poll

Demak, ilk qadamda oddiy pollar qanday yasalishini ko'rib chiqamiz.

```csharp
private async void Xabar_Kelganda(object sender, MessageEventArgs e)
{
    if (e.Message.Text == "poll yubor")
    {
        await client.SendPollAsync(
            chatId: e.Message.Chat.Id,
            question: "C# qiziqroqmi?",
            options: new[]
            {
                "Ha",
                "Yo'q"
            }
        );                
    }
}
```

Natija

![](/files/-MR5cNcZOtrOBjfxBUHm)

Oddiy pollarda bir nechta tanlovni ham amalga oshirish mumkin.

```csharp
private async void Xabar_Kelganda(object sender, MessageEventArgs e)
{
    if (e.Message.Text == "poll yubor")
    {
        await client.SendPollAsync(
            chatId: e.Message.Chat.Id,
            question: "Qaysi dasturlash tillarni bilasiz?",
            options: new[]
            {
                "C++",
                "C#",
                "Java",
                "Kotlin",
                "Swift",
                "Javascript",
                "Python"
            },
            allowsMultipleAnswers: true,
            // so'rovnmoma qancha ochiq turishi
            openPeriod: 100 // sekundlarda amal qiladi
                
        );                
    }
}
```

**Natija:**

![](/files/-MR5grvxODPsc-4EoAL_)

So'rovnomani test sifatidayam o'tkazish mumkin.

```csharp
private async void Xabar_Kelganda(object sender, MessageEventArgs e)
{
    if (e.Message.Text == "poll yubor")
    {
        await client.SendPollAsync(
            chatId: e.Message.Chat.Id,
            question: "C# da i++ vazifasi nima?",
            options: new[]
            {
                "i ni qiymatini birga oshirish",
                "i ni qiymatini birga kamaytirish",
                "Hech qanday vazifa bajarmaydi"
            },
            type: Telegram.Bot.Types.Enums.PollType.Quiz,
            // to'g'ri javob idsi
            correctOptionId: 0, // 0 dan boshlanadi sanash 
            // so'rovnmoma qancha ochiq turishi
            openPeriod: 100 // sekundlarda amal qiladi
                    
        );                
    }
}
```

**Natija:**

![](/files/-MR5fuLo2DxDoM2gMQR1)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dot-net.uz/c-.net/telegram-bot/starter/xabar-turlari-va-xabar-yuborish/polls.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
