mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: Add support for question/options entities in Message.reply_poll bound method
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
90dc694588
commit
4112298666
1 changed files with 21 additions and 5 deletions
|
|
@ -2913,7 +2913,8 @@ class Message(Object, Update):
|
|||
async def reply_poll(
|
||||
self,
|
||||
question: str,
|
||||
options: List[str],
|
||||
options: List["types.PollOption"],
|
||||
question_entities: List["types.MessageEntity"] = None,
|
||||
is_anonymous: bool = True,
|
||||
type: "enums.PollType" = enums.PollType.REGULAR,
|
||||
allows_multiple_answers: bool = None,
|
||||
|
|
@ -2950,20 +2951,34 @@ class Message(Object, Update):
|
|||
await client.send_poll(
|
||||
chat_id=message.chat.id,
|
||||
question="This is a poll",
|
||||
options=["A", "B", "C]
|
||||
options=[
|
||||
PollOption("A"),
|
||||
PollOption("B"),
|
||||
PollOption("C")
|
||||
]
|
||||
)
|
||||
|
||||
Example:
|
||||
.. code-block:: python
|
||||
|
||||
await message.reply_poll("This is a poll", ["A", "B", "C"])
|
||||
await message.reply_poll(
|
||||
"This is a poll",
|
||||
[
|
||||
PollOption("A"),
|
||||
PollOption("B"),
|
||||
PollOption("C")
|
||||
]
|
||||
)
|
||||
|
||||
Parameters:
|
||||
question (``str``):
|
||||
Poll question, 1-255 characters.
|
||||
|
||||
options (List of ``str``):
|
||||
List of answer options, 2-10 strings 1-100 characters each.
|
||||
options (List of :obj:`~pyrogram.types.PollOption`):
|
||||
List of PollOption.
|
||||
|
||||
question_entities (List of :obj:`~pyrogram.types.MessageEntity`, *optional*):
|
||||
List of special entities that appear in the poll question, which can be specified instead of *parse_mode*.
|
||||
|
||||
is_anonymous (``bool``, *optional*):
|
||||
True, if the poll needs to be anonymous.
|
||||
|
|
@ -3077,6 +3092,7 @@ class Message(Object, Update):
|
|||
chat_id=chat_id,
|
||||
question=question,
|
||||
options=options,
|
||||
question_entities=question_entities,
|
||||
is_anonymous=is_anonymous,
|
||||
type=type,
|
||||
allows_multiple_answers=allows_multiple_answers,
|
||||
|
|
|
|||
Loading…
Reference in a new issue