1 回答
![?](http://img1.sycdn.imooc.com/545862770001a22702200220-100-100.jpg)
TA贡献1776条经验 获得超12个赞
通过使用远程机器人,我们可以做到这一点。这使我们有机会通过手机应用程序创建民意调查。
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)
添加回答
举报