1 回答

TA貢獻(xiàn)1776條經(jīng)驗(yàn) 獲得超12個(gè)贊
通過(guò)使用遠(yuǎn)程機(jī)器人,我們可以做到這一點(diǎn)。這使我們有機(jī)會(huì)通過(guò)手機(jī)應(yīng)用程序創(chuàng)建民意調(diào)查。
import telebot
from telebot.types import ReplyKeyboardMarkup,KeyboardButton,
KeyboardButtonPollType,ReplyKeyboardRemove
bot=telebot.Telebot(token='your bot token')
poll_markup=ReplyKeyboardMarkup(one_time_keyboard=True)
poll_markup.add(KeyboardButton('send me a poll',
request_poll=KeyboardButtonPollType(type='quiz')))
#from my experience, only quiz type and regular type polls can be send.
remove_board=ReplyKeyboardRemove()
bot.send_message(chat_id,text,reply_markup=poll_markup)
#some other code here
#this can be used to remove the replykeyboard when you no longer need it.
bot.send_message(chat_id,text,reply_markup=remove_board)
添加回答
舉報(bào)