MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / receive_poll

Function receive_poll

examples/pollbot.py:140–151  ·  view source on GitHub ↗

On receiving polls, reply to it by a closed poll copying the received poll

(update: Update, context: ContextTypes.DEFAULT_TYPE)

Source from the content-addressed store, hash-verified

138
139
140async def receive_poll(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
141 """On receiving polls, reply to it by a closed poll copying the received poll"""
142 actual_poll = update.effective_message.poll
143 # Only need to set the question and options, since all other parameters don't matter for
144 # a closed poll
145 await update.effective_message.reply_poll(
146 question=actual_poll.question,
147 options=[o.text for o in actual_poll.options],
148 # with is_closed true, the poll/quiz is immediately closed
149 is_closed=True,
150 reply_markup=ReplyKeyboardRemove(),
151 )
152
153
154async def help_handler(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:

Callers

nothing calls this directly

Calls 2

ReplyKeyboardRemoveClass · 0.90
reply_pollMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…