Message.reply_poll()

Message.reply_poll()

Shortcut for method send_poll will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • business_connection_id

  • reply_parameters

Example

await message.reply_poll("This is a poll", ["A", "B", "C"])
Parameters:
  • question (str | FormattedText) – Poll question, 1-255 characters (up to 300 characters for bots). Only custom emoji entities are allowed to be added and only by Premium users.

  • options (List of str | List of InputPollOption) – List of 1-12 answer options.

  • media (InputMediaPhoto | InputMediaVideo | InputMediaSticker | Location, optional) – Media attached to the poll. Currently supports only photo, video, sticker or location.

  • message_thread_id (int, optional) – Unique identifier for the target message thread (topic) of the forum. For supergroups only.

  • business_connection_id (str, optional) – Unique identifier of the business connection on behalf of which the message will be sent.

  • is_anonymous (bool, optional) – True, if the poll needs to be anonymous. Defaults to True.

  • type (PollType, optional) – Poll type, QUIZ or REGULAR. Defaults to REGULAR.

  • allows_multiple_answers (bool, optional) – Pass True, if the poll allows multiple answers. Defaults to False.

  • allows_revoting (bool, optional) – Pass True, if the poll allows to change chosen answer options.

  • members_only (bool, optional) – True, if only the users that are members of the chat for more than a day will be able to vote. For channel chats only.

  • country_codes (List of str, optional) – The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be able to vote. For channel chats only.

  • shuffle_options (bool, optional) – Pass True, if the poll options must be shown in random order.

  • allow_adding_options (bool, optional) – Pass True, if answer options can be added to the poll after creation.

  • hide_results_until_closes (bool, optional) – Pass True, if poll results must be shown only after the poll closes.

  • correct_option_ids (List of int, optional) – List of 0-based identifiers of the correct answer options, required for polls in quiz mode.

  • correct_option_id (int, optional) – 0-based identifier of the correct answer option for single-answer quizzes. Alternative to correct_option_ids.

  • explanation (str | FormattedText, optional) – Text shown when a user chooses an incorrect answer in a quiz-style poll.

  • open_period (int, optional) – Amount of time in seconds the poll will be active after creation, 5-2628000.

  • close_date (datetime, optional) – Point in time when the poll will be automatically closed.

  • is_closed (bool, optional) – Pass True, if the poll needs to be immediately closed.

  • description (str | FormattedText, optional) – Description of the poll to be sent, 0-1024 characters after entities parsing.

  • disable_notification (bool, optional) – Sends the message silently.

  • protect_content (bool, optional) – Protects the contents of the sent message from forwarding and saving.

  • allow_paid_broadcast (bool, optional) – If True, you will be allowed to send up to 1000 messages per second.

  • effect_id (int, optional) – Unique identifier of the message effect. For private chats only.

  • reply_parameters (ReplyParameters, optional) – Describes reply parameters for the message that is being sent.

  • schedule_date (datetime, optional) – Date when the message will be automatically sent.

  • repeat_period (int, optional) – Period after which the message will be sent again in seconds.

  • paid_message_star_count (int, optional) – The number of Telegram Stars the user agreed to pay to send the messages.

  • reply_markup (InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply, optional) – Additional interface options.

Returns:

On success, the sent Message is returned.

Raises:

RPCError – In case of a Telegram RPC error.