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(
|
async def reply_poll(
|
||||||
self,
|
self,
|
||||||
question: str,
|
question: str,
|
||||||
options: List[str],
|
options: List["types.PollOption"],
|
||||||
|
question_entities: List["types.MessageEntity"] = None,
|
||||||
is_anonymous: bool = True,
|
is_anonymous: bool = True,
|
||||||
type: "enums.PollType" = enums.PollType.REGULAR,
|
type: "enums.PollType" = enums.PollType.REGULAR,
|
||||||
allows_multiple_answers: bool = None,
|
allows_multiple_answers: bool = None,
|
||||||
|
|
@ -2950,20 +2951,34 @@ class Message(Object, Update):
|
||||||
await client.send_poll(
|
await client.send_poll(
|
||||||
chat_id=message.chat.id,
|
chat_id=message.chat.id,
|
||||||
question="This is a poll",
|
question="This is a poll",
|
||||||
options=["A", "B", "C]
|
options=[
|
||||||
|
PollOption("A"),
|
||||||
|
PollOption("B"),
|
||||||
|
PollOption("C")
|
||||||
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. 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:
|
Parameters:
|
||||||
question (``str``):
|
question (``str``):
|
||||||
Poll question, 1-255 characters.
|
Poll question, 1-255 characters.
|
||||||
|
|
||||||
options (List of ``str``):
|
options (List of :obj:`~pyrogram.types.PollOption`):
|
||||||
List of answer options, 2-10 strings 1-100 characters each.
|
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*):
|
is_anonymous (``bool``, *optional*):
|
||||||
True, if the poll needs to be anonymous.
|
True, if the poll needs to be anonymous.
|
||||||
|
|
@ -3077,6 +3092,7 @@ class Message(Object, Update):
|
||||||
chat_id=chat_id,
|
chat_id=chat_id,
|
||||||
question=question,
|
question=question,
|
||||||
options=options,
|
options=options,
|
||||||
|
question_entities=question_entities,
|
||||||
is_anonymous=is_anonymous,
|
is_anonymous=is_anonymous,
|
||||||
type=type,
|
type=type,
|
||||||
allows_multiple_answers=allows_multiple_answers,
|
allows_multiple_answers=allows_multiple_answers,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue