[Python] Getting the poll result from send_poll telegram bot with python

Discussão em 'Python' iniciado por Stack, Junho 21, 2025.

  1. Stack

    Stack Membro Participativo

    It's a python code for a telegram bot to take a poll from the group chat. How can I get the final result of send_poll bot? I know the bot shows the result in the chat group but I need to save and use it for later. For example, here I need the output to be like a or b.

    def poll(bot, update):
    options=['a','b']
    bot.send_poll(update.message.chat_id, "please choose option a or
    b:",options)
    updater.dispatcher.add_handler(CommandHandler('set', poll))
    updater.start_polling()


    The following picture shows the output of send_poll bot in the group chat. I like to have the answer which here is 'b', not only in the group chat also as a returned answer.

    Continue reading...

Compartilhe esta Página