Add missing buttons parameter (#4251)

This commit is contained in:
apepenkov 2023-11-10 19:58:48 +03:00 committed by GitHub
parent 17996e8a9b
commit ea65bf001e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -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(

View File

@ -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,
)

View File

@ -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: