Oddiy pollarda bir nechta tanlovni ham amalga oshirish mumkin.
privateasyncvoidXabar_Kelganda(object sender,MessageEventArgs e){if (e.Message.Text=="poll yubor") {awaitclient.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:
So'rovnomani test sifatidayam o'tkazish mumkin.
privateasyncvoidXabar_Kelganda(object sender,MessageEventArgs e){if (e.Message.Text=="poll yubor") {awaitclient.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 ); }}