mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Add missing buttons parameter (#4251)
This commit is contained in:
parent
17996e8a9b
commit
ea65bf001e
|
@ -585,6 +585,7 @@ class Client:
|
|||
markdown: Optional[str] = None,
|
||||
html: Optional[str] = None,
|
||||
link_preview: bool = False,
|
||||
buttons: Optional[Union[List[btns.Button], List[List[btns.Button]]]] = None,
|
||||
) -> Message:
|
||||
"""
|
||||
Edit a message.
|
||||
|
@ -599,6 +600,10 @@ class Client:
|
|||
:param markdown: See :ref:`formatting`.
|
||||
:param html: See :ref:`formatting`.
|
||||
:param link_preview: See :ref:`formatting`.
|
||||
:param buttons:
|
||||
The buttons to use for the message.
|
||||
|
||||
Only bot accounts can send buttons.
|
||||
|
||||
:return: The edited message.
|
||||
|
||||
|
@ -624,6 +629,7 @@ class Client:
|
|||
markdown=markdown,
|
||||
html=html,
|
||||
link_preview=link_preview,
|
||||
buttons=buttons
|
||||
)
|
||||
|
||||
async def forward_messages(
|
||||
|
|
|
@ -115,6 +115,7 @@ async def edit_message(
|
|||
markdown: Optional[str] = None,
|
||||
html: Optional[str] = None,
|
||||
link_preview: bool = False,
|
||||
buttons: Optional[Union[List[btns.Button], List[List[btns.Button]]]] = None,
|
||||
) -> Message:
|
||||
peer = (await self._resolve_to_packed(chat))._to_input_peer()
|
||||
message, entities = parse_message(
|
||||
|
@ -128,7 +129,7 @@ async def edit_message(
|
|||
id=message_id,
|
||||
message=message,
|
||||
media=None,
|
||||
reply_markup=None,
|
||||
reply_markup=btns.build_keyboard(buttons),
|
||||
entities=entities,
|
||||
schedule_date=None,
|
||||
)
|
||||
|
|
|
@ -331,6 +331,7 @@ class Message(metaclass=NoPublicConstructor):
|
|||
:param markdown: See :ref:`formatting`.
|
||||
:param html: See :ref:`formatting`.
|
||||
:param link_preview: See :meth:`~telethon.Client.send_message`.
|
||||
:param buttons: See :meth:`~telethon.Client.send_message`.
|
||||
"""
|
||||
return await self._client.send_message(
|
||||
self.chat,
|
||||
|
@ -357,6 +358,7 @@ class Message(metaclass=NoPublicConstructor):
|
|||
:param markdown: See :ref:`formatting`.
|
||||
:param html: See :ref:`formatting`.
|
||||
:param link_preview: See :meth:`~telethon.Client.send_message`.
|
||||
:param buttons: See :meth:`~telethon.Client.send_message`.
|
||||
"""
|
||||
return await self._client.send_message(
|
||||
self.chat,
|
||||
|
@ -382,6 +384,7 @@ class Message(metaclass=NoPublicConstructor):
|
|||
markdown: Optional[str] = None,
|
||||
html: Optional[str] = None,
|
||||
link_preview: bool = False,
|
||||
buttons: Optional[Union[List[Button], List[List[Button]]]] = None,
|
||||
) -> Message:
|
||||
"""
|
||||
Alias for :meth:`telethon.Client.edit_message`.
|
||||
|
@ -390,6 +393,7 @@ class Message(metaclass=NoPublicConstructor):
|
|||
:param markdown: See :ref:`formatting`.
|
||||
:param html: See :ref:`formatting`.
|
||||
:param link_preview: See :meth:`~telethon.Client.send_message`.
|
||||
:param buttons: See :meth:`~telethon.Client.send_message`.
|
||||
"""
|
||||
return await self._client.edit_message(
|
||||
self.chat,
|
||||
|
@ -398,6 +402,7 @@ class Message(metaclass=NoPublicConstructor):
|
|||
markdown=markdown,
|
||||
html=html,
|
||||
link_preview=link_preview,
|
||||
buttons=buttons,
|
||||
)
|
||||
|
||||
async def forward(self, target: ChatLike) -> Message:
|
||||
|
|
Loading…
Reference in New Issue
Block a user