mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-01-24 16:24:15 +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,
|
markdown: Optional[str] = None,
|
||||||
html: Optional[str] = None,
|
html: Optional[str] = None,
|
||||||
link_preview: bool = False,
|
link_preview: bool = False,
|
||||||
|
buttons: Optional[Union[List[btns.Button], List[List[btns.Button]]]] = None,
|
||||||
) -> Message:
|
) -> Message:
|
||||||
"""
|
"""
|
||||||
Edit a message.
|
Edit a message.
|
||||||
|
@ -599,6 +600,10 @@ class Client:
|
||||||
:param markdown: See :ref:`formatting`.
|
:param markdown: See :ref:`formatting`.
|
||||||
:param html: See :ref:`formatting`.
|
:param html: See :ref:`formatting`.
|
||||||
:param link_preview: 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.
|
:return: The edited message.
|
||||||
|
|
||||||
|
@ -624,6 +629,7 @@ class Client:
|
||||||
markdown=markdown,
|
markdown=markdown,
|
||||||
html=html,
|
html=html,
|
||||||
link_preview=link_preview,
|
link_preview=link_preview,
|
||||||
|
buttons=buttons
|
||||||
)
|
)
|
||||||
|
|
||||||
async def forward_messages(
|
async def forward_messages(
|
||||||
|
|
|
@ -115,6 +115,7 @@ async def edit_message(
|
||||||
markdown: Optional[str] = None,
|
markdown: Optional[str] = None,
|
||||||
html: Optional[str] = None,
|
html: Optional[str] = None,
|
||||||
link_preview: bool = False,
|
link_preview: bool = False,
|
||||||
|
buttons: Optional[Union[List[btns.Button], List[List[btns.Button]]]] = None,
|
||||||
) -> Message:
|
) -> Message:
|
||||||
peer = (await self._resolve_to_packed(chat))._to_input_peer()
|
peer = (await self._resolve_to_packed(chat))._to_input_peer()
|
||||||
message, entities = parse_message(
|
message, entities = parse_message(
|
||||||
|
@ -128,7 +129,7 @@ async def edit_message(
|
||||||
id=message_id,
|
id=message_id,
|
||||||
message=message,
|
message=message,
|
||||||
media=None,
|
media=None,
|
||||||
reply_markup=None,
|
reply_markup=btns.build_keyboard(buttons),
|
||||||
entities=entities,
|
entities=entities,
|
||||||
schedule_date=None,
|
schedule_date=None,
|
||||||
)
|
)
|
||||||
|
|
|
@ -331,6 +331,7 @@ class Message(metaclass=NoPublicConstructor):
|
||||||
:param markdown: See :ref:`formatting`.
|
:param markdown: See :ref:`formatting`.
|
||||||
:param html: See :ref:`formatting`.
|
:param html: See :ref:`formatting`.
|
||||||
:param link_preview: See :meth:`~telethon.Client.send_message`.
|
:param link_preview: See :meth:`~telethon.Client.send_message`.
|
||||||
|
:param buttons: See :meth:`~telethon.Client.send_message`.
|
||||||
"""
|
"""
|
||||||
return await self._client.send_message(
|
return await self._client.send_message(
|
||||||
self.chat,
|
self.chat,
|
||||||
|
@ -357,6 +358,7 @@ class Message(metaclass=NoPublicConstructor):
|
||||||
:param markdown: See :ref:`formatting`.
|
:param markdown: See :ref:`formatting`.
|
||||||
:param html: See :ref:`formatting`.
|
:param html: See :ref:`formatting`.
|
||||||
:param link_preview: See :meth:`~telethon.Client.send_message`.
|
:param link_preview: See :meth:`~telethon.Client.send_message`.
|
||||||
|
:param buttons: See :meth:`~telethon.Client.send_message`.
|
||||||
"""
|
"""
|
||||||
return await self._client.send_message(
|
return await self._client.send_message(
|
||||||
self.chat,
|
self.chat,
|
||||||
|
@ -382,6 +384,7 @@ class Message(metaclass=NoPublicConstructor):
|
||||||
markdown: Optional[str] = None,
|
markdown: Optional[str] = None,
|
||||||
html: Optional[str] = None,
|
html: Optional[str] = None,
|
||||||
link_preview: bool = False,
|
link_preview: bool = False,
|
||||||
|
buttons: Optional[Union[List[Button], List[List[Button]]]] = None,
|
||||||
) -> Message:
|
) -> Message:
|
||||||
"""
|
"""
|
||||||
Alias for :meth:`telethon.Client.edit_message`.
|
Alias for :meth:`telethon.Client.edit_message`.
|
||||||
|
@ -390,6 +393,7 @@ class Message(metaclass=NoPublicConstructor):
|
||||||
:param markdown: See :ref:`formatting`.
|
:param markdown: See :ref:`formatting`.
|
||||||
:param html: See :ref:`formatting`.
|
:param html: See :ref:`formatting`.
|
||||||
:param link_preview: See :meth:`~telethon.Client.send_message`.
|
:param link_preview: See :meth:`~telethon.Client.send_message`.
|
||||||
|
:param buttons: See :meth:`~telethon.Client.send_message`.
|
||||||
"""
|
"""
|
||||||
return await self._client.edit_message(
|
return await self._client.edit_message(
|
||||||
self.chat,
|
self.chat,
|
||||||
|
@ -398,6 +402,7 @@ class Message(metaclass=NoPublicConstructor):
|
||||||
markdown=markdown,
|
markdown=markdown,
|
||||||
html=html,
|
html=html,
|
||||||
link_preview=link_preview,
|
link_preview=link_preview,
|
||||||
|
buttons=buttons,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def forward(self, target: ChatLike) -> Message:
|
async def forward(self, target: ChatLike) -> Message:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user