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

Method stop_poll

src/telegram/_bot.py:7663–7707  ·  view source on GitHub ↗

Use this method to stop a poll which was sent by the bot. Args: chat_id (:obj:`int` | :obj:`str`): |chat_id_channel| message_id (:obj:`int`): Identifier of the original message with the poll. reply_markup (:class:`telegram.InlineKeyboardMarkup`,

(
        self,
        chat_id: int | str,
        message_id: int,
        reply_markup: "InlineKeyboardMarkup | None" = None,
        business_connection_id: str | None = None,
        *,
        read_timeout: ODVInput[float] = DEFAULT_NONE,
        write_timeout: ODVInput[float] = DEFAULT_NONE,
        connect_timeout: ODVInput[float] = DEFAULT_NONE,
        pool_timeout: ODVInput[float] = DEFAULT_NONE,
        api_kwargs: JSONDict | None = None,
    )

Source from the content-addressed store, hash-verified

7661 )
7662
7663 async def stop_poll(
7664 self,
7665 chat_id: int | str,
7666 message_id: int,
7667 reply_markup: "InlineKeyboardMarkup | None" = None,
7668 business_connection_id: str | None = None,
7669 *,
7670 read_timeout: ODVInput[float] = DEFAULT_NONE,
7671 write_timeout: ODVInput[float] = DEFAULT_NONE,
7672 connect_timeout: ODVInput[float] = DEFAULT_NONE,
7673 pool_timeout: ODVInput[float] = DEFAULT_NONE,
7674 api_kwargs: JSONDict | None = None,
7675 ) -> Poll:
7676 """
7677 Use this method to stop a poll which was sent by the bot.
7678
7679 Args:
7680 chat_id (:obj:`int` | :obj:`str`): |chat_id_channel|
7681 message_id (:obj:`int`): Identifier of the original message with the poll.
7682 reply_markup (:class:`telegram.InlineKeyboardMarkup`, optional): An object for a new
7683 message inline keyboard.
7684 business_connection_id (:obj:`str`, optional): |business_id_str_edit|
7685
7686 .. versionadded:: 21.4
7687
7688 Returns:
7689 :class:`telegram.Poll`: On success, the stopped Poll is returned.
7690 """
7691 data: JSONDict = {
7692 "chat_id": chat_id,
7693 "message_id": message_id,
7694 "reply_markup": reply_markup,
7695 "business_connection_id": business_connection_id,
7696 }
7697
7698 result = await self._post(
7699 "stopPoll",
7700 data,
7701 read_timeout=read_timeout,
7702 write_timeout=write_timeout,
7703 connect_timeout=connect_timeout,
7704 pool_timeout=pool_timeout,
7705 api_kwargs=api_kwargs,
7706 )
7707 return Poll.de_json(result, self)
7708
7709 async def send_checklist(
7710 self,

Calls 2

_postMethod · 0.95
de_jsonMethod · 0.45