mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-18 11:06:39 +00:00
Add buttons parameter to client.edit_message
This commit is contained in:
parent
05e8e60291
commit
ea07cf8d12
@ -538,7 +538,8 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
|||||||
|
|
||||||
async def edit_message(
|
async def edit_message(
|
||||||
self, entity, message=None, text=None,
|
self, entity, message=None, text=None,
|
||||||
*, parse_mode=utils.Default, link_preview=True, file=None):
|
*, parse_mode=utils.Default, link_preview=True, file=None,
|
||||||
|
buttons=None):
|
||||||
"""
|
"""
|
||||||
Edits the given message ID (to change its contents or disable preview).
|
Edits the given message ID (to change its contents or disable preview).
|
||||||
|
|
||||||
@ -569,6 +570,13 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
|||||||
The file object that should replace the existing media
|
The file object that should replace the existing media
|
||||||
in the message.
|
in the message.
|
||||||
|
|
||||||
|
buttons (`list`, `custom.Button <telethon.tl.custom.button.Button>`,
|
||||||
|
:tl:`KeyboardButton`):
|
||||||
|
The matrix (list of lists), row list or button to be shown
|
||||||
|
after sending the message. This parameter will only work if
|
||||||
|
you have signed in as a bot. You can also pass your own
|
||||||
|
:tl:`ReplyMarkup` here.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
>>> client = ...
|
>>> client = ...
|
||||||
@ -604,7 +612,8 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
|||||||
message=text,
|
message=text,
|
||||||
no_webpage=not link_preview,
|
no_webpage=not link_preview,
|
||||||
entities=msg_entities,
|
entities=msg_entities,
|
||||||
media=media
|
media=media,
|
||||||
|
reply_markup=self._build_reply_markup(buttons)
|
||||||
)
|
)
|
||||||
msg = self._get_response_message(request, await self(request), entity)
|
msg = self._get_response_message(request, await self(request), entity)
|
||||||
self._cache_media(msg, file, file_handle)
|
self._cache_media(msg, file, file_handle)
|
||||||
|
Loading…
Reference in New Issue
Block a user