editEphemeralMessageMedia

Returns: bool

class aiogram.methods.edit_ephemeral_message_media.EditEphemeralMessageMedia(*, chat_id: int | str, receiver_user_id: int, ephemeral_message_id: int, media: InputMediaAnimation | InputMediaAudio | InputMediaDocument | InputMediaLivePhoto | InputMediaPhoto | InputMediaVideo, reply_markup: InlineKeyboardMarkup | None = None, **extra_data: Any)[source]

Use this method to edit the media of an ephemeral message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned.

Source: https://core.telegram.org/bots/api#editephemeralmessagemedia

chat_id: int | str

Unique identifier for the target chat or username of the target supergroup in the format @username

receiver_user_id: int

Identifier of the user who received the message

ephemeral_message_id: int

Identifier of the ephemeral message to edit

media: Annotated[InputMediaAnimation | InputMediaAudio | InputMediaDocument | InputMediaLivePhoto | InputMediaPhoto | InputMediaVideo, FieldInfo(annotation=NoneType, required=True, discriminator='type')]

A JSON-serialized object for the new media content of the message. A new file can’t be uploaded; use a previously uploaded file via its file_id or specify a URL

reply_markup: InlineKeyboardMarkup | None

A JSON-serialized object for an inline keyboard

Usage

As bot method

result: bool = await bot.edit_ephemeral_message_media(...)

Method as object

Imports:

  • from aiogram.methods.edit_ephemeral_message_media import EditEphemeralMessageMedia

  • alias: from aiogram.methods import EditEphemeralMessageMedia

With specific bot

result: bool = await bot(EditEphemeralMessageMedia(...))

As reply into Webhook in handler

return EditEphemeralMessageMedia(...)

As shortcut from received object