@@ -369,6 +369,54 @@ def reply(self,
369
369
reply_markup = reply_markup
370
370
)
371
371
372
+ def edit (self , text : str , parse_mode : str = "" , disable_web_page_preview : bool = None , reply_markup = None ):
373
+ """Bound method *edit* of :obj:`Message <pyrogram.Message>
374
+
375
+ Use as a shortcut for:
376
+
377
+ .. code-block:: python
378
+
379
+ client.edit_message_text(
380
+ chat_id=message.chat.id,
381
+ message_id=message.message_id,
382
+ text="hello",
383
+ )
384
+
385
+ Example:
386
+ .. code-block:: python
387
+
388
+ message.edit("hello")
389
+
390
+ Args:
391
+ text (``str``):
392
+ New text of the message.
393
+
394
+ parse_mode (``str``, *optional*):
395
+ Use :obj:`MARKDOWN <pyrogram.ParseMode.MARKDOWN>` or :obj:`HTML <pyrogram.ParseMode.HTML>`
396
+ if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your message.
397
+ Defaults to Markdown.
398
+
399
+ disable_web_page_preview (``bool``, *optional*):
400
+ Disables link previews for links in this message.
401
+
402
+ reply_markup (:obj:`InlineKeyboardMarkup`, *optional*):
403
+ An InlineKeyboardMarkup object.
404
+
405
+ Returns:
406
+ On success, the edited :obj:`Message <pyrogram.Message>` is returned.
407
+
408
+ Raises:
409
+ :class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
410
+ """
411
+ return self ._client .edit_message_text (
412
+ chat_id = self .chat .id ,
413
+ message_id = self .message_id ,
414
+ text = text ,
415
+ parse_mode = parse_mode ,
416
+ disable_web_page_preview = disable_web_page_preview ,
417
+ reply_markup = reply_markup
418
+ )
419
+
372
420
def forward (self ,
373
421
chat_id : int or str ,
374
422
disable_notification : bool = None ):
0 commit comments