从 Telegram 的机器人中获取民意调查的结果和用户选择 API
Get poll's results and user selections from Telegram's bot API
我想知道是否有办法使用 bot API 查找用户对非匿名投票的回复。
我可以得到票数,但我想知道具体用户的实际选择。
是的,对于非匿名民意调查,您会在用户投票时收到更新。这些是 update.poll_answer
的更新,请参阅 https://core.telegram.org/bots/api#update and https://core.telegram.org/bots/api#pollanswer。
因为您使用了相应的标签,所以我假设您使用的是 python-telegram-bot
库。在这种情况下,您可以使用 PollAnswerHandler to catch those updates. Please also have a look at the pollbot.py 示例,该示例总结了一些常见的民意调查用例。
免责声明:我是 python-telegram-bot
.
的维护者
我想知道是否有办法使用 bot API 查找用户对非匿名投票的回复。 我可以得到票数,但我想知道具体用户的实际选择。
是的,对于非匿名民意调查,您会在用户投票时收到更新。这些是 update.poll_answer
的更新,请参阅 https://core.telegram.org/bots/api#update and https://core.telegram.org/bots/api#pollanswer。
因为您使用了相应的标签,所以我假设您使用的是 python-telegram-bot
库。在这种情况下,您可以使用 PollAnswerHandler to catch those updates. Please also have a look at the pollbot.py 示例,该示例总结了一些常见的民意调查用例。
免责声明:我是 python-telegram-bot
.