【发布时间】:2023-02-12 02:47:00
【问题描述】:
我创建了一个用热图发送测验的电报机器人,但我想使用一种名为 Poll.chosen_option 的方法获得用户的答案,然后将其与正确答案进行比较! 但是这个方法没有返回,请问我该如何解决这个问题并获得用户选择的内容! 这是我的代码:
@app.on_message(filters.private & filters.text)
async def my_quiz(client, message : Message):
quiz() # function returns global vars question, answers, answersID
result = await app.send_poll(chat_id=message.chat.id, question=question, options=answers, is_anonymous=False, type="quiz", correct_option_id=answerID)
print(result.poll.chosen_option) # here it returns None, it should return the index of the answer that the user choose
【问题讨论】:
标签: python telegram-bot pyrogram